Skip to content

Commit

Permalink
Merge NNBD branch into master (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer committed Jan 27, 2021
1 parent 1c7d23b commit f3e92fd
Show file tree
Hide file tree
Showing 23 changed files with 449 additions and 732 deletions.
3 changes: 3 additions & 0 deletions .cirrus.yml
Expand Up @@ -7,6 +7,9 @@ task:
upgrade_script:
- flutter channel master
- flutter upgrade
# TODO(goderbauer): Remove next two lines when https://github.com/flutter/flutter/issues/74772 is resolved.
- rm -rf /home/cirrus/sdks/flutter/bin/cache
- flutter doctor
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
matrix:
Expand Down
4 changes: 4 additions & 0 deletions packages/animations/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

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

## [2.0.0-nullsafety.0] - November 16, 2020

* Migrates to null safety.

## [1.1.2] - July 28, 2020

* Fixes for upcoming changes to the flutter framework.
Expand Down
34 changes: 17 additions & 17 deletions packages/animations/example/lib/container_transition.dart
Expand Up @@ -50,7 +50,7 @@ class _OpenContainerTransformDemoState
extends State<OpenContainerTransformDemo> {
ContainerTransitionType _transitionType = ContainerTransitionType.fade;

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

class _OpenContainerWrapper extends StatelessWidget {
const _OpenContainerWrapper({
this.closedBuilder,
this.transitionType,
this.onClosed,
required this.closedBuilder,
required this.transitionType,
required this.onClosed,
});

final OpenContainerBuilder closedBuilder;
final CloseContainerBuilder closedBuilder;
final ContainerTransitionType transitionType;
final ClosedCallback<bool> onClosed;
final ClosedCallback<bool?> onClosed;

@override
Widget build(BuildContext context) {
Expand All @@ -295,7 +295,7 @@ class _OpenContainerWrapper extends StatelessWidget {
}

class _ExampleCard extends StatelessWidget {
const _ExampleCard({this.openContainer});
const _ExampleCard({required this.openContainer});

final VoidCallback openContainer;

Expand Down Expand Up @@ -333,7 +333,7 @@ class _ExampleCard extends StatelessWidget {
'adipiscing elit, sed do eiusmod tempor.',
style: Theme.of(context)
.textTheme
.bodyText2
.bodyText2!
.copyWith(color: Colors.black54),
),
),
Expand All @@ -345,8 +345,8 @@ class _ExampleCard extends StatelessWidget {

class _SmallerCard extends StatelessWidget {
const _SmallerCard({
this.openContainer,
this.subtitle,
required this.openContainer,
required this.subtitle,
});

final VoidCallback openContainer;
Expand Down Expand Up @@ -397,7 +397,7 @@ class _SmallerCard extends StatelessWidget {
}

class _ExampleSingleTile extends StatelessWidget {
const _ExampleSingleTile({this.openContainer});
const _ExampleSingleTile({required this.openContainer});

final VoidCallback openContainer;

Expand Down Expand Up @@ -454,10 +454,10 @@ class _InkWellOverlay extends StatelessWidget {
this.child,
});

final VoidCallback openContainer;
final double width;
final double height;
final Widget child;
final VoidCallback? openContainer;
final double? width;
final double? height;
final Widget? child;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -510,15 +510,15 @@ class _DetailsPage extends StatelessWidget {
children: <Widget>[
Text(
'Title',
style: Theme.of(context).textTheme.headline5.copyWith(
style: Theme.of(context).textTheme.headline5!.copyWith(
color: Colors.black54,
fontSize: 30.0,
),
),
const SizedBox(height: 10),
Text(
_loremIpsumParagraph,
style: Theme.of(context).textTheme.bodyText2.copyWith(
style: Theme.of(context).textTheme.bodyText2!.copyWith(
color: Colors.black54,
height: 1.5,
fontSize: 16.0,
Expand Down
6 changes: 2 additions & 4 deletions packages/animations/example/lib/fade_scale_transition.dart
Expand Up @@ -14,7 +14,7 @@ class FadeScaleTransitionDemo extends StatefulWidget {

class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
with SingleTickerProviderStateMixin {
AnimationController _controller;
late AnimationController _controller;

@override
void initState() {
Expand Down Expand Up @@ -48,8 +48,6 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
case AnimationStatus.dismissed:
return false;
}
assert(false);
return null;
}

@override
Expand All @@ -58,7 +56,7 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
appBar: AppBar(title: const Text('Fade')),
floatingActionButton: AnimatedBuilder(
animation: _controller,
builder: (BuildContext context, Widget child) {
builder: (BuildContext context, Widget? child) {
return FadeScaleTransition(
animation: _controller,
child: child,
Expand Down
6 changes: 3 additions & 3 deletions packages/animations/example/lib/main.dart
Expand Up @@ -126,11 +126,11 @@ class _TransitionsHomePageState extends State<_TransitionsHomePage> {
class _TransitionListTile extends StatelessWidget {
const _TransitionListTile({
this.onTap,
this.title,
this.subtitle,
required this.title,
required this.subtitle,
});

final GestureTapCallback onTap;
final GestureTapCallback? onTap;
final String title;
final String subtitle;

Expand Down
14 changes: 7 additions & 7 deletions packages/animations/example/lib/shared_axis_transition.dart
Expand Up @@ -14,11 +14,11 @@ class SharedAxisTransitionDemo extends StatefulWidget {
}

class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
SharedAxisTransitionType _transitionType =
SharedAxisTransitionType? _transitionType =
SharedAxisTransitionType.horizontal;
bool _isLoggedIn = false;

void _updateTransitionType(SharedAxisTransitionType newType) {
void _updateTransitionType(SharedAxisTransitionType? newType) {
setState(() {
_transitionType = newType;
});
Expand Down Expand Up @@ -51,7 +51,7 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
child: child,
animation: animation,
secondaryAnimation: secondaryAnimation,
transitionType: _transitionType,
transitionType: _transitionType!,
);
},
child: _isLoggedIn ? _CoursePage() : _SignInPage(),
Expand Down Expand Up @@ -80,23 +80,23 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
Radio<SharedAxisTransitionType>(
value: SharedAxisTransitionType.horizontal,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
onChanged: (SharedAxisTransitionType? newValue) {
_updateTransitionType(newValue);
},
),
const Text('X'),
Radio<SharedAxisTransitionType>(
value: SharedAxisTransitionType.vertical,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
onChanged: (SharedAxisTransitionType? newValue) {
_updateTransitionType(newValue);
},
),
const Text('Y'),
Radio<SharedAxisTransitionType>(
value: SharedAxisTransitionType.scaled,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
onChanged: (SharedAxisTransitionType? newValue) {
_updateTransitionType(newValue);
},
),
Expand Down Expand Up @@ -146,7 +146,7 @@ class _CoursePage extends StatelessWidget {

class _CourseSwitch extends StatefulWidget {
const _CourseSwitch({
this.course,
required this.course,
});

final String course;
Expand Down
2 changes: 1 addition & 1 deletion packages/animations/example/pubspec.yaml
Expand Up @@ -6,7 +6,7 @@ publish_to: none
version: 0.0.1

environment:
sdk: ">=2.3.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"

dependencies:
animations:
Expand Down

0 comments on commit f3e92fd

Please sign in to comment.