import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:taskservice/src/acclist/page_acclist.dart'; import 'package:taskservice/src/crtacc/page_crtacc.dart'; import 'package:taskservice/src/home/home.dart'; import 'package:taskservice/src/service/page_addservice.dart'; import 'package:taskservice/src/service/page_servicelist.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( onGenerateRoute: (RouteSettings settings){ var name = settings.name; if(name == '$CreateAccPage') { return CupertinoPageRoute(builder: (context)=> CreateAccPage()); }else if(name == '$AccountListPage') { return CupertinoPageRoute(builder: (context)=> AccountListPage()); }else if(name == '$CreateServiceList') { return CupertinoPageRoute(builder: (context)=> CreateServiceList(), settings: settings); }else if(name == '$CreateAddService') { return CupertinoPageRoute(builder: (context)=> CreateAddService(), settings: settings); } return null; }, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: 'JXZS',), ); } }