me_page.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:flutter/material.dart';
  2. import 'package:auto_route/auto_route.dart';
  3. import 'package:plugin_basic/modules/global_web_page.dart';
  4. import 'package:plugin_basic/provider/user_config/user_config_service.dart';
  5. import 'package:router/componentRouter/component_service_manager.dart';
  6. @RoutePage()
  7. class MePage extends StatelessWidget {
  8. const MePage({Key? key}) : super(key: key);
  9. @override
  10. Widget build(BuildContext context) {
  11. return Scaffold(
  12. appBar: AppBar(title: Text("Me")),
  13. body:Center(
  14. child: Column(
  15. children: [
  16. ElevatedButton(
  17. onPressed: () {
  18. UserConfigService.getInstance().setUserInfo("李四");
  19. },
  20. child: const Text('跨页面修改用户信息'),
  21. ),
  22. ElevatedButton(
  23. onPressed: () {
  24. ComponentServiceManager().profileService.startEditProfilePage(context: context);
  25. },
  26. child: const Text('Go to Edit Profile Page'),
  27. ),
  28. ElevatedButton(
  29. onPressed: () {
  30. GlobalWebPage.startInstance(context: context, title: "baidu", url: "https://www.baidu.com");
  31. },
  32. child: const Text('Go to Global Web Page'),
  33. ),
  34. ],
  35. ),
  36. ),
  37. );
  38. }
  39. }