|
@@ -1,7 +1,20 @@
|
|
|
-import 'package:flutter/material.dart';
|
|
|
+import 'dart:io';
|
|
|
|
|
|
-void main() {
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/services.dart';
|
|
|
+import 'package:flutter_chinese_chees/pages/home_page.dart';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+void main() async {
|
|
|
+ WidgetsFlutterBinding.ensureInitialized();
|
|
|
runApp(const MyApp());
|
|
|
+ if (Platform.isAndroid) {
|
|
|
+ SystemUiOverlayStyle systemUiOverlayStyle =
|
|
|
+ const SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
|
|
+ SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
@@ -12,104 +25,11 @@ class MyApp extends StatelessWidget {
|
|
|
Widget build(BuildContext context) {
|
|
|
return MaterialApp(
|
|
|
title: 'Flutter Demo',
|
|
|
+ debugShowCheckedModeBanner: false,
|
|
|
theme: ThemeData(
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
primarySwatch: Colors.blue,
|
|
|
),
|
|
|
- home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class MyHomePage extends StatefulWidget {
|
|
|
- const MyHomePage({super.key, required this.title});
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- State<MyHomePage> createState() => _MyHomePageState();
|
|
|
-}
|
|
|
-
|
|
|
-class _MyHomePageState extends State<MyHomePage> {
|
|
|
- int _counter = 0;
|
|
|
-
|
|
|
- void _incrementCounter() {
|
|
|
- setState(() {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- _counter++;
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
-
|
|
|
-
|
|
|
- title: Text(widget.title),
|
|
|
- ),
|
|
|
- body: Center(
|
|
|
-
|
|
|
-
|
|
|
- child: Column(
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: <Widget>[
|
|
|
- const Text(
|
|
|
- 'You have pushed the button this many times:',
|
|
|
- ),
|
|
|
- Text(
|
|
|
- '$_counter',
|
|
|
- style: Theme.of(context).textTheme.headlineMedium,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- floatingActionButton: FloatingActionButton(
|
|
|
- onPressed: _incrementCounter,
|
|
|
- tooltip: 'Increment',
|
|
|
- child: const Icon(Icons.add),
|
|
|
- ),
|
|
|
+ home: const HomePage(),
|
|
|
);
|
|
|
}
|
|
|
}
|