main.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import 'package:firebase_core/firebase_core.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:latlong2/latlong.dart';
  4. import 'navigation/navigation_page.dart';
  5. import 'firebase_options.dart';
  6. import 'package:physigo/exercises/exercises_validation/exercise_validation_page.dart';
  7. void main() async {
  8. WidgetsFlutterBinding.ensureInitialized();
  9. await Firebase.initializeApp(
  10. options: DefaultFirebaseOptions.currentPlatform,
  11. );
  12. runApp(const PhysiGo());
  13. }
  14. class PhysiGo extends StatelessWidget {
  15. const PhysiGo({Key? key}) : super(key: key);
  16. @override
  17. Widget build(BuildContext context) {
  18. return MaterialApp(
  19. title: 'PhysiGo',
  20. theme: ThemeData(
  21. primarySwatch: Colors.blue,
  22. ),
  23. home: const HomePage(),
  24. );
  25. }
  26. }
  27. class HomePage extends StatelessWidget {
  28. const HomePage({Key? key}) : super(key: key);
  29. @override
  30. Widget build(BuildContext context) {
  31. return Scaffold(
  32. body: Center(
  33. child: Column(
  34. children: [
  35. TextButton(
  36. onPressed: () {
  37. Navigator.push(
  38. context,
  39. MaterialPageRoute(
  40. // Example on how to use NavigationPage
  41. builder: (context) => NavigationPage(
  42. destination: LatLng(51.78036111980833, 19.451262207821234),
  43. ),
  44. ),
  45. );
  46. },
  47. child: const Text('Navigation'),
  48. ),
  49. TextButton(
  50. onPressed: () {
  51. Navigator.push(
  52. context,
  53. MaterialPageRoute(
  54. builder: (context) => ExerciseValidationPage(),
  55. ),
  56. );
  57. },
  58. child: const Text('Exercise Validation'),
  59. ),
  60. ],
  61. ),
  62. ),
  63. );
  64. }
  65. }