main.dart 804 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:flutter/material.dart';
  2. import 'package:project02marinzhang/top.dart';
  3. import 'package:project02marinzhang/year.dart';
  4. import 'actor.dart';
  5. import 'home.dart';
  6. void main() => runApp(MyApp());
  7. class MyApp extends StatelessWidget {
  8. // This widget is the root of your application.
  9. @override
  10. Widget build(BuildContext context) {
  11. return MaterialApp(
  12. title: 'Navigation Over Screens',
  13. theme: ThemeData(
  14. primarySwatch: Colors.blue,
  15. ),
  16. // home: MainPage(),
  17. // Declare routes
  18. routes: {
  19. // Main initial route
  20. '/': (context) => Home(),
  21. // Second route
  22. '/second': (context) => Actor(),
  23. '/third': (context) => Year(),
  24. '/fourth': (context) => Top(),
  25. },
  26. initialRoute: '/',
  27. );
  28. }
  29. }