app_component.dart 968 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * fluro
  3. * Created by Yakka
  4. * https://theyakka.com
  5. *
  6. * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  7. * See LICENSE for distribution and usage details.
  8. */
  9. import 'package:fluro/fluro.dart';
  10. import 'package:flutter/material.dart';
  11. import '../../config/application.dart';
  12. import '../../config/routes.dart';
  13. class AppComponent extends StatefulWidget {
  14. @override
  15. State createState() {
  16. return AppComponentState();
  17. }
  18. }
  19. class AppComponentState extends State<AppComponent> {
  20. AppComponentState() {
  21. final router = Router();
  22. Routes.configureRoutes(router);
  23. Application.router = router;
  24. }
  25. @override
  26. Widget build(BuildContext context) {
  27. final app = MaterialApp(
  28. title: 'Fluro',
  29. debugShowCheckedModeBanner: false,
  30. theme: ThemeData(
  31. primarySwatch: Colors.blue,
  32. ),
  33. onGenerateRoute: Application.router.generator,
  34. );
  35. // print("initial route = ${app.initialRoute}");
  36. return app;
  37. }
  38. }