123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import 'dart:io';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter_clock/index_page.dart';
- import 'package:flutter_clock/utils/app_utils.dart';
- /// Description: enter point of the app
- /// Time : 04/06/2025 Sunday
- /// Author : liuyuqi.gov@msn.cn
- void main() async {
- WidgetsFlutterBinding.ensureInitialized();
- AppUtils.setOverrideForDesktop();
-
- // Configure system settings for better background execution
- if (Platform.isAndroid) {
- SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- statusBarIconBrightness: Brightness.dark,
- ));
-
- // Prevent app from being killed in background
- SystemChannels.platform.invokeMethod('SystemChrome.setEnabledSystemUIMode', [
- SystemUiMode.edgeToEdge.index,
- ]);
- }
-
- runApp(MyApp());
- }
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Flutter Clock',
- debugShowCheckedModeBanner: false,
- theme: ThemeData(
- primarySwatch: Colors.blue,
- visualDensity: VisualDensity.adaptivePlatformDensity,
- fontFamily: 'Roboto',
- ),
- home: IndexPage(),
- );
- }
- }
|