moepoi.dev/lib/main.dart

44 lines
1.5 KiB
Dart
Raw Normal View History

2022-06-06 07:55:49 +02:00
import 'package:page_transition/page_transition.dart';
2022-06-05 05:18:03 +02:00
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:flutter/material.dart';
import 'package:moepoi_site/screens/home.dart';
import 'package:moepoi_site/screens/projects.dart';
import 'package:moepoi_site/screens/resume.dart';
import 'package:moepoi_site/screens/skills.dart';
void main() {
setUrlStrategy(PathUrlStrategy());
runApp(const Moepoi());
}
class Moepoi extends StatefulWidget {
const Moepoi({Key? key}) : super(key: key);
@override
State<Moepoi> createState() => _MoepoiState();
}
class _MoepoiState extends State<Moepoi> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
2022-06-05 17:34:36 +02:00
initialRoute: '/',
2022-06-06 07:55:49 +02:00
onGenerateRoute: (settings) {
switch (settings.name) {
case '/':
2022-06-08 10:22:55 +02:00
return PageTransition(child: const Home(), type: PageTransitionType.fade, settings: settings);
2022-06-06 07:55:49 +02:00
case '/resume':
2022-06-08 10:22:55 +02:00
return PageTransition(child: const Resume(), type: PageTransitionType.leftToRight, settings: settings);
2022-06-06 07:55:49 +02:00
case '/skills':
2022-06-08 10:22:55 +02:00
return PageTransition(child: const Skills(), type: PageTransitionType.bottomToTop, settings: settings);
2022-06-06 07:55:49 +02:00
case '/projects':
2022-06-08 10:22:55 +02:00
return PageTransition(child: const Projects(), type: PageTransitionType.rightToLeft, settings: settings);
2022-06-06 07:55:49 +02:00
default:
2022-06-08 10:22:55 +02:00
return PageTransition(child: const Home(), type: PageTransitionType.fade, settings: settings);
2022-06-06 07:55:49 +02:00
}
2022-06-05 05:18:03 +02:00
},
);
}
}