Skip to content

Commit f3e92fd

Browse files
authored
Merge NNBD branch into master (#270)
1 parent 1c7d23b commit f3e92fd

23 files changed

+449
-732
lines changed

.cirrus.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ task:
77
upgrade_script:
88
- flutter channel master
99
- flutter upgrade
10+
# TODO(goderbauer): Remove next two lines when https://github.com/flutter/flutter/issues/74772 is resolved.
11+
- rm -rf /home/cirrus/sdks/flutter/bin/cache
12+
- flutter doctor
1013
- git fetch origin master
1114
activate_script: pub global activate flutter_plugin_tools
1215
matrix:

packages/animations/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.0.0-nullsafety.0] - November 16, 2020
6+
7+
* Migrates to null safety.
8+
59
## [1.1.2] - July 28, 2020
610

711
* Fixes for upcoming changes to the flutter framework.

packages/animations/example/lib/container_transition.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class _OpenContainerTransformDemoState
5050
extends State<OpenContainerTransformDemo> {
5151
ContainerTransitionType _transitionType = ContainerTransitionType.fade;
5252

53-
void _showMarkedAsDoneSnackbar(bool isMarkedAsDone) {
53+
void _showMarkedAsDoneSnackbar(bool? isMarkedAsDone) {
5454
if (isMarkedAsDone ?? false)
5555
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
5656
content: Text('Marked as done!'),
@@ -271,14 +271,14 @@ class _OpenContainerTransformDemoState
271271

272272
class _OpenContainerWrapper extends StatelessWidget {
273273
const _OpenContainerWrapper({
274-
this.closedBuilder,
275-
this.transitionType,
276-
this.onClosed,
274+
required this.closedBuilder,
275+
required this.transitionType,
276+
required this.onClosed,
277277
});
278278

279-
final OpenContainerBuilder closedBuilder;
279+
final CloseContainerBuilder closedBuilder;
280280
final ContainerTransitionType transitionType;
281-
final ClosedCallback<bool> onClosed;
281+
final ClosedCallback<bool?> onClosed;
282282

283283
@override
284284
Widget build(BuildContext context) {
@@ -295,7 +295,7 @@ class _OpenContainerWrapper extends StatelessWidget {
295295
}
296296

297297
class _ExampleCard extends StatelessWidget {
298-
const _ExampleCard({this.openContainer});
298+
const _ExampleCard({required this.openContainer});
299299

300300
final VoidCallback openContainer;
301301

@@ -333,7 +333,7 @@ class _ExampleCard extends StatelessWidget {
333333
'adipiscing elit, sed do eiusmod tempor.',
334334
style: Theme.of(context)
335335
.textTheme
336-
.bodyText2
336+
.bodyText2!
337337
.copyWith(color: Colors.black54),
338338
),
339339
),
@@ -345,8 +345,8 @@ class _ExampleCard extends StatelessWidget {
345345

346346
class _SmallerCard extends StatelessWidget {
347347
const _SmallerCard({
348-
this.openContainer,
349-
this.subtitle,
348+
required this.openContainer,
349+
required this.subtitle,
350350
});
351351

352352
final VoidCallback openContainer;
@@ -397,7 +397,7 @@ class _SmallerCard extends StatelessWidget {
397397
}
398398

399399
class _ExampleSingleTile extends StatelessWidget {
400-
const _ExampleSingleTile({this.openContainer});
400+
const _ExampleSingleTile({required this.openContainer});
401401

402402
final VoidCallback openContainer;
403403

@@ -454,10 +454,10 @@ class _InkWellOverlay extends StatelessWidget {
454454
this.child,
455455
});
456456

457-
final VoidCallback openContainer;
458-
final double width;
459-
final double height;
460-
final Widget child;
457+
final VoidCallback? openContainer;
458+
final double? width;
459+
final double? height;
460+
final Widget? child;
461461

462462
@override
463463
Widget build(BuildContext context) {
@@ -510,15 +510,15 @@ class _DetailsPage extends StatelessWidget {
510510
children: <Widget>[
511511
Text(
512512
'Title',
513-
style: Theme.of(context).textTheme.headline5.copyWith(
513+
style: Theme.of(context).textTheme.headline5!.copyWith(
514514
color: Colors.black54,
515515
fontSize: 30.0,
516516
),
517517
),
518518
const SizedBox(height: 10),
519519
Text(
520520
_loremIpsumParagraph,
521-
style: Theme.of(context).textTheme.bodyText2.copyWith(
521+
style: Theme.of(context).textTheme.bodyText2!.copyWith(
522522
color: Colors.black54,
523523
height: 1.5,
524524
fontSize: 16.0,

packages/animations/example/lib/fade_scale_transition.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class FadeScaleTransitionDemo extends StatefulWidget {
1414

1515
class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
1616
with SingleTickerProviderStateMixin {
17-
AnimationController _controller;
17+
late AnimationController _controller;
1818

1919
@override
2020
void initState() {
@@ -48,8 +48,6 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
4848
case AnimationStatus.dismissed:
4949
return false;
5050
}
51-
assert(false);
52-
return null;
5351
}
5452

5553
@override
@@ -58,7 +56,7 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
5856
appBar: AppBar(title: const Text('Fade')),
5957
floatingActionButton: AnimatedBuilder(
6058
animation: _controller,
61-
builder: (BuildContext context, Widget child) {
59+
builder: (BuildContext context, Widget? child) {
6260
return FadeScaleTransition(
6361
animation: _controller,
6462
child: child,

packages/animations/example/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ class _TransitionsHomePageState extends State<_TransitionsHomePage> {
126126
class _TransitionListTile extends StatelessWidget {
127127
const _TransitionListTile({
128128
this.onTap,
129-
this.title,
130-
this.subtitle,
129+
required this.title,
130+
required this.subtitle,
131131
});
132132

133-
final GestureTapCallback onTap;
133+
final GestureTapCallback? onTap;
134134
final String title;
135135
final String subtitle;
136136

packages/animations/example/lib/shared_axis_transition.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class SharedAxisTransitionDemo extends StatefulWidget {
1414
}
1515

1616
class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
17-
SharedAxisTransitionType _transitionType =
17+
SharedAxisTransitionType? _transitionType =
1818
SharedAxisTransitionType.horizontal;
1919
bool _isLoggedIn = false;
2020

21-
void _updateTransitionType(SharedAxisTransitionType newType) {
21+
void _updateTransitionType(SharedAxisTransitionType? newType) {
2222
setState(() {
2323
_transitionType = newType;
2424
});
@@ -51,7 +51,7 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
5151
child: child,
5252
animation: animation,
5353
secondaryAnimation: secondaryAnimation,
54-
transitionType: _transitionType,
54+
transitionType: _transitionType!,
5555
);
5656
},
5757
child: _isLoggedIn ? _CoursePage() : _SignInPage(),
@@ -80,23 +80,23 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
8080
Radio<SharedAxisTransitionType>(
8181
value: SharedAxisTransitionType.horizontal,
8282
groupValue: _transitionType,
83-
onChanged: (SharedAxisTransitionType newValue) {
83+
onChanged: (SharedAxisTransitionType? newValue) {
8484
_updateTransitionType(newValue);
8585
},
8686
),
8787
const Text('X'),
8888
Radio<SharedAxisTransitionType>(
8989
value: SharedAxisTransitionType.vertical,
9090
groupValue: _transitionType,
91-
onChanged: (SharedAxisTransitionType newValue) {
91+
onChanged: (SharedAxisTransitionType? newValue) {
9292
_updateTransitionType(newValue);
9393
},
9494
),
9595
const Text('Y'),
9696
Radio<SharedAxisTransitionType>(
9797
value: SharedAxisTransitionType.scaled,
9898
groupValue: _transitionType,
99-
onChanged: (SharedAxisTransitionType newValue) {
99+
onChanged: (SharedAxisTransitionType? newValue) {
100100
_updateTransitionType(newValue);
101101
},
102102
),
@@ -146,7 +146,7 @@ class _CoursePage extends StatelessWidget {
146146

147147
class _CourseSwitch extends StatefulWidget {
148148
const _CourseSwitch({
149-
this.course,
149+
required this.course,
150150
});
151151

152152
final String course;

packages/animations/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish_to: none
66
version: 0.0.1
77

88
environment:
9-
sdk: ">=2.3.0 <3.0.0"
9+
sdk: ">=2.12.0-0 <3.0.0"
1010

1111
dependencies:
1212
animations:

0 commit comments

Comments
 (0)