main.dart 850 B

1234567891011121314151617181920212223242526272829303132333435
  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. const MyApp({Key? key}) : super(key: key);
  9. // This widget is the root of your application.
  10. @override
  11. Widget build(BuildContext context) {
  12. return MaterialApp(
  13. title: 'Navigation Over Screens',
  14. theme: ThemeData(
  15. primarySwatch: Colors.blue,
  16. ),
  17. // home: MainPage(),
  18. // Declare routes
  19. routes: {
  20. // Main initial route
  21. '/': (context) => Home(),
  22. // Second route
  23. '/second': (context) => Actor(),
  24. '/third': (context) => Year(),
  25. '/fourth': (context) => Top(),
  26. },
  27. initialRoute: '/',
  28. );
  29. }
  30. }