|
|
@ -14,7 +14,7 @@ void topMain() => runApp(const MyApp(color: Colors.green));
|
|
|
|
void bottomMain() => runApp(const MyApp(color: Colors.purple));
|
|
|
|
void bottomMain() => runApp(const MyApp(color: Colors.purple));
|
|
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({Key key, @required this.color}) : super(key: key);
|
|
|
|
const MyApp({Key? key, required this.color}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
final MaterialColor color;
|
|
|
|
final MaterialColor color;
|
|
|
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ class MyApp extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class MyHomePage extends StatefulWidget {
|
|
|
|
class MyHomePage extends StatefulWidget {
|
|
|
|
const MyHomePage({Key key, this.title}) : super(key: key);
|
|
|
|
const MyHomePage({Key? key, required this.title}) : super(key: key);
|
|
|
|
final String title;
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -39,8 +39,8 @@ class MyHomePage extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
int _counter = 0;
|
|
|
|
int? _counter = 0;
|
|
|
|
MethodChannel _channel;
|
|
|
|
late MethodChannel _channel;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
@ -50,7 +50,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
if (call.method == "setCount") {
|
|
|
|
if (call.method == "setCount") {
|
|
|
|
// A notification that the host platform's data model has been updated.
|
|
|
|
// A notification that the host platform's data model has been updated.
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
_counter = call.arguments as int;
|
|
|
|
_counter = call.arguments as int?;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw Exception('not implemented ${call.method}');
|
|
|
|
throw Exception('not implemented ${call.method}');
|
|
|
|