123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import 'package:flutter/material.dart';
- import 'package:video/screen/detail.dart';
- import 'package:video/screen/home.dart';
- import 'package:video/screen/page/changLog.dart';
- import 'package:video/screen/widget/searchBottomWidget.dart';
- import 'package:video/screen/widget/searchResult.dart';
- Route<dynamic> generateRoute(RouteSettings settings) {
- switch (settings.name) {
- case 'home':
- return MaterialPageRoute(
- builder: (context) => Home(),
- );
- case 'detail':
- var arguments = settings.arguments as Map;
- return MaterialPageRoute(
- builder: (context) => MovieDetail(
- url: arguments["url"],
- video: arguments["video"],
- ),
- );
- case 'search':
- return MaterialPageRoute(
- builder: (context) => SearchBottom(),
- );
- case 'searchResult':
- var arguments = settings.arguments as Map;
- return MaterialPageRoute(
- builder: (context) => SearchResult(
- query: arguments["query"],
- ),
- );
- case 'changLog':
- return MaterialPageRoute(
- builder: (context) => ChangeLogPage(),
- );
- default:
- return MaterialPageRoute(
- builder: (context) => Home(),
- );
- }
- }
|