Commit 08a0f5a8d40e5fc98111857b64f62efb4d149995
1 parent
3c1d5c64
feat:路由方式更新
Showing
11 changed files
with
178 additions
and
112 deletions
ios/Runner.xcodeproj/project.pbxproj
@@ -54,6 +54,7 @@ | @@ -54,6 +54,7 @@ | ||
54 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | 54 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; |
55 | 48BCA0827DCB98991774F5AC /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; }; | 55 | 48BCA0827DCB98991774F5AC /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; }; |
56 | 52450AF02A4C415B007B3E4B /* XSMessageMehtodChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XSMessageMehtodChannel.swift; sourceTree = "<group>"; }; | 56 | 52450AF02A4C415B007B3E4B /* XSMessageMehtodChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XSMessageMehtodChannel.swift; sourceTree = "<group>"; }; |
57 | + 52450AF22A4ED0EC007B3E4B /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; }; | ||
57 | 525E17192A4BD03900104CDF /* VoiceXSMessageChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceXSMessageChannel.swift; sourceTree = "<group>"; }; | 58 | 525E17192A4BD03900104CDF /* VoiceXSMessageChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceXSMessageChannel.swift; sourceTree = "<group>"; }; |
58 | 6DEBBC1D861BE053F3ECE0B9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | 59 | 6DEBBC1D861BE053F3ECE0B9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
59 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; | 60 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; |
@@ -147,6 +148,7 @@ | @@ -147,6 +148,7 @@ | ||
147 | 97C146F01CF9000F007C117D /* Runner */ = { | 148 | 97C146F01CF9000F007C117D /* Runner */ = { |
148 | isa = PBXGroup; | 149 | isa = PBXGroup; |
149 | children = ( | 150 | children = ( |
151 | + 52450AF22A4ED0EC007B3E4B /* Runner.entitlements */, | ||
150 | 97C146FA1CF9000F007C117D /* Main.storyboard */, | 152 | 97C146FA1CF9000F007C117D /* Main.storyboard */, |
151 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, | 153 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, |
152 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, | 154 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, |
@@ -492,6 +494,7 @@ | @@ -492,6 +494,7 @@ | ||
492 | buildSettings = { | 494 | buildSettings = { |
493 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 495 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
494 | CLANG_ENABLE_MODULES = YES; | 496 | CLANG_ENABLE_MODULES = YES; |
497 | + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | ||
495 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | 498 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; |
496 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 499 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
497 | ENABLE_BITCODE = NO; | 500 | ENABLE_BITCODE = NO; |
@@ -671,6 +674,7 @@ | @@ -671,6 +674,7 @@ | ||
671 | buildSettings = { | 674 | buildSettings = { |
672 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 675 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
673 | CLANG_ENABLE_MODULES = YES; | 676 | CLANG_ENABLE_MODULES = YES; |
677 | + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | ||
674 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | 678 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; |
675 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 679 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
676 | ENABLE_BITCODE = NO; | 680 | ENABLE_BITCODE = NO; |
@@ -694,6 +698,7 @@ | @@ -694,6 +698,7 @@ | ||
694 | buildSettings = { | 698 | buildSettings = { |
695 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 699 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
696 | CLANG_ENABLE_MODULES = YES; | 700 | CLANG_ENABLE_MODULES = YES; |
701 | + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | ||
697 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | 702 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; |
698 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 703 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
699 | ENABLE_BITCODE = NO; | 704 | ENABLE_BITCODE = NO; |
ios/Runner/Runner.entitlements
0 → 100644
lib/app/splash_page.dart
@@ -36,9 +36,9 @@ class _TransitionViewState extends State<TransitionView> { | @@ -36,9 +36,9 @@ class _TransitionViewState extends State<TransitionView> { | ||
36 | Timer(const Duration(seconds: 2), () { | 36 | Timer(const Duration(seconds: 2), () { |
37 | if (userEntity != null) { | 37 | if (userEntity != null) { |
38 | // todo 调一下接口判断一下有效性再往下 | 38 | // todo 调一下接口判断一下有效性再往下 |
39 | - Navigator.of(context).pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); | 39 | + pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); |
40 | } else { | 40 | } else { |
41 | - Navigator.of(context).pushNamedAndRemoveUntil(AppRouteName.login, (route) => false); | 41 | + pushNamedAndRemoveUntil(AppRouteName.login, (route) => false); |
42 | } | 42 | } |
43 | }); | 43 | }); |
44 | } | 44 | } |
lib/pages/home/home_page.dart
@@ -29,15 +29,15 @@ class HomePage extends StatelessWidget { | @@ -29,15 +29,15 @@ class HomePage extends StatelessWidget { | ||
29 | class _HomePageView extends StatelessWidget { | 29 | class _HomePageView extends StatelessWidget { |
30 | void _headerActionEvent(HeaderActionType type) { | 30 | void _headerActionEvent(HeaderActionType type) { |
31 | if (type == HeaderActionType.video) { | 31 | if (type == HeaderActionType.video) { |
32 | - Navigator.of(AppRouter.context).pushNamed(AppRouteName.reAfter); | 32 | + pushNamed(AppRouteName.reAfter); |
33 | } else if (type == HeaderActionType.phase) { | 33 | } else if (type == HeaderActionType.phase) { |
34 | - Navigator.of(AppRouter.context).pushNamed(AppRouteName.lesson); | 34 | + pushNamed(AppRouteName.lesson); |
35 | } else if (type == HeaderActionType.listen) { | 35 | } else if (type == HeaderActionType.listen) { |
36 | - Navigator.of(AppRouter.context).pushNamed(AppRouteName.listen); | 36 | + pushNamed(AppRouteName.listen); |
37 | } else if (type == HeaderActionType.shop) { | 37 | } else if (type == HeaderActionType.shop) { |
38 | - Navigator.of(AppRouter.context).pushNamed(AppRouteName.shop); | 38 | + pushNamed(AppRouteName.shop); |
39 | } else if (type == HeaderActionType.user) { | 39 | } else if (type == HeaderActionType.user) { |
40 | - Navigator.of(AppRouter.context).pushNamed(AppRouteName.user); | 40 | + pushNamed(AppRouteName.user); |
41 | } else { | 41 | } else { |
42 | 42 | ||
43 | } | 43 | } |
@@ -66,7 +66,7 @@ class _HomePageView extends StatelessWidget { | @@ -66,7 +66,7 @@ class _HomePageView extends StatelessWidget { | ||
66 | if (videoUrl.isEmpty) { | 66 | if (videoUrl.isEmpty) { |
67 | return; | 67 | return; |
68 | } | 68 | } |
69 | - Navigator.of(context).pushNamed(AppRouteName.lookVideo,arguments: {'videoUrl':videoUrl,'title':title}); | 69 | + pushNamed(AppRouteName.lookVideo,arguments: {'videoUrl':videoUrl,'title':title}); |
70 | } | 70 | } |
71 | }, | 71 | }, |
72 | child: _homeView(), | 72 | child: _homeView(), |
@@ -74,100 +74,100 @@ class _HomePageView extends StatelessWidget { | @@ -74,100 +74,100 @@ class _HomePageView extends StatelessWidget { | ||
74 | } | 74 | } |
75 | 75 | ||
76 | Widget _homeView() => BlocBuilder<HomeBloc, HomeState>(builder: (context, state) { | 76 | Widget _homeView() => BlocBuilder<HomeBloc, HomeState>(builder: (context, state) { |
77 | - final bloc = BlocProvider.of<HomeBloc>(context); | ||
78 | - return Scaffold( | ||
79 | - body: Container( | ||
80 | - color: Colors.white, | ||
81 | - child: Center( | ||
82 | - child: Column( | ||
83 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
84 | - children: [ | ||
85 | - HomeTabHeaderWidget( | ||
86 | - actionTap: (HeaderActionType type) { | ||
87 | - _headerActionEvent(type); | ||
88 | - }, | ||
89 | - ), | ||
90 | - Expanded( | ||
91 | - child: ListView.builder( | ||
92 | - itemCount: bloc.modelData?.totalCourseLesson, | ||
93 | - scrollDirection: Axis.horizontal, | ||
94 | - itemBuilder: (BuildContext context, int index) { | ||
95 | - CourseCourseLessons? data = bloc.modelData?.courseLessons?[index]; | ||
96 | - if (data?.courseType == 5) { | ||
97 | - //彩蛋 | ||
98 | - return GestureDetector( | ||
99 | - onTap: () { | ||
100 | - if (data!.lock!) { | ||
101 | - showToast('当前课程暂未解锁'); | ||
102 | - return; | ||
103 | - } | ||
104 | - bloc.add(RequestVideoLessonEvent(data.id!,data.courseType!)); | ||
105 | - }, | ||
106 | - child: HomeBoundsItem( | ||
107 | - imageUrl: data?.coverUrl, | ||
108 | - ), | ||
109 | - ); | ||
110 | - } else { | ||
111 | - return GestureDetector( | ||
112 | - onTap: () { | ||
113 | - debugPrint('>>>>>>>类型${data?.courseType}'); | ||
114 | - if (data!.lock!) { | ||
115 | - showToast('当前课程暂未解锁'); | ||
116 | - return; | ||
117 | - } | ||
118 | - if (data.courseType == 4) {//绘本 | ||
119 | - return; | ||
120 | - } | 77 | + final bloc = BlocProvider.of<HomeBloc>(context); |
78 | + return Scaffold( | ||
79 | + body: Container( | ||
80 | + color: Colors.white, | ||
81 | + child: Center( | ||
82 | + child: Column( | ||
83 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
84 | + children: [ | ||
85 | + HomeTabHeaderWidget( | ||
86 | + actionTap: (HeaderActionType type) { | ||
87 | + _headerActionEvent(type); | ||
88 | + }, | ||
89 | + ), | ||
90 | + Expanded( | ||
91 | + child: ListView.builder( | ||
92 | + itemCount: bloc.modelData?.totalCourseLesson, | ||
93 | + scrollDirection: Axis.horizontal, | ||
94 | + itemBuilder: (BuildContext context, int index) { | ||
95 | + CourseCourseLessons? data = bloc.modelData?.courseLessons?[index]; | ||
96 | + if (data?.courseType == 5) { | ||
97 | + //彩蛋 | ||
98 | + return GestureDetector( | ||
99 | + onTap: () { | ||
100 | + if (data!.lock!) { | ||
101 | + showToast('当前课程暂未解锁'); | ||
102 | + return; | ||
103 | + } | ||
104 | + bloc.add(RequestVideoLessonEvent(data.id!,data.courseType!)); | ||
105 | + }, | ||
106 | + child: HomeBoundsItem( | ||
107 | + imageUrl: data?.coverUrl, | ||
108 | + ), | ||
109 | + ); | ||
110 | + } else { | ||
111 | + return GestureDetector( | ||
112 | + onTap: () { | ||
113 | + debugPrint('>>>>>>>类型${data?.courseType}'); | ||
114 | + if (data!.lock!) { | ||
115 | + showToast('当前课程暂未解锁'); | ||
116 | + return; | ||
117 | + } | ||
118 | + if (data.courseType == 4) {//绘本 | ||
119 | + return; | ||
120 | + } | ||
121 | 121 | ||
122 | - if (data.courseType == 3) {//练习 | ||
123 | - Navigator.of(context).pushNamed(AppRouteName.topicPic,arguments: {'courseLessonId':data.id!}); | ||
124 | - return; | ||
125 | - } | 122 | + if (data.courseType == 3) {//练习 |
123 | + Navigator.of(context).pushNamed(AppRouteName.topicPic,arguments: {'courseLessonId':data.id!}); | ||
124 | + return; | ||
125 | + } | ||
126 | 126 | ||
127 | - //儿歌/看视频 | ||
128 | - bloc.add(RequestVideoLessonEvent(data.id!,data.courseType!)); | ||
129 | - }, | ||
130 | - child: HomeVideoItem( | ||
131 | - lessons: data, | ||
132 | - ), | ||
133 | - ); | ||
134 | - } | ||
135 | - })), | ||
136 | - SafeArea( | ||
137 | - child: Padding( | ||
138 | - padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
139 | - child: Row( | ||
140 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
141 | - children: [ | ||
142 | - SizedBox( | ||
143 | - height: 47.h, | ||
144 | - width: 80.w, | ||
145 | - ), | ||
146 | - Container( | ||
147 | - decoration: BoxDecoration( | ||
148 | - color: Colors.blue, | ||
149 | - borderRadius: BorderRadius.circular(14.5.r), | ||
150 | - ), | ||
151 | - padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 24.w), | ||
152 | - child: Text( | ||
153 | - '${(bloc.modelData?.nowCourseLesson)}/${bloc.modelData?.totalCourseLesson}', | ||
154 | - style: TextStyle(color: Colors.white, fontSize: 12.sp), | 127 | + //儿歌/看视频 |
128 | + bloc.add(RequestVideoLessonEvent(data.id!,data.courseType!)); | ||
129 | + }, | ||
130 | + child: HomeVideoItem( | ||
131 | + lessons: data, | ||
155 | ), | 132 | ), |
156 | - ), | ||
157 | - Image.asset( | ||
158 | - 'blue-positive'.assetPng, | ||
159 | - height: 47.h, | ||
160 | - width: 80.w, | ||
161 | - // color: Colors.red, | ||
162 | - ), | ||
163 | - ], | 133 | + ); |
134 | + } | ||
135 | + })), | ||
136 | + SafeArea( | ||
137 | + child: Padding( | ||
138 | + padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
139 | + child: Row( | ||
140 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
141 | + children: [ | ||
142 | + SizedBox( | ||
143 | + height: 47.h, | ||
144 | + width: 80.w, | ||
164 | ), | 145 | ), |
165 | - ), | ||
166 | - ) | ||
167 | - ], | ||
168 | - ), | ||
169 | - ), | 146 | + Container( |
147 | + decoration: BoxDecoration( | ||
148 | + color: Colors.blue, | ||
149 | + borderRadius: BorderRadius.circular(14.5.r), | ||
150 | + ), | ||
151 | + padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 24.w), | ||
152 | + child: Text( | ||
153 | + '${(bloc.modelData?.nowCourseLesson)}/${bloc.modelData?.totalCourseLesson}', | ||
154 | + style: TextStyle(color: Colors.white, fontSize: 12.sp), | ||
155 | + ), | ||
156 | + ), | ||
157 | + Image.asset( | ||
158 | + 'blue-positive'.assetPng, | ||
159 | + height: 47.h, | ||
160 | + width: 80.w, | ||
161 | + // color: Colors.red, | ||
162 | + ), | ||
163 | + ], | ||
164 | + ), | ||
165 | + ), | ||
166 | + ) | ||
167 | + ], | ||
170 | ), | 168 | ), |
171 | - ); | ||
172 | - }); | 169 | + ), |
170 | + ), | ||
171 | + ); | ||
172 | + }); | ||
173 | } | 173 | } |
lib/pages/lessons/lesson_page.dart
@@ -171,7 +171,7 @@ class _LessonPageView extends StatelessWidget { | @@ -171,7 +171,7 @@ class _LessonPageView extends StatelessWidget { | ||
171 | model: model, | 171 | model: model, |
172 | isSelected: bloc.currentPageIndex == index, | 172 | isSelected: bloc.currentPageIndex == index, |
173 | onClickEvent: () { | 173 | onClickEvent: () { |
174 | - Navigator.of(context).pushNamedAndRemoveUntil(AppRouteName.home, (route) => false,arguments: {'moduleId':model?.id}); | 174 | + pushNamedAndRemoveUntil(AppRouteName.home, (route) => false,arguments: {'moduleId':model?.id}); |
175 | }, | 175 | }, |
176 | ), | 176 | ), |
177 | ), | 177 | ), |
lib/pages/login/loginpage/login_page.dart
@@ -30,7 +30,7 @@ class _LoginPageView extends StatelessWidget { | @@ -30,7 +30,7 @@ class _LoginPageView extends StatelessWidget { | ||
30 | if (state is LoginResultChangeState) { | 30 | if (state is LoginResultChangeState) { |
31 | // 调试用 | 31 | // 调试用 |
32 | // Navigator.of(context).pushNamed(AppRouteName.home); | 32 | // Navigator.of(context).pushNamed(AppRouteName.home); |
33 | - Navigator.of(context).pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); | 33 | + pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); |
34 | } | 34 | } |
35 | }, | 35 | }, |
36 | child: _buildLoginViewWidget(), | 36 | child: _buildLoginViewWidget(), |
lib/pages/login/setpwd/set_pwd_page.dart
@@ -57,7 +57,7 @@ class _SetPassWordPageView extends StatelessWidget { | @@ -57,7 +57,7 @@ class _SetPassWordPageView extends StatelessWidget { | ||
57 | } else { | 57 | } else { |
58 | showToast('密码修改成功'); | 58 | showToast('密码修改成功'); |
59 | } | 59 | } |
60 | - Navigator.of(context).pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); | 60 | + pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); |
61 | } else if (state is PasswordSetFailedState) { | 61 | } else if (state is PasswordSetFailedState) { |
62 | state.message.toast(); | 62 | state.message.toast(); |
63 | } | 63 | } |
lib/pages/repeatafter/repeat_after_page.dart
@@ -3,7 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; | @@ -3,7 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; | ||
3 | import 'package:wow_english/common/widgets/we_app_bar.dart'; | 3 | import 'package:wow_english/common/widgets/we_app_bar.dart'; |
4 | import 'package:wow_english/models/follow_read_entity.dart'; | 4 | import 'package:wow_english/models/follow_read_entity.dart'; |
5 | import 'package:wow_english/pages/repeatafter/widgets/repeat_after_item.dart'; | 5 | import 'package:wow_english/pages/repeatafter/widgets/repeat_after_item.dart'; |
6 | -import 'package:wow_english/utils/toast_util.dart'; | 6 | +import 'package:wow_english/route/route.dart'; |
7 | 7 | ||
8 | import 'bloc/repeat_after_bloc.dart'; | 8 | import 'bloc/repeat_after_bloc.dart'; |
9 | 9 | ||
@@ -24,9 +24,7 @@ class _RepeatAfterPageView extends StatelessWidget { | @@ -24,9 +24,7 @@ class _RepeatAfterPageView extends StatelessWidget { | ||
24 | Widget build(BuildContext context) { | 24 | Widget build(BuildContext context) { |
25 | return BlocListener<RepeatAfterBloc, RepeatAfterState>( | 25 | return BlocListener<RepeatAfterBloc, RepeatAfterState>( |
26 | listener: (context, state) { | 26 | listener: (context, state) { |
27 | - if (state is RequestDataState) { | ||
28 | - showToast('网络请求结束'); | ||
29 | - } | 27 | + |
30 | }, | 28 | }, |
31 | child: _repeatAfterView(), | 29 | child: _repeatAfterView(), |
32 | ); | 30 | ); |
@@ -49,7 +47,9 @@ class _RepeatAfterPageView extends StatelessWidget { | @@ -49,7 +47,9 @@ class _RepeatAfterPageView extends StatelessWidget { | ||
49 | itemBuilder: (BuildContext context, int index) { | 47 | itemBuilder: (BuildContext context, int index) { |
50 | FollowReadEntity? entity = bloc.listData[index]; | 48 | FollowReadEntity? entity = bloc.listData[index]; |
51 | return RepeatAfterItem( | 49 | return RepeatAfterItem( |
52 | - tapEvent: () {}, | 50 | + tapEvent: () { |
51 | + pushNamed(AppRouteName.readAfterContent); | ||
52 | + }, | ||
53 | entity: entity, | 53 | entity: entity, |
54 | ); | 54 | ); |
55 | }), | 55 | }), |
lib/pages/repeatafter/widgets/repeat_after_item.dart
@@ -5,11 +5,11 @@ import 'package:wow_english/common/widgets/ow_image_widget.dart'; | @@ -5,11 +5,11 @@ import 'package:wow_english/common/widgets/ow_image_widget.dart'; | ||
5 | import 'package:wow_english/models/follow_read_entity.dart'; | 5 | import 'package:wow_english/models/follow_read_entity.dart'; |
6 | 6 | ||
7 | class RepeatAfterItem extends StatelessWidget { | 7 | class RepeatAfterItem extends StatelessWidget { |
8 | - const RepeatAfterItem({super.key, required this.tapEvent, this.entity}); | 8 | + const RepeatAfterItem({super.key, this.tapEvent, this.entity}); |
9 | 9 | ||
10 | final FollowReadEntity? entity; | 10 | final FollowReadEntity? entity; |
11 | 11 | ||
12 | - final Function() tapEvent; | 12 | + final Function()? tapEvent; |
13 | 13 | ||
14 | @override | 14 | @override |
15 | Widget build(BuildContext context) { | 15 | Widget build(BuildContext context) { |
@@ -20,8 +20,8 @@ class RepeatAfterItem extends StatelessWidget { | @@ -20,8 +20,8 @@ class RepeatAfterItem extends StatelessWidget { | ||
20 | child: GestureDetector( | 20 | child: GestureDetector( |
21 | onTap: (){ | 21 | onTap: (){ |
22 | if (entity != null) { | 22 | if (entity != null) { |
23 | - if (entity?.lock??false) { | ||
24 | - tapEvent(); | 23 | + if (!entity!.lock!) { |
24 | + tapEvent?.call(); | ||
25 | } | 25 | } |
26 | } | 26 | } |
27 | }, | 27 | }, |
lib/pages/repeataftercontent/repeat_after_content_page.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
3 | +import 'package:wow_english/common/extension/string_extension.dart'; | ||
4 | +import 'package:wow_english/route/route.dart'; | ||
5 | + | ||
6 | +class RepeatAfterContentPage extends StatelessWidget { | ||
7 | + const RepeatAfterContentPage({super.key}); | ||
8 | + | ||
9 | + @override | ||
10 | + Widget build(BuildContext context) { | ||
11 | + return Container( | ||
12 | + color: Colors.white, | ||
13 | + child: SafeArea( | ||
14 | + child: Stack( | ||
15 | + children: [ | ||
16 | + Positioned( | ||
17 | + top: 13.h, | ||
18 | + child: GestureDetector( | ||
19 | + onTap: () => popPage(), | ||
20 | + child: Image.asset( | ||
21 | + 'back_around'.assetPng, | ||
22 | + height: 40.h, | ||
23 | + width: 40.w, | ||
24 | + ), | ||
25 | + ), | ||
26 | + ) | ||
27 | + ], | ||
28 | + ), | ||
29 | + ), | ||
30 | + ); | ||
31 | + } | ||
32 | +} | ||
0 | \ No newline at end of file | 33 | \ No newline at end of file |
lib/route/route.dart
@@ -10,6 +10,7 @@ import 'package:wow_english/pages/login/loginpage/login_page.dart'; | @@ -10,6 +10,7 @@ import 'package:wow_english/pages/login/loginpage/login_page.dart'; | ||
10 | import 'package:wow_english/pages/login/setpwd/set_pwd_page.dart'; | 10 | import 'package:wow_english/pages/login/setpwd/set_pwd_page.dart'; |
11 | import 'package:wow_english/pages/practice/topic_picture_page.dart'; | 11 | import 'package:wow_english/pages/practice/topic_picture_page.dart'; |
12 | import 'package:wow_english/pages/repeatafter/repeat_after_page.dart'; | 12 | import 'package:wow_english/pages/repeatafter/repeat_after_page.dart'; |
13 | +import 'package:wow_english/pages/repeataftercontent/repeat_after_content_page.dart'; | ||
13 | import 'package:wow_english/pages/shop/exchane/exchange_lesson_page.dart'; | 14 | import 'package:wow_english/pages/shop/exchane/exchange_lesson_page.dart'; |
14 | import 'package:wow_english/pages/shop/exchangelist/exchange_lesson_list_page.dart'; | 15 | import 'package:wow_english/pages/shop/exchangelist/exchange_lesson_list_page.dart'; |
15 | import 'package:wow_english/pages/shop/home/shop_home_page.dart'; | 16 | import 'package:wow_english/pages/shop/home/shop_home_page.dart'; |
@@ -40,10 +41,14 @@ class AppRouteName { | @@ -40,10 +41,14 @@ class AppRouteName { | ||
40 | 41 | ||
41 | /// 用户详细信息页 | 42 | /// 用户详细信息页 |
42 | static const String userInformation = 'userInformation'; | 43 | static const String userInformation = 'userInformation'; |
44 | + ///看视频 | ||
43 | static const String lookVideo = 'lookVideo'; | 45 | static const String lookVideo = 'lookVideo'; |
46 | + ///绘本 | ||
44 | static const String reading = 'reading'; | 47 | static const String reading = 'reading'; |
48 | + ///视频跟读详情 | ||
49 | + static const String readAfterContent = 'readAfterContent'; | ||
50 | + | ||
45 | 51 | ||
46 | - ///绘本 | ||
47 | static const String tab = '/'; | 52 | static const String tab = '/'; |
48 | } | 53 | } |
49 | 54 | ||
@@ -123,6 +128,9 @@ class AppRouter { | @@ -123,6 +128,9 @@ class AppRouter { | ||
123 | urlStr: urlStr, | 128 | urlStr: urlStr, |
124 | webViewTitle: webViewTitle, | 129 | webViewTitle: webViewTitle, |
125 | )); | 130 | )); |
131 | + case AppRouteName.readAfterContent: | ||
132 | + return CupertinoPageRoute( | ||
133 | + builder: (_) => const RepeatAfterContentPage()); | ||
126 | case AppRouteName.tab: | 134 | case AppRouteName.tab: |
127 | return PageRouteBuilder( | 135 | return PageRouteBuilder( |
128 | opaque: false, | 136 | opaque: false, |
@@ -138,3 +146,16 @@ class AppRouter { | @@ -138,3 +146,16 @@ class AppRouter { | ||
138 | } | 146 | } |
139 | } | 147 | } |
140 | } | 148 | } |
149 | + | ||
150 | +void pushNamed(String routeName, {Object? arguments}) { | ||
151 | + Navigator.of(AppRouter.context).pushNamed(routeName,arguments: arguments); | ||
152 | +} | ||
153 | + | ||
154 | +void pushNamedAndRemoveUntil(String routeName,RoutePredicate predicate, {Object? arguments}) { | ||
155 | + Navigator.of(AppRouter.context).pushNamedAndRemoveUntil(routeName, predicate,arguments: arguments); | ||
156 | +} | ||
157 | + | ||
158 | +void popPage() { | ||
159 | + Navigator.pop(AppRouter.context); | ||
160 | +} | ||
161 | + |