1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Updated deprecated widgets with new one (#689)

This commit is contained in:
Adarsh kumar singh
2021-02-06 03:40:49 +05:30
committed by GitHub
parent 323c10558d
commit d4f4065a6e
3 changed files with 32 additions and 36 deletions

View File

@@ -34,9 +34,7 @@ class _HomePageState extends State<HomePage> {
appBar: AppBar( appBar: AppBar(
title: Text('Federated Plugin Demo'), title: Text('Federated Plugin Demo'),
), ),
body: Builder( body: Center(
builder: (context) {
return Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@@ -56,7 +54,7 @@ class _HomePageState extends State<HomePage> {
batteryLevel = result; batteryLevel = result;
}); });
} catch (error) { } catch (error) {
Scaffold.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
content: Text(error.message as String), content: Text(error.message as String),
@@ -67,8 +65,6 @@ class _HomePageState extends State<HomePage> {
), ),
], ],
), ),
);
},
), ),
); );
} }

View File

@@ -212,4 +212,4 @@ packages:
version: "2.1.0-nullsafety.5" version: "2.1.0-nullsafety.5"
sdks: sdks:
dart: ">=2.12.0-0.0 <3.0.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.20.0 <2.0.0" flutter: ">=1.20.0"

View File

@@ -198,4 +198,4 @@ packages:
version: "2.1.0-nullsafety.5" version: "2.1.0-nullsafety.5"
sdks: sdks:
dart: ">=2.12.0-0.0 <3.0.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.20.0 <2.0.0" flutter: ">=1.20.0"