Flutter之Fluro

1、首先引入fluro

Flutter之Fluro_第1张图片

2、新建一个文件夹命名为routes(此文件夹可随意命名),并在文件夹中新建文件application.dart

import 'package:fluro/fluro.dart';
class Application {
  static Router router;
}

3、在routes文件夹下新建文件routes.dart(命名路由并)

import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import './router_handler.dart';
class Routes {
  static String root = '/';
  static String indexPage = '/index';
  static String categoryPage = '/category/:id';
  static String cartPage = '/cart';
  static String memberPage = '/member';
  static String homePage = '/home';

  static void configureRoutes(Router router) 

你可能感兴趣的:(Flutter)