main.dart 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 'challenges/challenge_page.dart';
  6. import 'firebase_options.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: Column(
  33. mainAxisAlignment: MainAxisAlignment.center,
  34. crossAxisAlignment: CrossAxisAlignment.center,
  35. children: [Center(
  36. child: TextButton(
  37. onPressed: () {
  38. Navigator.push(
  39. context,
  40. MaterialPageRoute(
  41. // Example on how to use NavigationPage
  42. builder: (context) => NavigationPage(
  43. destination: LatLng(51.78036111980833, 19.451262207821234),
  44. ),
  45. ),
  46. );
  47. },
  48. child: const Text('Navigation')),
  49. ),
  50. Center(
  51. child: TextButton(
  52. onPressed: () {
  53. Navigator.push(
  54. context,
  55. MaterialPageRoute(
  56. // Example on how to use NavigationPage
  57. builder: (context) => const ChallengePage(),
  58. ),
  59. );
  60. },
  61. child: const Text('Challenges')),
  62. ),],
  63. )
  64. );
  65. }
  66. }