main.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:taskservice/src/acclist/page_acclist.dart';
  4. import 'package:taskservice/src/crtacc/page_crtacc.dart';
  5. import 'package:taskservice/src/home/home.dart';
  6. import 'package:taskservice/src/service/page_addservice.dart';
  7. import 'package:taskservice/src/service/page_servicelist.dart';
  8. void main() {
  9. runApp(MyApp());
  10. }
  11. class MyApp extends StatelessWidget {
  12. // This widget is the root of your application.
  13. @override
  14. Widget build(BuildContext context) {
  15. return MaterialApp(
  16. onGenerateRoute: (RouteSettings settings){
  17. var name = settings.name;
  18. if(name == '$CreateAccPage') {
  19. return CupertinoPageRoute(builder: (context)=> CreateAccPage());
  20. }else if(name == '$AccountListPage') {
  21. return CupertinoPageRoute(builder: (context)=> AccountListPage());
  22. }else if(name == '$CreateServiceList') {
  23. return CupertinoPageRoute(builder: (context)=> CreateServiceList(), settings: settings);
  24. }else if(name == '$CreateAddService') {
  25. return CupertinoPageRoute(builder: (context)=> CreateAddService(), settings: settings);
  26. }
  27. return null;
  28. },
  29. theme: ThemeData(
  30. primarySwatch: Colors.blue,
  31. visualDensity: VisualDensity.adaptivePlatformDensity,
  32. ),
  33. home: MyHomePage(title: 'JXZS',),
  34. );
  35. }
  36. }