|
4 | 4 |
|
5 | 5 | // ignore_for_file: public_member_api_docs |
6 | 6 |
|
7 | | -import 'dart:async'; |
8 | 7 | import 'dart:developer' as developer; |
9 | | -import 'dart:io'; |
10 | 8 |
|
11 | | -import 'package:flutter/foundation.dart'; |
12 | 9 | import 'package:flutter/material.dart'; |
13 | 10 | import 'package:flutter/services.dart'; |
14 | 11 | import 'package:network_info_plus/network_info_plus.dart'; |
15 | 12 |
|
16 | | -// Sets a platform override for desktop to avoid exceptions. See |
17 | | -// https://flutter.dev/desktop#target-platform-override for more info. |
18 | | -void _enablePlatformOverrideForDesktop() { |
19 | | - if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) { |
20 | | - debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; |
21 | | - } |
22 | | -} |
23 | | - |
24 | 13 | void main() { |
25 | | - _enablePlatformOverrideForDesktop(); |
26 | 14 | runApp(const MyApp()); |
27 | 15 | } |
28 | 16 |
|
29 | 17 | class MyApp extends StatelessWidget { |
30 | 18 | const MyApp({super.key}); |
31 | 19 |
|
32 | | - // This widget is the root of your application. |
33 | 20 | @override |
34 | 21 | Widget build(BuildContext context) { |
35 | 22 | return MaterialApp( |
@@ -70,18 +57,20 @@ class _MyHomePageState extends State<MyHomePage> { |
70 | 57 | elevation: 4, |
71 | 58 | ), |
72 | 59 | body: Center( |
73 | | - child: Column( |
74 | | - mainAxisSize: MainAxisSize.min, |
75 | | - children: [ |
76 | | - const Text( |
77 | | - 'Network info', |
78 | | - style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), |
| 60 | + child: Column( |
| 61 | + mainAxisSize: MainAxisSize.min, |
| 62 | + children: [ |
| 63 | + const Text( |
| 64 | + 'Network info', |
| 65 | + style: TextStyle( |
| 66 | + fontSize: 16, |
| 67 | + fontWeight: FontWeight.bold, |
79 | 68 | ), |
80 | | - const SizedBox(height: 16), |
81 | | - Text(_connectionStatus), |
82 | | - ], |
83 | | - ), |
84 | | - ), |
| 69 | + ), |
| 70 | + const SizedBox(height: 16), |
| 71 | + Text(_connectionStatus), |
| 72 | + ], |
| 73 | + )), |
85 | 74 | ); |
86 | 75 | } |
87 | 76 |
|
|
0 commit comments