main.dart 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_page.dart';
  5. import 'package:physigo/friends/friends_page.dart';
  6. import 'navigation/navigation_page.dart';
  7. import 'firebase_options.dart';
  8. import 'push_notifications_initializer.dart';
  9. void main() async {
  10. WidgetsFlutterBinding.ensureInitialized();
  11. await Firebase.initializeApp(
  12. options: DefaultFirebaseOptions.currentPlatform,
  13. );
  14. handleMessages();
  15. runApp(const PhysiGo());
  16. }
  17. class PhysiGo extends StatelessWidget {
  18. const PhysiGo({Key? key}) : super(key: key);
  19. @override
  20. Widget build(BuildContext context) {
  21. return MaterialApp(
  22. title: 'PhysiGo',
  23. theme: ThemeData(
  24. primarySwatch: Colors.blue,
  25. ),
  26. home: const HomePage(),
  27. );
  28. }
  29. }
  30. class HomePage extends StatelessWidget {
  31. const HomePage({Key? key}) : super(key: key);
  32. @override
  33. Widget build(BuildContext context) {
  34. return SafeArea(
  35. child: Scaffold(
  36. body: Column(
  37. mainAxisAlignment: MainAxisAlignment.center,
  38. children: [
  39. Center(
  40. child: TextButton(
  41. onPressed: () {
  42. Navigator.push(
  43. context,
  44. MaterialPageRoute(
  45. // Example on how to use NavigationPage
  46. builder: (context) => NavigationPage(
  47. destination: LatLng(51.78036111980833, 19.451262207821234),
  48. ),
  49. ),
  50. );
  51. },
  52. child: const Text('Navigation')),
  53. ),
  54. Center(
  55. child: TextButton(
  56. onPressed: () {
  57. Navigator.push(
  58. context,
  59. MaterialPageRoute(
  60. builder: (context) => const ExercisesPage(),
  61. ),
  62. );
  63. },
  64. child: const Text('Exercises'),
  65. ),
  66. ),
  67. Center(
  68. child: TextButton(
  69. onPressed: () {
  70. Navigator.push(
  71. context,
  72. MaterialPageRoute(
  73. builder: (context) => const FriendsPage(),
  74. ),
  75. );
  76. },
  77. child: const Text('Friends'),
  78. ),
  79. ),
  80. ],
  81. ),
  82. ),
  83. );
  84. }
  85. }