Commit 624214d09d3cd0238cb419c628752ed92795d7d0
1 parent
0fd4b04b
feat:看题选字/选图UI和部分逻辑
Showing
15 changed files
with
477 additions
and
12 deletions
assets/images/background_grass.png
0 → 100644
209 KB
assets/images/choose.png
0 → 100644
7.73 KB
lib/home/home_page.dart
| ... | ... | @@ -33,7 +33,8 @@ class _HomePageView extends StatelessWidget { |
| 33 | 33 | } else if (type == HeaderActionType.shop) { |
| 34 | 34 | Navigator.of(AppRouter.context).pushNamed(AppRouteName.shop); |
| 35 | 35 | } else { |
| 36 | - | |
| 36 | + // Navigator.of(AppRouter.context).pushNamed(AppRouteName.topicPic); | |
| 37 | + Navigator.of(AppRouter.context).pushNamed(AppRouteName.topicWord); | |
| 37 | 38 | } |
| 38 | 39 | } |
| 39 | 40 | ... | ... |
lib/listen/bloc/listen_bloc.dart
lib/listen/widgets/listen_item_widget.dart
lib/practice/chosetopic/topicpicture/bloc/topic_picture_bloc.dart
| 1 | - | |
| 2 | 1 | import 'package:flutter/cupertino.dart'; |
| 3 | 2 | import 'package:flutter_bloc/flutter_bloc.dart'; |
| 4 | 3 | |
| ... | ... | @@ -6,9 +5,37 @@ part 'topic_picture_event.dart'; |
| 6 | 5 | part 'topic_picture_state.dart'; |
| 7 | 6 | |
| 8 | 7 | class TopicPictureBloc extends Bloc<TopicPictureEvent, TopicPictureState> { |
| 9 | - TopicPictureBloc() : super(TopicPictureInitial()) { | |
| 10 | - on<TopicPictureEvent>((event, emit) { | |
| 11 | - // TODO: implement event handler | |
| 12 | - }); | |
| 8 | + | |
| 9 | + final PageController pageController; | |
| 10 | + | |
| 11 | + final int modelCount; | |
| 12 | + | |
| 13 | + int _currentPage = 0; | |
| 14 | + | |
| 15 | + int _selectItem = 0; | |
| 16 | + | |
| 17 | + int get currentPage => _currentPage + 1; | |
| 18 | + | |
| 19 | + int get selectItem => _selectItem; | |
| 20 | + | |
| 21 | + TopicPictureBloc(this.pageController, this.modelCount) : super(TopicPictureInitial()) { | |
| 22 | + on<CurrentPageIndexChangeEvent>(_pageControllerChange); | |
| 23 | + on<SelectItemEvent>(_selectItemLoad); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @override | |
| 27 | + Future<void> close() { | |
| 28 | + pageController.dispose(); | |
| 29 | + return super.close(); | |
| 30 | + } | |
| 31 | + | |
| 32 | + void _pageControllerChange(CurrentPageIndexChangeEvent event,Emitter<TopicPictureState> emitter) async { | |
| 33 | + _currentPage = event.pageIndex; | |
| 34 | + emitter(CurrentPageIndexState()); | |
| 35 | + } | |
| 36 | + | |
| 37 | + void _selectItemLoad(SelectItemEvent event,Emitter<TopicPictureState> emitter) async { | |
| 38 | + _selectItem = event.selectIndex; | |
| 39 | + emitter(SelectItemChangeState()); | |
| 13 | 40 | } |
| 14 | 41 | } | ... | ... |
lib/practice/chosetopic/topicpicture/bloc/topic_picture_event.dart
| ... | ... | @@ -2,3 +2,13 @@ part of 'topic_picture_bloc.dart'; |
| 2 | 2 | |
| 3 | 3 | @immutable |
| 4 | 4 | abstract class TopicPictureEvent {} |
| 5 | + | |
| 6 | +class CurrentPageIndexChangeEvent extends TopicPictureEvent { | |
| 7 | + final int pageIndex; | |
| 8 | + CurrentPageIndexChangeEvent(this.pageIndex); | |
| 9 | +} | |
| 10 | + | |
| 11 | +class SelectItemEvent extends TopicPictureEvent { | |
| 12 | + final int selectIndex; | |
| 13 | + SelectItemEvent(this.selectIndex); | |
| 14 | +} | |
| 5 | 15 | \ No newline at end of file | ... | ... |
lib/practice/chosetopic/topicpicture/bloc/topic_picture_state.dart
| ... | ... | @@ -4,3 +4,7 @@ part of 'topic_picture_bloc.dart'; |
| 4 | 4 | abstract class TopicPictureState {} |
| 5 | 5 | |
| 6 | 6 | class TopicPictureInitial extends TopicPictureState {} |
| 7 | + | |
| 8 | +class CurrentPageIndexState extends TopicPictureState {} | |
| 9 | + | |
| 10 | +class SelectItemChangeState extends TopicPictureState {} | ... | ... |
lib/practice/chosetopic/topicpicture/topic_picture_page.dart
| 1 | 1 | import 'package:flutter/material.dart'; |
| 2 | +import 'package:flutter_bloc/flutter_bloc.dart'; | |
| 3 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| 4 | +import 'package:wow_english/common/extension/string_extension.dart'; | |
| 5 | +import 'package:wow_english/practice/chosetopic/topicpicture/bloc/topic_picture_bloc.dart'; | |
| 6 | + | |
| 7 | +import '../../widgets/practice_header_widget.dart'; | |
| 2 | 8 | |
| 3 | 9 | class TopicPicturePage extends StatelessWidget { |
| 4 | 10 | const TopicPicturePage({super.key}); |
| 5 | 11 | |
| 6 | 12 | @override |
| 7 | 13 | Widget build(BuildContext context) { |
| 8 | - // TODO: implement build | |
| 9 | - throw UnimplementedError(); | |
| 14 | + return BlocProvider( | |
| 15 | + create: (context) => TopicPictureBloc(PageController(),3), | |
| 16 | + child: _TopicPicturePage(), | |
| 17 | + ); | |
| 18 | + } | |
| 19 | +} | |
| 20 | + | |
| 21 | +class _TopicPicturePage extends StatelessWidget { | |
| 22 | + @override | |
| 23 | + Widget build(BuildContext context) { | |
| 24 | + return BlocListener<TopicPictureBloc,TopicPictureState>( | |
| 25 | + listener: (context, state){}, | |
| 26 | + child: _topicPictureView(), | |
| 27 | + ); | |
| 10 | 28 | } |
| 29 | + | |
| 30 | + Widget _topicPictureView() => BlocBuilder<TopicPictureBloc,TopicPictureState>( | |
| 31 | + buildWhen: (_,s) => s is CurrentPageIndexState, | |
| 32 | + builder: (context,state){ | |
| 33 | + final bloc = BlocProvider.of<TopicPictureBloc>(context); | |
| 34 | + return Container( | |
| 35 | + color: Colors.white, | |
| 36 | + child: Stack( | |
| 37 | + children: [ | |
| 38 | + Column( | |
| 39 | + children: [ | |
| 40 | + PracticeHeaderWidget( | |
| 41 | + title: '${bloc.currentPage}/8', | |
| 42 | + onTap: (){Navigator.pop(context);}, | |
| 43 | + ), | |
| 44 | + Expanded( | |
| 45 | + child: PageView.builder( | |
| 46 | + itemCount: 8, | |
| 47 | + scrollDirection: Axis.horizontal, | |
| 48 | + controller: bloc.pageController, | |
| 49 | + onPageChanged: (int index) { | |
| 50 | + bloc.add(CurrentPageIndexChangeEvent(index)); | |
| 51 | + }, | |
| 52 | + itemBuilder: (BuildContext context,int index){ | |
| 53 | + return _pageViewItemWidget(); | |
| 54 | + }), | |
| 55 | + ) | |
| 56 | + ], | |
| 57 | + ), | |
| 58 | + Positioned( | |
| 59 | + left: 0, | |
| 60 | + right: 0, | |
| 61 | + bottom: 0, | |
| 62 | + child: Image.asset('bottom_grass'.assetPng) | |
| 63 | + ) | |
| 64 | + ], | |
| 65 | + ), | |
| 66 | + ); | |
| 67 | + }); | |
| 68 | + | |
| 69 | + Widget _pageViewItemWidget() => BlocBuilder<TopicPictureBloc,TopicPictureState>( | |
| 70 | + builder: (context, state){ | |
| 71 | + final bloc = BlocProvider.of<TopicPictureBloc>(context); | |
| 72 | + return SafeArea( | |
| 73 | + child: Column( | |
| 74 | + children: [ | |
| 75 | + Text( | |
| 76 | + 'What to do when the sentence question is very long and needs a line break', | |
| 77 | + softWrap: true, | |
| 78 | + style: TextStyle( | |
| 79 | + fontSize: 21.sp, | |
| 80 | + color: const Color(0xFF333333) | |
| 81 | + ) | |
| 82 | + ), | |
| 83 | + 26.verticalSpace, | |
| 84 | + Row( | |
| 85 | + mainAxisAlignment: MainAxisAlignment.center, | |
| 86 | + children: [ | |
| 87 | + Offstage( | |
| 88 | + offstage: (bloc.modelCount < 1), | |
| 89 | + child: _decodeImageWidget(1), | |
| 90 | + ), | |
| 91 | + Offstage( | |
| 92 | + offstage: (bloc.modelCount < 2), | |
| 93 | + child: _decodeImageWidget(2), | |
| 94 | + ), | |
| 95 | + Offstage( | |
| 96 | + offstage: (bloc.modelCount < 3), | |
| 97 | + child: _decodeImageWidget(3), | |
| 98 | + ), | |
| 99 | + Offstage( | |
| 100 | + offstage: (bloc.modelCount < 4), | |
| 101 | + child: _decodeImageWidget(4), | |
| 102 | + ) | |
| 103 | + ], | |
| 104 | + ) | |
| 105 | + ], | |
| 106 | + ), | |
| 107 | + ); | |
| 108 | + }); | |
| 109 | + | |
| 110 | + Widget _decodeImageWidget(int index) => BlocBuilder<TopicPictureBloc,TopicPictureState>( | |
| 111 | + buildWhen: (_, s) => s is SelectItemChangeState, | |
| 112 | + builder: (context,state){ | |
| 113 | + final bloc = BlocProvider.of<TopicPictureBloc>(context); | |
| 114 | + return GestureDetector( | |
| 115 | + onTap: () => bloc.add(SelectItemEvent(index)), | |
| 116 | + child: Container( | |
| 117 | + padding: const EdgeInsets.all(4.5), | |
| 118 | + decoration: BoxDecoration( | |
| 119 | + color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white, | |
| 120 | + borderRadius: BorderRadius.circular(15), | |
| 121 | + ), | |
| 122 | + height: 143.h, | |
| 123 | + width: 143.w, | |
| 124 | + child: Container( | |
| 125 | + decoration: BoxDecoration( | |
| 126 | + color: Colors.white, | |
| 127 | + borderRadius: BorderRadius.circular(15), | |
| 128 | + border: Border.all( | |
| 129 | + width: 1.0, | |
| 130 | + color: const Color(0xFF140C10) | |
| 131 | + ), | |
| 132 | + image: const DecorationImage( | |
| 133 | + fit: BoxFit.fitWidth, | |
| 134 | + image: NetworkImage('https://img1.baidu.com/it/u=3392591833,1640391553&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=714') | |
| 135 | + ) | |
| 136 | + ), | |
| 137 | + ), | |
| 138 | + ), | |
| 139 | + ); | |
| 140 | + }); | |
| 11 | 141 | } |
| 12 | 142 | \ No newline at end of file | ... | ... |
lib/practice/chosetopic/topicword/bloc/topic_word_bloc.dart
0 → 100644
| 1 | + | |
| 2 | +import 'package:flutter/cupertino.dart'; | |
| 3 | +import 'package:flutter_bloc/flutter_bloc.dart'; | |
| 4 | + | |
| 5 | +part 'topic_word_event.dart'; | |
| 6 | +part 'topic_word_state.dart'; | |
| 7 | + | |
| 8 | +class TopicWordBloc extends Bloc<TopicWordEvent, TopicWordState> { | |
| 9 | + final PageController pageController; | |
| 10 | + | |
| 11 | + final int modelCount; | |
| 12 | + | |
| 13 | + int _currentPage = 0; | |
| 14 | + | |
| 15 | + int _selectItem = 0; | |
| 16 | + | |
| 17 | + int get currentPage => _currentPage + 1; | |
| 18 | + | |
| 19 | + int get selectItem => _selectItem; | |
| 20 | + | |
| 21 | + TopicWordBloc(this.pageController, this.modelCount) : super(TopicWordInitial()) { | |
| 22 | + on<CurrentPageIndexChangeEvent>(_pageControllerChange); | |
| 23 | + on<SelectItemEvent>(_selectItemLoad); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @override | |
| 27 | + Future<void> close() { | |
| 28 | + pageController.dispose(); | |
| 29 | + return super.close(); | |
| 30 | + } | |
| 31 | + | |
| 32 | + void _pageControllerChange(CurrentPageIndexChangeEvent event,Emitter<TopicWordState> emitter) async { | |
| 33 | + _currentPage = event.pageIndex; | |
| 34 | + emitter(CurrentPageIndexState()); | |
| 35 | + } | |
| 36 | + | |
| 37 | + void _selectItemLoad(SelectItemEvent event,Emitter<TopicWordState> emitter) async { | |
| 38 | + _selectItem = event.selectIndex; | |
| 39 | + emitter(SelectItemChangeState()); | |
| 40 | + } | |
| 41 | +} | ... | ... |
lib/practice/chosetopic/topicword/bloc/topic_word_event.dart
0 → 100644
| 1 | +part of 'topic_word_bloc.dart'; | |
| 2 | + | |
| 3 | +@immutable | |
| 4 | +abstract class TopicWordEvent {} | |
| 5 | + | |
| 6 | +class CurrentPageIndexChangeEvent extends TopicWordEvent { | |
| 7 | + final int pageIndex; | |
| 8 | + CurrentPageIndexChangeEvent(this.pageIndex); | |
| 9 | +} | |
| 10 | + | |
| 11 | +class SelectItemEvent extends TopicWordEvent { | |
| 12 | + final int selectIndex; | |
| 13 | + SelectItemEvent(this.selectIndex); | |
| 14 | +} | |
| 0 | 15 | \ No newline at end of file | ... | ... |
lib/practice/chosetopic/topicword/bloc/topic_word_state.dart
0 → 100644
| 1 | +part of 'topic_word_bloc.dart'; | |
| 2 | + | |
| 3 | +@immutable | |
| 4 | +abstract class TopicWordState {} | |
| 5 | + | |
| 6 | +class TopicWordInitial extends TopicWordState {} | |
| 7 | + | |
| 8 | +class CurrentPageIndexState extends TopicWordState {} | |
| 9 | + | |
| 10 | +class SelectItemChangeState extends TopicWordState {} | |
| 0 | 11 | \ No newline at end of file | ... | ... |
lib/practice/chosetopic/topicword/topic_word_page.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | |
| 2 | +import 'package:flutter_bloc/flutter_bloc.dart'; | |
| 3 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| 4 | +import 'package:wow_english/common/extension/string_extension.dart'; | |
| 5 | +import 'package:wow_english/practice/chosetopic/topicword/bloc/topic_word_bloc.dart'; | |
| 6 | +import 'package:wow_english/practice/widgets/practice_header_widget.dart'; | |
| 7 | + | |
| 8 | +class TopicWordPage extends StatelessWidget { | |
| 9 | + const TopicWordPage({super.key}); | |
| 10 | + | |
| 11 | + @override | |
| 12 | + Widget build(BuildContext context) { | |
| 13 | + return BlocProvider( | |
| 14 | + create: (context) => TopicWordBloc(PageController(), 3), | |
| 15 | + child: _TopicWordPage(), | |
| 16 | + ); | |
| 17 | + } | |
| 18 | +} | |
| 19 | + | |
| 20 | +class _TopicWordPage extends StatelessWidget { | |
| 21 | + @override | |
| 22 | + Widget build(BuildContext context) { | |
| 23 | + return BlocListener<TopicWordBloc,TopicWordState>( | |
| 24 | + listener: (context, state) { | |
| 25 | + | |
| 26 | + }, | |
| 27 | + child: _topicWordView(), | |
| 28 | + ); | |
| 29 | + } | |
| 30 | + | |
| 31 | + Widget _topicWordView() => BlocBuilder<TopicWordBloc,TopicWordState>( | |
| 32 | + builder: (context,state){ | |
| 33 | + final bloc = BlocProvider.of<TopicWordBloc>(context); | |
| 34 | + return Container( | |
| 35 | + color: Colors.white, | |
| 36 | + child: Stack( | |
| 37 | + children: [ | |
| 38 | + Positioned( | |
| 39 | + left: 0, | |
| 40 | + right: 0, | |
| 41 | + bottom: 0, | |
| 42 | + child: Image.asset('background_grass'.assetPng,fit: BoxFit.fitWidth,) | |
| 43 | + ), | |
| 44 | + Column( | |
| 45 | + children: [ | |
| 46 | + PracticeHeaderWidget( | |
| 47 | + title: '${bloc.currentPage}/8', | |
| 48 | + onTap: (){Navigator.pop(context);}, | |
| 49 | + ), | |
| 50 | + Expanded( | |
| 51 | + child: PageView.builder( | |
| 52 | + itemCount: 8, | |
| 53 | + scrollDirection: Axis.horizontal, | |
| 54 | + controller: bloc.pageController, | |
| 55 | + onPageChanged: (int index) { | |
| 56 | + bloc.add(CurrentPageIndexChangeEvent(index)); | |
| 57 | + }, | |
| 58 | + itemBuilder: (BuildContext context,int index){ | |
| 59 | + return _pageViewItemWidget(); | |
| 60 | + }), | |
| 61 | + ) | |
| 62 | + ], | |
| 63 | + ), | |
| 64 | + ], | |
| 65 | + ), | |
| 66 | + ); | |
| 67 | + }); | |
| 68 | + | |
| 69 | + Widget _pageViewItemWidget() => BlocBuilder<TopicWordBloc,TopicWordState>( | |
| 70 | + builder: (context, state){ | |
| 71 | + final bloc = BlocProvider.of<TopicWordBloc>(context); | |
| 72 | + return SafeArea( | |
| 73 | + child: Column( | |
| 74 | + children: [ | |
| 75 | + Text( | |
| 76 | + 'What to do when the sentence question is very long and needs a line break', | |
| 77 | + softWrap: true, | |
| 78 | + style: TextStyle( | |
| 79 | + fontSize: 21.sp, | |
| 80 | + color: const Color(0xFF333333) | |
| 81 | + ) | |
| 82 | + ), | |
| 83 | + 26.verticalSpace, | |
| 84 | + Row( | |
| 85 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
| 86 | + children: [ | |
| 87 | + Offstage( | |
| 88 | + offstage: (bloc.modelCount < 1), | |
| 89 | + child: _decodeImageWidget(1), | |
| 90 | + ), | |
| 91 | + Offstage( | |
| 92 | + offstage: (bloc.modelCount < 2), | |
| 93 | + child: _decodeImageWidget(2), | |
| 94 | + ), | |
| 95 | + Offstage( | |
| 96 | + offstage: (bloc.modelCount < 3), | |
| 97 | + child: _decodeImageWidget(3), | |
| 98 | + ), | |
| 99 | + Offstage( | |
| 100 | + offstage: (bloc.modelCount < 4), | |
| 101 | + child: _decodeImageWidget(4), | |
| 102 | + ) | |
| 103 | + ], | |
| 104 | + ) | |
| 105 | + ], | |
| 106 | + ), | |
| 107 | + ); | |
| 108 | + }); | |
| 109 | + | |
| 110 | + Widget _decodeImageWidget(int index) => BlocBuilder<TopicWordBloc,TopicWordState>( | |
| 111 | + buildWhen: (_, s) => s is SelectItemChangeState, | |
| 112 | + builder: (context,state){ | |
| 113 | + final bloc = BlocProvider.of<TopicWordBloc>(context); | |
| 114 | + return GestureDetector( | |
| 115 | + onTap: () => bloc.add(SelectItemEvent(index)), | |
| 116 | + child: Container( | |
| 117 | + width: 143.w, | |
| 118 | + height: 143.h, | |
| 119 | + padding: EdgeInsets.only(left: 13.w,right: 13.w,top: 13.h,bottom: 13.h), | |
| 120 | + decoration: BoxDecoration( | |
| 121 | + color: Colors.white, | |
| 122 | + borderRadius: BorderRadius.circular(15), | |
| 123 | + border: Border.all( | |
| 124 | + width: 1.0, | |
| 125 | + color: const Color(0xFF140C10) | |
| 126 | + ), | |
| 127 | + ), | |
| 128 | + child: Column( | |
| 129 | + mainAxisAlignment: MainAxisAlignment.end, | |
| 130 | + children: [ | |
| 131 | + Expanded( | |
| 132 | + child: Container( | |
| 133 | + alignment: Alignment.center, | |
| 134 | + child: Text( | |
| 135 | + 'yellow', | |
| 136 | + style: TextStyle( | |
| 137 | + fontSize: 20.sp, | |
| 138 | + color: const Color(0xFF333333) | |
| 139 | + ) | |
| 140 | + ), | |
| 141 | + ), | |
| 142 | + ), | |
| 143 | + Container( | |
| 144 | + height: 30.h, | |
| 145 | + width: double.infinity, | |
| 146 | + decoration: BoxDecoration( | |
| 147 | + color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white, | |
| 148 | + borderRadius: BorderRadius.circular(15.r), | |
| 149 | + border: Border.all( | |
| 150 | + width: 1.5, | |
| 151 | + color: const Color(0xFF140C10) | |
| 152 | + ), | |
| 153 | + ), | |
| 154 | + alignment: Alignment.center, | |
| 155 | + child: Image.asset('choose'.assetPng), | |
| 156 | + ) | |
| 157 | + ], | |
| 158 | + ), | |
| 159 | + ), | |
| 160 | + ); | |
| 161 | + }); | |
| 162 | +} | |
| 0 | 163 | \ No newline at end of file | ... | ... |
lib/practice/widgets/practice_header_widget.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 | + | |
| 5 | +class PracticeHeaderWidget extends StatelessWidget { | |
| 6 | + const PracticeHeaderWidget({super.key, required this.onTap,this.title = ''}); | |
| 7 | + | |
| 8 | + final Function() onTap; | |
| 9 | + | |
| 10 | + final String title; | |
| 11 | + | |
| 12 | + @override | |
| 13 | + Widget build(BuildContext context) { | |
| 14 | + return Container( | |
| 15 | + color: Colors.white, | |
| 16 | + height: 60.h, | |
| 17 | + child: Row( | |
| 18 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
| 19 | + children: [ | |
| 20 | + Padding( | |
| 21 | + padding: EdgeInsets.only( | |
| 22 | + left: ScreenUtil().bottomBarHeight | |
| 23 | + ), | |
| 24 | + child: IconButton( | |
| 25 | + onPressed: (){ | |
| 26 | + onTap(); | |
| 27 | + }, | |
| 28 | + icon: Image.asset( | |
| 29 | + 'back_around'.assetPng, | |
| 30 | + width: 40, | |
| 31 | + height: 40, | |
| 32 | + )), | |
| 33 | + ), | |
| 34 | + Container( | |
| 35 | + height: 40.h, | |
| 36 | + padding: EdgeInsets.symmetric(horizontal: 27.w), | |
| 37 | + decoration: BoxDecoration( | |
| 38 | + color: const Color(0xFF00B6F1), | |
| 39 | + borderRadius: BorderRadius.circular(20.r), | |
| 40 | + border: Border.all( | |
| 41 | + width: 1.0, | |
| 42 | + color: const Color(0xFF333333), | |
| 43 | + ), | |
| 44 | + ), | |
| 45 | + alignment: Alignment.center, | |
| 46 | + child: Text( | |
| 47 | + title, | |
| 48 | + style: TextStyle( | |
| 49 | + fontSize: 20.sp, | |
| 50 | + color: Colors.white | |
| 51 | + ), | |
| 52 | + ), | |
| 53 | + ), | |
| 54 | + ScreenUtil().bottomBarHeight.horizontalSpace, | |
| 55 | + ], | |
| 56 | + ), | |
| 57 | + ); | |
| 58 | + } | |
| 59 | +} | |
| 0 | 60 | \ No newline at end of file | ... | ... |
lib/route/route.dart
| ... | ... | @@ -8,6 +8,8 @@ import 'package:wow_english/listen/listen_page.dart'; |
| 8 | 8 | import 'package:wow_english/login/forgetpwd/forget_password_home_page.dart'; |
| 9 | 9 | import 'package:wow_english/login/loginpage/login_page.dart'; |
| 10 | 10 | import 'package:wow_english/login/setpwd/set_pwd_page.dart'; |
| 11 | +import 'package:wow_english/practice/chosetopic/topicpicture/topic_picture_page.dart'; | |
| 12 | +import 'package:wow_english/practice/chosetopic/topicword/topic_word_page.dart'; | |
| 11 | 13 | import 'package:wow_english/repeatafter/repeat_after_page.dart'; |
| 12 | 14 | import 'package:wow_english/shop/exchane/exchange_lesson_page.dart'; |
| 13 | 15 | import 'package:wow_english/shop/exchangelist/exchange_lesson_list_page.dart'; |
| ... | ... | @@ -28,6 +30,8 @@ class AppRouteName { |
| 28 | 30 | static const String exLesson = 'exLesson'; |
| 29 | 31 | static const String exList = 'exList'; |
| 30 | 32 | static const String reAfter = 'reAfter'; |
| 33 | + static const String topicPic = 'topicPic'; | |
| 34 | + static const String topicWord = 'topicWord'; | |
| 31 | 35 | static const String tab = '/'; |
| 32 | 36 | } |
| 33 | 37 | |
| ... | ... | @@ -62,6 +66,10 @@ class AppRouter { |
| 62 | 66 | return CupertinoPageRoute(builder: (_) => const ExchangeLessonListPage()); |
| 63 | 67 | case AppRouteName.reAfter: |
| 64 | 68 | return CupertinoPageRoute(builder: (_) => const RepeatAfterPage()); |
| 69 | + case AppRouteName.topicPic: | |
| 70 | + return CupertinoPageRoute(builder: (_) => const TopicPicturePage()); | |
| 71 | + case AppRouteName.topicWord: | |
| 72 | + return CupertinoPageRoute(builder: (_) => const TopicWordPage()); | |
| 65 | 73 | case AppRouteName.setPwd: |
| 66 | 74 | final phoneNum = (settings.arguments as Map)['phoneNumber'] as String; |
| 67 | 75 | return CupertinoPageRoute(builder: (_) => SetPassWordPage(phoneNum: phoneNum)); | ... | ... |