Skip to content
This repository was archived by the owner on Sep 11, 2022. It is now read-only.

Commit 5535b05

Browse files
committed
Fix Status Bar Icons Color and Dialog Height
1 parent f722dc7 commit 5535b05

File tree

6 files changed

+104
-75
lines changed

6 files changed

+104
-75
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ sudo apt-get install libwebkit2gtk-4.0-dev
5555

5656
## Tests
5757

58-
The code is about 100% covered covered by the unit/widget tests. To run all unit and widget tests use the following command:
58+
The code is almost 100% covered covered by the unit/widget tests. To run all unit and widget tests use the following command:
5959

6060
```sh
6161
flutter test --coverage --test-randomize-ordering-seed random

lib/app/view/app.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'package:flutter_svg/flutter_svg.dart';
1515
import '../../helpers/helpers.dart';
1616
import '../../helpers/prefetch_web_to_memory.dart';
1717
import '../../l10n/l10n.dart';
18+
import '../../map/models/illustration_colors.dart';
1819
import '../../puzzle/puzzle.dart';
1920

2021
/// Main app configuration
@@ -93,10 +94,13 @@ class _AppState extends State<App> {
9394

9495
@override
9596
Widget build(BuildContext context) => MaterialApp(
97+
debugShowCheckedModeBanner: false,
9698
theme: ThemeData(
97-
appBarTheme: const AppBarTheme(color: Color(0xFF13B9FF)),
99+
appBarTheme: const AppBarTheme(
100+
color: IllustrationColors.seaColor,
101+
),
98102
colorScheme: ColorScheme.fromSwatch(
99-
accentColor: const Color(0xFF13B9FF),
103+
accentColor: IllustrationColors.seaColor,
100104
),
101105
),
102106
localizationsDelegates: const [

lib/app/view/system_ui.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:io' show Platform;
22

33
import 'package:flutter/foundation.dart';
44
import 'package:flutter/material.dart';
5+
import 'package:flutter/services.dart';
56
// ignore: implementation_imports
67
import 'package:window_size/src/window_size_channel.dart';
78

@@ -26,6 +27,7 @@ class SystemUI {
2627

2728
bool init() {
2829
WidgetsFlutterBinding.ensureInitialized();
30+
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
2931
if (!kIsWeb &&
3032
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
3133
try {

lib/map/widgets/island_map_countdown.dart

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,23 @@ class _IslandMapCountdownState extends State<IslandMapCountdown> {
7171
}
7272
},
7373
child: ResponsiveLayoutBuilder(
74-
small: (_, __) => const SizedBox(),
74+
small: (_, __) =>
75+
BlocBuilder<IslandMapPuzzleBloc, IslandMapPuzzleState>(
76+
builder: (context, state) {
77+
if (!state.isCountdownRunning || state.secondsToBegin > 3) {
78+
return const SizedBox();
79+
}
80+
81+
if (state.secondsToBegin > 0) {
82+
return IslandMapCountdownSecondsToBegin(
83+
key: ValueKey(state.secondsToBegin),
84+
secondsToBegin: state.secondsToBegin,
85+
);
86+
} else {
87+
return const IslandMapCountdownGo();
88+
}
89+
},
90+
),
7591
medium: (_, __) =>
7692
BlocBuilder<IslandMapPuzzleBloc, IslandMapPuzzleState>(
7793
builder: (context, state) {
@@ -255,7 +271,7 @@ class _IslandMapCountdownGoState extends State<IslandMapCountdownGo>
255271
const theme = GreenIslandMapTheme();
256272

257273
return Padding(
258-
padding: const EdgeInsets.only(top: 101),
274+
padding: const EdgeInsets.only(top: 50),
259275
child: FadeTransition(
260276
opacity: outOpacity,
261277
child: FadeTransition(

lib/map/widgets/island_map_share_dialog.dart

Lines changed: 75 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -66,88 +66,93 @@ class _IslandMapShareDialogState extends State<IslandMapShareDialog>
6666
}
6767

6868
@override
69-
Widget build(BuildContext context) => AudioControlListener(
70-
key: const Key('island_map_share_dialog_success_audio_player'),
71-
audioPlayer: _successAudioPlayer,
69+
Widget build(BuildContext context) => SizedBox(
70+
height: 700,
7271
child: AudioControlListener(
73-
key: const Key('island_map_share_dialog_click_audio_player'),
74-
audioPlayer: _clickAudioPlayer,
75-
child: ResponsiveLayoutBuilder(
76-
small: (_, child) => child!,
77-
medium: (_, child) => child!,
78-
child: (currentSize) {
79-
final padding = currentSize == ResponsiveLayoutSize.medium
80-
? const EdgeInsets.fromLTRB(48, 54, 48, 53)
81-
: const EdgeInsets.fromLTRB(20, 99, 20, 76);
72+
key: const Key('island_map_share_dialog_success_audio_player'),
73+
audioPlayer: _successAudioPlayer,
74+
child: AudioControlListener(
75+
key: const Key('island_map_share_dialog_click_audio_player'),
76+
audioPlayer: _clickAudioPlayer,
77+
child: ResponsiveLayoutBuilder(
78+
small: (_, child) => child!,
79+
medium: (_, child) => child!,
80+
child: (currentSize) {
81+
final padding = currentSize == ResponsiveLayoutSize.medium
82+
? const EdgeInsets.fromLTRB(48, 54, 48, 53)
83+
: const EdgeInsets.fromLTRB(20, 99, 20, 76);
8284

83-
final closeIconOffset = currentSize == ResponsiveLayoutSize.medium
84-
? const Offset(25, 28)
85-
: const Offset(17, 63);
85+
final closeIconOffset =
86+
currentSize == ResponsiveLayoutSize.medium
87+
? const Offset(25, 28)
88+
: const Offset(17, 63);
8689

87-
return Stack(
88-
key: const Key('island_map_share_dialog'),
89-
children: [
90-
SingleChildScrollView(
91-
child: LayoutBuilder(
92-
builder: (context, constraints) => SizedBox(
93-
width: constraints.maxWidth,
94-
child: Padding(
95-
padding: padding,
96-
child: IslandMapShareDialogAnimatedBuilder(
97-
animation: _controller,
98-
builder: (context, child, animation) => Column(
99-
mainAxisSize: MainAxisSize.min,
100-
children: [
101-
SlideTransition(
102-
position: animation.scoreOffset,
103-
child: Opacity(
104-
opacity: animation.scoreOpacity.value,
105-
child: const IslandMapScore(),
90+
return Stack(
91+
alignment: Alignment.center,
92+
key: const Key('island_map_share_dialog'),
93+
children: [
94+
SingleChildScrollView(
95+
child: LayoutBuilder(
96+
builder: (context, constraints) => SizedBox(
97+
width: constraints.maxWidth,
98+
child: Padding(
99+
padding: padding,
100+
child: IslandMapShareDialogAnimatedBuilder(
101+
animation: _controller,
102+
builder: (context, child, animation) => Column(
103+
mainAxisSize: MainAxisSize.min,
104+
children: [
105+
SlideTransition(
106+
position: animation.scoreOffset,
107+
child: Opacity(
108+
opacity: animation.scoreOpacity.value,
109+
child: const IslandMapScore(),
110+
),
106111
),
107-
),
108-
const ResponsiveGap(small: 32, medium: 32),
109-
IslandMapShareYourScore(
110-
animation: animation,
111-
),
112-
],
112+
const ResponsiveGap(small: 32, medium: 32),
113+
IslandMapShareYourScore(
114+
animation: animation,
115+
),
116+
],
117+
),
113118
),
114119
),
115120
),
116121
),
117122
),
118-
),
119-
Align(
120-
alignment: Alignment.topCenter,
121-
child: ConfettiWidget(
122-
confettiController: _confettiController,
123-
blastDirectionality: BlastDirectionality.explosive,
124-
shouldLoop: true,
123+
Align(
124+
alignment: Alignment.topCenter,
125+
child: ConfettiWidget(
126+
confettiController: _confettiController,
127+
blastDirectionality: BlastDirectionality.explosive,
128+
shouldLoop: true,
129+
),
125130
),
126-
),
127-
Positioned(
128-
right: closeIconOffset.dx,
129-
top: closeIconOffset.dy,
130-
child: IconButton(
131-
key: const Key('island_map_share_dialog_close_button'),
132-
splashColor: Colors.transparent,
133-
highlightColor: Colors.transparent,
134-
hoverColor: Colors.transparent,
135-
padding: EdgeInsets.zero,
136-
constraints: const BoxConstraints(),
137-
iconSize: 18,
138-
icon: const Icon(
139-
Icons.close,
140-
color: PuzzleColors.black,
131+
Positioned(
132+
right: closeIconOffset.dx,
133+
top: closeIconOffset.dy,
134+
child: IconButton(
135+
key: const Key('island_map_share_dialog_close_button'),
136+
splashColor: Colors.transparent,
137+
highlightColor: Colors.transparent,
138+
hoverColor: Colors.transparent,
139+
padding: EdgeInsets.zero,
140+
constraints: const BoxConstraints(),
141+
iconSize: 18,
142+
icon: const Icon(
143+
Icons.close,
144+
color: PuzzleColors.black,
145+
),
146+
onPressed: () {
147+
unawaited(_clickAudioPlayer.play());
148+
Navigator.of(context).pop();
149+
},
141150
),
142-
onPressed: () {
143-
unawaited(_clickAudioPlayer.play());
144-
Navigator.of(context).pop();
145-
},
146151
),
147-
),
148-
],
149-
);
150-
},
152+
],
153+
);
154+
},
155+
),
151156
),
152157
),
153158
);

lib/map/widgets/island_map_share_your_score.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ class IslandMapShareYourScore extends StatelessWidget {
4343

4444
return Column(
4545
key: const Key('island_map_share_your_score'),
46+
mainAxisSize: MainAxisSize.min,
4647
children: [
4748
SlideTransition(
4849
position: animation.shareYourScoreOffset,
4950
child: Opacity(
5051
opacity: animation.shareYourScoreOpacity.value,
5152
child: Column(
53+
mainAxisSize: MainAxisSize.min,
5254
children: [
5355
Text(
5456
l10n.islandMapSuccessShareYourScoreTitle,

0 commit comments

Comments
 (0)