main.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:flutter/material.dart';
  2. import 'package:firebase_core/firebase_core.dart';
  3. import 'package:physigo/firebase_options.dart';
  4. import 'package:physigo/walking/walking_page.dart';
  5. void main() async {
  6. WidgetsFlutterBinding.ensureInitialized();
  7. await Firebase.initializeApp(
  8. options: DefaultFirebaseOptions.currentPlatform,
  9. );
  10. runApp(const PhysiGo());
  11. }
  12. class PhysiGo extends StatelessWidget {
  13. const PhysiGo({Key? key}) : super(key: key);
  14. @override
  15. Widget build(BuildContext context) {
  16. return MaterialApp(
  17. title: 'PhysiGo',
  18. theme: ThemeData(
  19. primarySwatch: Colors.blue,
  20. ),
  21. home: HomePage(),
  22. );
  23. }
  24. }
  25. class HomePage extends StatelessWidget {
  26. const HomePage({Key? key}) : super(key: key);
  27. @override
  28. Widget build(BuildContext context) {
  29. return Scaffold(
  30. body: Center(
  31. child: TextButton(
  32. onPressed: () {
  33. Navigator.push(
  34. context,
  35. MaterialPageRoute(
  36. // Example on how to use NavigationPage
  37. builder: (context) => WalkingPage(),
  38. ),
  39. );
  40. },
  41. child: const Text('Navigation')),
  42. ),
  43. );
  44. }
  45. }