main.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_servicelist.dart';
  7. void main() {
  8. runApp(MyApp());
  9. }
  10. class MyApp extends StatelessWidget {
  11. // This widget is the root of your application.
  12. @override
  13. Widget build(BuildContext context) {
  14. return MaterialApp(
  15. onGenerateRoute: (RouteSettings settings){
  16. var name = settings.name;
  17. if(name == '$CreateAccPage') {
  18. return CupertinoPageRoute(builder: (context)=> CreateAccPage());
  19. }else if(name == '$AccountListPage') {
  20. return CupertinoPageRoute(builder: (context)=> AccountListPage());
  21. }else if(name == '$CreateServiceList') {
  22. return CupertinoPageRoute(builder: (context)=> CreateServiceList());
  23. }
  24. return null;
  25. },
  26. theme: ThemeData(
  27. primarySwatch: Colors.blue,
  28. visualDensity: VisualDensity.adaptivePlatformDensity,
  29. ),
  30. home: MyHomePage(title: 'JXZS',),
  31. );
  32. }
  33. }