Skip to content

Commit 9ab2467

Browse files
authored
Merge pull request #40 from line/fix/warning
Fix warning in example project
2 parents 2170e71 + d8bf370 commit 9ab2467

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

Diff for: example/lib/src/screen/home_page.dart

+11-13
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@ class _HomePageState extends State<HomePage>
6060
_configCard(),
6161
Expanded(
6262
child: Center(
63-
child: RaisedButton(
64-
textColor: textColor,
65-
color: accentColor,
66-
onPressed: _signIn,
67-
child: Text('Sign In'),
68-
),
69-
),
63+
child: ElevatedButton(
64+
child: Text('Sign In'),
65+
onPressed: _signIn,
66+
style: ElevatedButton.styleFrom(
67+
primary: accentColor, onPrimary: textColor))),
7068
),
7169
],
7270
),
@@ -183,12 +181,12 @@ class _HomePageState extends State<HomePage>
183181
return AlertDialog(
184182
content: Text(text),
185183
actions: <Widget>[
186-
FlatButton(
187-
child: Text('Close'),
188-
onPressed: () {
189-
Navigator.of(context).pop();
190-
},
191-
),
184+
TextButton(
185+
child: Text('Close'),
186+
onPressed: () {
187+
Navigator.of(context).pop();
188+
},
189+
style: TextButton.styleFrom(primary: accentColor)),
192190
],
193191
);
194192
},

Diff for: example/lib/src/widget/user_info_widget.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ class UserInfoWidget extends StatelessWidget {
3131
: Icon(Icons.person),
3232
Text(
3333
userProfile.displayName,
34-
style: Theme.of(context).textTheme.headline,
34+
style: Theme.of(context).textTheme.headline5,
3535
),
3636
if (userEmail != null) Text(userEmail!),
3737
Text(userProfile.statusMessage!),
3838
Container(
39-
child: RaisedButton(
40-
textColor: textColor,
41-
color: accentColor,
42-
child: Text('Sign Out'),
43-
onPressed: onSignOutPressed as void Function()?,
44-
),
45-
),
39+
child: ElevatedButton(
40+
child: Text('Sign Out'),
41+
onPressed: () {
42+
onSignOutPressed.call();
43+
},
44+
style: ElevatedButton.styleFrom(
45+
primary: accentColor, onPrimary: textColor))),
4646
],
4747
),
4848
);

0 commit comments

Comments
 (0)