Skip to content

Commit 84f59b0

Browse files
committed
Dart format
1 parent 9c76ea1 commit 84f59b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+354
-565
lines changed

animations/step_02_a/lib/home_screen.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ class HomeScreen extends StatelessWidget {
1111
child: Column(
1212
mainAxisSize: MainAxisSize.min,
1313
children: [
14-
Text(
15-
'✏️',
16-
style: Theme.of(context).textTheme.displayLarge,
17-
),
14+
Text('✏️', style: Theme.of(context).textTheme.displayLarge),
1815
Text(
1916
'Flutter Quiz',
2017
style: Theme.of(context).textTheme.displayLarge!.copyWith(
21-
fontWeight: FontWeight.w700,
22-
color: Theme.of(context).colorScheme.onPrimaryFixedVariant),
18+
fontWeight: FontWeight.w700,
19+
color: Theme.of(context).colorScheme.onPrimaryFixedVariant,
20+
),
2321
),
2422
ElevatedButton(
2523
onPressed: () {

animations/step_02_a/lib/model.dart

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ List<Question> _createQuestions() {
3030
return [
3131
Question(
3232
'What class used to create custom explicit animations in Flutter?',
33-
[
34-
'AnimationController',
35-
'AnimatedWidget',
36-
'AnimatedBuilder',
37-
'Tween',
38-
],
33+
['AnimationController', 'AnimatedWidget', 'AnimatedBuilder', 'Tween'],
3934
0,
4035
),
4136
Question(
@@ -50,12 +45,7 @@ List<Question> _createQuestions() {
5045
),
5146
Question(
5247
'What class is used to define the start and end values for an animation?',
53-
[
54-
'Tween',
55-
'Curve',
56-
'AnimationController',
57-
'AnimatedWidget',
58-
],
48+
['Tween', 'Curve', 'AnimationController', 'AnimatedWidget'],
5949
0,
6050
),
6151
];

animations/step_02_a/lib/question_screen.dart

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class QuestionScreen extends StatefulWidget {
99
}
1010

1111
class _QuestionScreenState extends State<QuestionScreen> {
12-
late final QuizViewModel viewModel =
13-
QuizViewModel(onGameOver: _handleGameOver);
12+
late final QuizViewModel viewModel = QuizViewModel(
13+
onGameOver: _handleGameOver,
14+
);
1415

1516
@override
1617
Widget build(BuildContext context) {
@@ -24,11 +25,11 @@ class _QuestionScreenState extends State<QuestionScreen> {
2425
onPressed:
2526
viewModel.hasNextQuestion && viewModel.didAnswerQuestion
2627
? () {
27-
viewModel.getNextQuestion();
28-
}
28+
viewModel.getNextQuestion();
29+
}
2930
: null,
3031
child: const Text('Next'),
31-
)
32+
),
3233
],
3334
),
3435
body: Center(
@@ -41,9 +42,10 @@ class _QuestionScreenState extends State<QuestionScreen> {
4142
viewModel.checkAnswer(index);
4243
},
4344
answers: viewModel.currentQuestion?.possibleAnswers ?? [],
44-
correctAnswer: viewModel.didAnswerQuestion
45-
? viewModel.currentQuestion?.correctAnswer
46-
: null,
45+
correctAnswer:
46+
viewModel.didAnswerQuestion
47+
? viewModel.currentQuestion?.correctAnswer
48+
: null,
4749
),
4850
StatusBar(viewModel: viewModel),
4951
],
@@ -79,10 +81,7 @@ class _QuestionScreenState extends State<QuestionScreen> {
7981
class QuestionCard extends StatelessWidget {
8082
final String? question;
8183

82-
const QuestionCard({
83-
required this.question,
84-
super.key,
85-
});
84+
const QuestionCard({required this.question, super.key});
8685

8786
@override
8887
Widget build(BuildContext context) {

animations/step_02_a/lib/scoreboard.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Scoreboard extends StatelessWidget {
2323
size: 50,
2424
color:
2525
score < i + 1 ? Colors.grey.shade400 : Colors.yellow.shade700,
26-
)
26+
),
2727
],
2828
),
2929
);

animations/step_02_a/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ publish_to: "none"
44
version: 1.0.0
55

66
environment:
7-
sdk: ^3.5.1
7+
sdk: ^3.7.0-0
88

99
dependencies:
1010
animations: ^2.0.0

animations/step_02_b/lib/home_screen.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ class HomeScreen extends StatelessWidget {
1111
child: Column(
1212
mainAxisSize: MainAxisSize.min,
1313
children: [
14-
Text(
15-
'✏️',
16-
style: Theme.of(context).textTheme.displayLarge,
17-
),
14+
Text('✏️', style: Theme.of(context).textTheme.displayLarge),
1815
Text(
1916
'Flutter Quiz',
2017
style: Theme.of(context).textTheme.displayLarge!.copyWith(
21-
fontWeight: FontWeight.w700,
22-
color: Theme.of(context).colorScheme.onPrimaryFixedVariant),
18+
fontWeight: FontWeight.w700,
19+
color: Theme.of(context).colorScheme.onPrimaryFixedVariant,
20+
),
2321
),
2422
ElevatedButton(
2523
onPressed: () {

animations/step_02_b/lib/model.dart

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ List<Question> _createQuestions() {
3030
return [
3131
Question(
3232
'What class used to create custom explicit animations in Flutter?',
33-
[
34-
'AnimationController',
35-
'AnimatedWidget',
36-
'AnimatedBuilder',
37-
'Tween',
38-
],
33+
['AnimationController', 'AnimatedWidget', 'AnimatedBuilder', 'Tween'],
3934
0,
4035
),
4136
Question(
@@ -50,12 +45,7 @@ List<Question> _createQuestions() {
5045
),
5146
Question(
5247
'What class is used to define the start and end values for an animation?',
53-
[
54-
'Tween',
55-
'Curve',
56-
'AnimationController',
57-
'AnimatedWidget',
58-
],
48+
['Tween', 'Curve', 'AnimationController', 'AnimatedWidget'],
5949
0,
6050
),
6151
];

animations/step_02_b/lib/question_screen.dart

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ class QuestionScreen extends StatefulWidget {
1010
}
1111

1212
class _QuestionScreenState extends State<QuestionScreen> {
13-
late final QuizViewModel viewModel =
14-
QuizViewModel(onGameOver: _handleGameOver);
13+
late final QuizViewModel viewModel = QuizViewModel(
14+
onGameOver: _handleGameOver,
15+
);
1516

1617
@override
1718
Widget build(BuildContext context) {
@@ -25,11 +26,11 @@ class _QuestionScreenState extends State<QuestionScreen> {
2526
onPressed:
2627
viewModel.hasNextQuestion && viewModel.didAnswerQuestion
2728
? () {
28-
viewModel.getNextQuestion();
29-
}
29+
viewModel.getNextQuestion();
30+
}
3031
: null,
3132
child: const Text('Next'),
32-
)
33+
),
3334
],
3435
),
3536
body: Center(
@@ -42,9 +43,10 @@ class _QuestionScreenState extends State<QuestionScreen> {
4243
viewModel.checkAnswer(index);
4344
},
4445
answers: viewModel.currentQuestion?.possibleAnswers ?? [],
45-
correctAnswer: viewModel.didAnswerQuestion
46-
? viewModel.currentQuestion?.correctAnswer
47-
: null,
46+
correctAnswer:
47+
viewModel.didAnswerQuestion
48+
? viewModel.currentQuestion?.correctAnswer
49+
: null,
4850
),
4951
StatusBar(viewModel: viewModel),
5052
],
@@ -80,10 +82,7 @@ class _QuestionScreenState extends State<QuestionScreen> {
8082
class QuestionCard extends StatelessWidget {
8183
final String? question;
8284

83-
const QuestionCard({
84-
required this.question,
85-
super.key,
86-
});
85+
const QuestionCard({required this.question, super.key});
8786

8887
@override
8988
Widget build(BuildContext context) {

animations/step_02_b/lib/scoreboard.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Scoreboard extends StatelessWidget {
2323
size: 50,
2424
color:
2525
score < i + 1 ? Colors.grey.shade400 : Colors.yellow.shade700,
26-
)
26+
),
2727
],
2828
),
2929
);

animations/step_02_b/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ publish_to: "none"
44
version: 1.0.0
55

66
environment:
7-
sdk: ^3.5.1
7+
sdk: ^3.7.0-0
88

99
dependencies:
1010
animations: ^2.0.0

0 commit comments

Comments
 (0)