main.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. void main() async {
  7. WidgetsFlutterBinding.ensureInitialized();
  8. await Firebase.initializeApp(
  9. options: DefaultFirebaseOptions.currentPlatform,
  10. );
  11. runApp(const PhysiGo());
  12. }
  13. class PhysiGo extends StatelessWidget {
  14. const PhysiGo({Key? key}) : super(key: key);
  15. @override
  16. Widget build(BuildContext context) {
  17. return MaterialApp(
  18. title: 'PhysiGo',
  19. theme: ThemeData(
  20. primarySwatch: Colors.blue,
  21. ),
  22. home: const HomePage(),
  23. );
  24. }
  25. }
  26. class HomePage extends StatelessWidget {
  27. const HomePage({Key? key}) : super(key: key);
  28. @override
  29. Widget build(BuildContext context) {
  30. return Scaffold(
  31. body: Center(
  32. child: TextButton(
  33. onPressed: () {
  34. Navigator.push(
  35. context,
  36. MaterialPageRoute(
  37. // Example on how to use NavigationPage
  38. builder: (context) => NavigationPage(
  39. destination: LatLng(51.78036111980833, 19.451262207821234),
  40. ),
  41. ),
  42. );
  43. },
  44. child: const Text('Navigation')),
  45. ),
  46. );
  47. }
  48. }