main.dart 974 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_easyloading/flutter_easyloading.dart';
  4. import 'package:prime_chat/screens/InitScreen.dart';
  5. void main() {
  6. WidgetsFlutterBinding.ensureInitialized();
  7. // 强制竖屏
  8. SystemChrome.setPreferredOrientations([
  9. DeviceOrientation.portraitUp,
  10. DeviceOrientation.portraitDown
  11. ]);
  12. runApp(const MyApp());
  13. }
  14. class MyApp extends StatelessWidget {
  15. const MyApp({super.key});
  16. // This widget is the root of your application.
  17. @override
  18. Widget build(BuildContext context) {
  19. return MaterialApp(
  20. title: 'Flutter Demo',
  21. theme: ThemeData(
  22. primarySwatch: Colors.blue,
  23. appBarTheme: const AppBarTheme(
  24. color: Colors.black12,
  25. titleTextStyle: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.w500),
  26. elevation: 0,
  27. )
  28. ),
  29. home: const InitScreen(),
  30. );
  31. }
  32. }