main.dart 2.0 KB

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