@@ -42,7 +42,7 @@ class MyApp extends StatelessWidget {
4242}
4343
4444class MyHomePage extends StatefulWidget {
45- MyHomePage ({Key key, this .title}) : super (key: key);
45+ MyHomePage ({Key ? key, required this .title}) : super (key: key);
4646
4747 final String title;
4848
@@ -54,7 +54,7 @@ class _MyHomePageState extends State<MyHomePage> {
5454 String _connectionStatus = 'Unknown' ;
5555 final Connectivity _connectivity = Connectivity ();
5656 final WifiInfo _wifiInfo = WifiInfo ();
57- StreamSubscription <ConnectivityResult > _connectivitySubscription;
57+ late StreamSubscription <ConnectivityResult > _connectivitySubscription;
5858
5959 @override
6060 void initState () {
@@ -72,7 +72,7 @@ class _MyHomePageState extends State<MyHomePage> {
7272
7373 // Platform messages are asynchronous, so we initialize in an async method.
7474 Future <void > initConnectivity () async {
75- ConnectivityResult result;
75+ late ConnectivityResult result;
7676 // Platform messages may fail, so we use a try/catch PlatformException.
7777 try {
7878 result = await _connectivity.checkConnectivity ();
@@ -103,7 +103,7 @@ class _MyHomePageState extends State<MyHomePage> {
103103 Future <void > _updateConnectionStatus (ConnectivityResult result) async {
104104 switch (result) {
105105 case ConnectivityResult .wifi:
106- String wifiName, wifiBSSID, wifiIP;
106+ String ? wifiName, wifiBSSID, wifiIP;
107107
108108 try {
109109 if (! kIsWeb && Platform .isIOS) {
0 commit comments