11import 'package:flutter/material.dart' ;
2- import 'dart:async' ;
3-
4- import 'package:flutter/services.dart' ;
5- import 'package:reflex/reflex.dart' ;
62
73void main () {
84 runApp (const MyApp ());
@@ -16,34 +12,9 @@ class MyApp extends StatefulWidget {
1612}
1713
1814class _MyAppState extends State <MyApp > {
19- String _platformVersion = 'Unknown' ;
20-
2115 @override
2216 void initState () {
2317 super .initState ();
24- initPlatformState ();
25- }
26-
27- // Platform messages are asynchronous, so we initialize in an async method.
28- Future <void > initPlatformState () async {
29- String platformVersion;
30- // Platform messages may fail, so we use a try/catch PlatformException.
31- // We also handle the message potentially returning null.
32- try {
33- platformVersion =
34- await Reflex .platformVersion ?? 'Unknown platform version' ;
35- } on PlatformException {
36- platformVersion = 'Failed to get platform version.' ;
37- }
38-
39- // If the widget was removed from the tree while the asynchronous platform
40- // message was in flight, we want to discard the reply rather than calling
41- // setState to update our non-existent appearance.
42- if (! mounted) return ;
43-
44- setState (() {
45- _platformVersion = platformVersion;
46- });
4718 }
4819
4920 @override
@@ -53,8 +24,8 @@ class _MyAppState extends State<MyApp> {
5324 appBar: AppBar (
5425 title: const Text ('Plugin example app' ),
5526 ),
56- body: Center (
57- child: Text ('Running on: $ _platformVersion \n ' ),
27+ body: const Center (
28+ child: Text ('App Running!! \n ' ),
5829 ),
5930 ),
6031 );
0 commit comments