main.dart 995 B

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