main.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:get/get.dart';
  4. import 'package:provider/provider.dart';
  5. import 'package:trtc_demo/page/hardware_detection/view.dart';
  6. import 'package:trtc_demo/page/trtcmeetingdemo/index.dart';
  7. import 'package:trtc_demo/page/trtcmeetingdemo/meeting.dart';
  8. import 'package:trtc_demo/page/trtcmeetingdemo/member_list.dart';
  9. import 'package:trtc_demo/models/meeting.dart';
  10. void main() {
  11. WidgetsFlutterBinding.ensureInitialized();
  12. SystemChrome.setPreferredOrientations(
  13. [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]).then((_) {
  14. runApp(MyApp());
  15. });
  16. }
  17. class MyApp extends StatefulWidget {
  18. @override
  19. _MyAppState createState() => _MyAppState();
  20. }
  21. class _MyAppState extends State<MyApp> {
  22. @override
  23. Widget build(BuildContext context) {
  24. return ChangeNotifierProvider(
  25. create: (context) => MeetingModel(),
  26. child: GetMaterialApp(
  27. routes: {
  28. "/": (context) => IndexPage(),
  29. "/index": (context) => IndexPage(),
  30. "/video": (context) => MeetingPage(),
  31. "/memberList": (context) => MemberListPage(),
  32. "/hardwareDetectionPage": (context) => HardwareDetectionPage(),
  33. },
  34. ),
  35. );
  36. }
  37. }