mainPage.dart 979 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:flutter/material.dart';
  2. import 'package:physigo/walking/walking_permission.dart';
  3. class MainPage extends StatefulWidget {
  4. const MainPage({Key? key}) : super(key: key);
  5. @override
  6. State<MainPage> createState() => _MainPage();
  7. }
  8. class _MainPage extends State<MainPage> {
  9. @override
  10. Widget build(BuildContext context) {
  11. final arguments = (ModalRoute.of(context)?.settings.arguments ?? <String, dynamic>{}) as Map;
  12. final String id = arguments['uid'];
  13. print(id);
  14. return Scaffold(
  15. appBar: AppBar(
  16. title: const Text('Welcome Back!'),
  17. leading: GestureDetector(
  18. onTap: () {
  19. print('going to profile page');
  20. Navigator.pushNamed(context, '/profilePage',
  21. arguments: {'id': id},
  22. );
  23. },
  24. child: Icon(
  25. Icons.account_circle_rounded, // add custom icons also
  26. ),
  27. ),
  28. ),
  29. body: WalkingPermission()
  30. );
  31. }
  32. }