community_component_service.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Community 组件的组件路由
  3. */
  4. import 'package:cpt_community/router/page/community_page_router.dart';
  5. import 'package:flutter/cupertino.dart';
  6. import 'package:router/componentRouter/community_service.dart';
  7. import 'package:flutter/material.dart';
  8. import 'package:hooks_riverpod/hooks_riverpod.dart';
  9. import 'package:riverpod_annotation/riverpod_annotation.dart';
  10. import '../../modules/community/community_page.dart';
  11. import '../../modules/my_following/my_follow/my_follow_page.dart';
  12. import '../../modules/my_following/my_follower/my_follower_page.dart';
  13. import '../../modules/my_posts/my_posts_page.dart';
  14. part 'community_component_service.g.dart';
  15. @Riverpod(keepAlive: true)
  16. CommunityService communityService(Ref ref) {
  17. return CommunityComponentService();
  18. }
  19. class CommunityComponentService extends CommunityService {
  20. @override
  21. void startCommunityPage() {
  22. CommunityPage.startInstance();
  23. }
  24. @override
  25. void startMyPostsPage() {
  26. MyPostsPage.startInstance();
  27. }
  28. @override
  29. void startMyFollowPage() {
  30. MyFollowPage.startInstance();
  31. }
  32. @override
  33. void startMyFollowerPage() {
  34. MyFollowerPage.startInstance();
  35. }
  36. }