import 'package:flutter/material.dart'; /// Description: routes /// Time : 09/03/2023 Sunday /// Author : liuyuqi.gov@msn.cn class Routes { static const String home = '/'; static const String index = '/index'; static const String login = '/login'; static MaterialPageRoute generateRoute(RouteSettings settings) { switch (settings.name) { case home: return MaterialPageRoute( builder: (_) => const Scaffold(), settings: settings, ); default: return MaterialPageRoute( builder: (_) => const Scaffold(), settings: settings, ); } } void go(BuildContext context, String routeName) { Navigator.pushNamed(context, routeName); } }