Skip to content

Commit e953b9c

Browse files
committed
chore: update null safety
1 parent b152ace commit e953b9c

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

example/lib/main.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@ class MyApp extends StatelessWidget {
88
@override
99
Widget build(BuildContext context) {
1010
return MaterialApp(
11-
title: 'Flutter Demo',
12-
theme: ThemeData(
13-
primarySwatch: Colors.blue,
14-
),
15-
home: HomePage()
16-
);
11+
title: 'Flutter Demo',
12+
theme: ThemeData(
13+
primarySwatch: Colors.blue,
14+
),
15+
home: HomePage());
1716
}
1817
}
1918

2019
class HomePage extends StatefulWidget {
21-
HomePage({Key key}) : super(key: key);
20+
HomePage({Key? key}) : super(key: key);
2221

2322
@override
2423
_HomePageState createState() => _HomePageState();
2524
}
2625

2726
class _HomePageState extends State<HomePage> {
28-
2927
final ScrollController scrollController = ScrollController();
3028
final List<String> entries = <String>[
3129
'A',
@@ -59,9 +57,10 @@ class _HomePageState extends State<HomePage> {
5957
@override
6058
Widget build(BuildContext context) {
6159
return Scaffold(
62-
body: Stack(
63-
children: <Widget>[listDemo(), FluentAppBar(scrollController: scrollController, titleText: 'Home')]
64-
),
60+
body: Stack(children: <Widget>[
61+
listDemo(),
62+
FluentAppBar(scrollController: scrollController, titleText: 'Home')
63+
]),
6564
);
6665
}
6766

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: A new Flutter project.
1414
version: 1.0.0+1
1515

1616
environment:
17-
sdk: ">=2.1.0 <3.0.0"
17+
sdk: ">=2.12.0 <3.0.0"
1818

1919
dependencies:
2020
flutter:

lib/fluent_appbar.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import 'package:flutter/material.dart';
44

55
class FluentAppBar extends StatefulWidget {
66
FluentAppBar({
7-
Key key,
8-
@required this.titleText,
9-
@required this.scrollController,
7+
Key? key,
8+
required this.titleText,
9+
required this.scrollController,
1010
this.scrollOffset = 34,
1111
this.appBarColor = Colors.white,
1212
this.boxShadowColor = Colors.black,
@@ -29,8 +29,8 @@ class FluentAppBar extends StatefulWidget {
2929
class _FluentAppBarState extends State<FluentAppBar>
3030
with TickerProviderStateMixin {
3131
double topBarOpacity = 0.0;
32-
Animation<double> topBarAnimation;
33-
AnimationController animationController;
32+
late Animation<double> topBarAnimation;
33+
late AnimationController animationController;
3434

3535
@override
3636
void initState() {
@@ -85,7 +85,7 @@ class _FluentAppBarState extends State<FluentAppBar>
8585
children: <Widget>[
8686
AnimatedBuilder(
8787
animation: animationController,
88-
builder: (BuildContext context, Widget child) {
88+
builder: (BuildContext context, Widget? child) {
8989
return FadeTransition(
9090
opacity: topBarAnimation,
9191
child: Transform(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 1.0.0
44
homepage: https://github.com/DonsWayo/fluent_appbar
55

66
environment:
7-
sdk: ">=2.1.0 <3.0.0"
7+
sdk: ">=2.12.0 <3.0.0"
88

99
dependencies:
1010
flutter:

0 commit comments

Comments
 (0)