Commit cc3b183a78ff5a34ac3459a0992149fb73f87c15
1 parent
23b46e8e
feat:ios启动图/logo
Showing
44 changed files
with
112 additions
and
75 deletions
ios/Runner.xcodeproj/project.pbxproj
@@ -505,8 +505,12 @@ | @@ -505,8 +505,12 @@ | ||
505 | ); | 505 | ); |
506 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 506 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
507 | PRODUCT_NAME = "$(TARGET_NAME)"; | 507 | PRODUCT_NAME = "$(TARGET_NAME)"; |
508 | + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | ||
509 | + SUPPORTS_MACCATALYST = NO; | ||
510 | + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; | ||
508 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | 511 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
509 | SWIFT_VERSION = 5.0; | 512 | SWIFT_VERSION = 5.0; |
513 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
510 | VERSIONING_SYSTEM = "apple-generic"; | 514 | VERSIONING_SYSTEM = "apple-generic"; |
511 | }; | 515 | }; |
512 | name = Profile; | 516 | name = Profile; |
@@ -685,9 +689,13 @@ | @@ -685,9 +689,13 @@ | ||
685 | ); | 689 | ); |
686 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 690 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
687 | PRODUCT_NAME = "$(TARGET_NAME)"; | 691 | PRODUCT_NAME = "$(TARGET_NAME)"; |
692 | + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | ||
693 | + SUPPORTS_MACCATALYST = NO; | ||
694 | + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; | ||
688 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | 695 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
689 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | 696 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; |
690 | SWIFT_VERSION = 5.0; | 697 | SWIFT_VERSION = 5.0; |
698 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
691 | VERSIONING_SYSTEM = "apple-generic"; | 699 | VERSIONING_SYSTEM = "apple-generic"; |
692 | }; | 700 | }; |
693 | name = Debug; | 701 | name = Debug; |
@@ -709,8 +717,12 @@ | @@ -709,8 +717,12 @@ | ||
709 | ); | 717 | ); |
710 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 718 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
711 | PRODUCT_NAME = "$(TARGET_NAME)"; | 719 | PRODUCT_NAME = "$(TARGET_NAME)"; |
720 | + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | ||
721 | + SUPPORTS_MACCATALYST = NO; | ||
722 | + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; | ||
712 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | 723 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
713 | SWIFT_VERSION = 5.0; | 724 | SWIFT_VERSION = 5.0; |
725 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
714 | VERSIONING_SYSTEM = "apple-generic"; | 726 | VERSIONING_SYSTEM = "apple-generic"; |
715 | }; | 727 | }; |
716 | name = Release; | 728 | name = Release; |
ios/Runner/Assets.xcassets/AppIcon.appiconset/1024*1024.png
0 → 100644
283 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120 1.png
0 → 100644
17.9 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120.png
0 → 100644
17.9 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/152*152.png
0 → 100644
23.5 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/167*167.png
0 → 100644
26.6 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/180*180.png
0 → 100644
29.6 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/20*20.png
0 → 100644
4.72 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29 1.png
0 → 100644
5.32 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29.png
0 → 100644
5.32 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40 1.png
0 → 100644
6.28 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40 2.png
0 → 100644
6.28 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40 3.png
0 → 100644
6.28 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58 1.png
0 → 100644
8.29 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58 2.png
0 → 100644
8.29 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/60*60.png
0 → 100644
8.61 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/76*76.png
0 → 100644
11.1 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80 1.png
0 → 100644
11.1 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80.png
0 → 100644
11.1 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
1 | { | 1 | { |
2 | "images" : [ | 2 | "images" : [ |
3 | { | 3 | { |
4 | - "size" : "20x20", | 4 | + "filename" : "40*40 1.png", |
5 | "idiom" : "iphone", | 5 | "idiom" : "iphone", |
6 | - "filename" : "Icon-App-20x20@2x.png", | ||
7 | - "scale" : "2x" | 6 | + "scale" : "2x", |
7 | + "size" : "20x20" | ||
8 | }, | 8 | }, |
9 | { | 9 | { |
10 | - "size" : "20x20", | 10 | + "filename" : "60*60.png", |
11 | "idiom" : "iphone", | 11 | "idiom" : "iphone", |
12 | - "filename" : "Icon-App-20x20@3x.png", | ||
13 | - "scale" : "3x" | 12 | + "scale" : "3x", |
13 | + "size" : "20x20" | ||
14 | }, | 14 | }, |
15 | { | 15 | { |
16 | - "size" : "29x29", | 16 | + "filename" : "29*29.png", |
17 | "idiom" : "iphone", | 17 | "idiom" : "iphone", |
18 | - "filename" : "Icon-App-29x29@1x.png", | ||
19 | - "scale" : "1x" | 18 | + "scale" : "1x", |
19 | + "size" : "29x29" | ||
20 | }, | 20 | }, |
21 | { | 21 | { |
22 | - "size" : "29x29", | 22 | + "filename" : "58*58 1.png", |
23 | "idiom" : "iphone", | 23 | "idiom" : "iphone", |
24 | - "filename" : "Icon-App-29x29@2x.png", | ||
25 | - "scale" : "2x" | 24 | + "scale" : "2x", |
25 | + "size" : "29x29" | ||
26 | }, | 26 | }, |
27 | { | 27 | { |
28 | - "size" : "29x29", | ||
29 | - "idiom" : "iphone", | ||
30 | "filename" : "Icon-App-29x29@3x.png", | 28 | "filename" : "Icon-App-29x29@3x.png", |
31 | - "scale" : "3x" | 29 | + "idiom" : "iphone", |
30 | + "scale" : "3x", | ||
31 | + "size" : "29x29" | ||
32 | }, | 32 | }, |
33 | { | 33 | { |
34 | - "size" : "40x40", | 34 | + "filename" : "80*80.png", |
35 | "idiom" : "iphone", | 35 | "idiom" : "iphone", |
36 | - "filename" : "Icon-App-40x40@2x.png", | ||
37 | - "scale" : "2x" | 36 | + "scale" : "2x", |
37 | + "size" : "40x40" | ||
38 | }, | 38 | }, |
39 | { | 39 | { |
40 | - "size" : "40x40", | 40 | + "filename" : "120*120.png", |
41 | "idiom" : "iphone", | 41 | "idiom" : "iphone", |
42 | - "filename" : "Icon-App-40x40@3x.png", | ||
43 | - "scale" : "3x" | 42 | + "scale" : "3x", |
43 | + "size" : "40x40" | ||
44 | }, | 44 | }, |
45 | { | 45 | { |
46 | - "size" : "60x60", | 46 | + "filename" : "120*120 1.png", |
47 | "idiom" : "iphone", | 47 | "idiom" : "iphone", |
48 | - "filename" : "Icon-App-60x60@2x.png", | ||
49 | - "scale" : "2x" | 48 | + "scale" : "2x", |
49 | + "size" : "60x60" | ||
50 | }, | 50 | }, |
51 | { | 51 | { |
52 | - "size" : "60x60", | 52 | + "filename" : "180*180.png", |
53 | "idiom" : "iphone", | 53 | "idiom" : "iphone", |
54 | - "filename" : "Icon-App-60x60@3x.png", | ||
55 | - "scale" : "3x" | 54 | + "scale" : "3x", |
55 | + "size" : "60x60" | ||
56 | }, | 56 | }, |
57 | { | 57 | { |
58 | - "size" : "20x20", | 58 | + "filename" : "20*20.png", |
59 | "idiom" : "ipad", | 59 | "idiom" : "ipad", |
60 | - "filename" : "Icon-App-20x20@1x.png", | ||
61 | - "scale" : "1x" | 60 | + "scale" : "1x", |
61 | + "size" : "20x20" | ||
62 | }, | 62 | }, |
63 | { | 63 | { |
64 | - "size" : "20x20", | 64 | + "filename" : "40*40 2.png", |
65 | "idiom" : "ipad", | 65 | "idiom" : "ipad", |
66 | - "filename" : "Icon-App-20x20@2x.png", | ||
67 | - "scale" : "2x" | 66 | + "scale" : "2x", |
67 | + "size" : "20x20" | ||
68 | }, | 68 | }, |
69 | { | 69 | { |
70 | - "size" : "29x29", | 70 | + "filename" : "29*29 1.png", |
71 | "idiom" : "ipad", | 71 | "idiom" : "ipad", |
72 | - "filename" : "Icon-App-29x29@1x.png", | ||
73 | - "scale" : "1x" | 72 | + "scale" : "1x", |
73 | + "size" : "29x29" | ||
74 | }, | 74 | }, |
75 | { | 75 | { |
76 | - "size" : "29x29", | 76 | + "filename" : "58*58 2.png", |
77 | "idiom" : "ipad", | 77 | "idiom" : "ipad", |
78 | - "filename" : "Icon-App-29x29@2x.png", | ||
79 | - "scale" : "2x" | 78 | + "scale" : "2x", |
79 | + "size" : "29x29" | ||
80 | }, | 80 | }, |
81 | { | 81 | { |
82 | - "size" : "40x40", | 82 | + "filename" : "40*40 3.png", |
83 | "idiom" : "ipad", | 83 | "idiom" : "ipad", |
84 | - "filename" : "Icon-App-40x40@1x.png", | ||
85 | - "scale" : "1x" | 84 | + "scale" : "1x", |
85 | + "size" : "40x40" | ||
86 | }, | 86 | }, |
87 | { | 87 | { |
88 | - "size" : "40x40", | 88 | + "filename" : "80*80 1.png", |
89 | "idiom" : "ipad", | 89 | "idiom" : "ipad", |
90 | - "filename" : "Icon-App-40x40@2x.png", | ||
91 | - "scale" : "2x" | 90 | + "scale" : "2x", |
91 | + "size" : "40x40" | ||
92 | }, | 92 | }, |
93 | { | 93 | { |
94 | - "size" : "76x76", | 94 | + "filename" : "76*76.png", |
95 | "idiom" : "ipad", | 95 | "idiom" : "ipad", |
96 | - "filename" : "Icon-App-76x76@1x.png", | ||
97 | - "scale" : "1x" | 96 | + "scale" : "1x", |
97 | + "size" : "76x76" | ||
98 | }, | 98 | }, |
99 | { | 99 | { |
100 | - "size" : "76x76", | 100 | + "filename" : "152*152.png", |
101 | "idiom" : "ipad", | 101 | "idiom" : "ipad", |
102 | - "filename" : "Icon-App-76x76@2x.png", | ||
103 | - "scale" : "2x" | 102 | + "scale" : "2x", |
103 | + "size" : "76x76" | ||
104 | }, | 104 | }, |
105 | { | 105 | { |
106 | - "size" : "83.5x83.5", | 106 | + "filename" : "167*167.png", |
107 | "idiom" : "ipad", | 107 | "idiom" : "ipad", |
108 | - "filename" : "Icon-App-83.5x83.5@2x.png", | ||
109 | - "scale" : "2x" | 108 | + "scale" : "2x", |
109 | + "size" : "83.5x83.5" | ||
110 | }, | 110 | }, |
111 | { | 111 | { |
112 | - "size" : "1024x1024", | 112 | + "filename" : "1024*1024.png", |
113 | "idiom" : "ios-marketing", | 113 | "idiom" : "ios-marketing", |
114 | - "filename" : "Icon-App-1024x1024@1x.png", | ||
115 | - "scale" : "1x" | 114 | + "scale" : "1x", |
115 | + "size" : "1024x1024" | ||
116 | } | 116 | } |
117 | ], | 117 | ], |
118 | "info" : { | 118 | "info" : { |
119 | - "version" : 1, | ||
120 | - "author" : "xcode" | 119 | + "author" : "xcode", |
120 | + "version" : 1 | ||
121 | } | 121 | } |
122 | } | 122 | } |
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted
10.7 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted
295 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted
406 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted
450 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted
282 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted
462 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted
704 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted
406 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted
586 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted
862 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted
862 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted
1.63 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted
762 Bytes
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted
1.2 KB
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted
1.38 KB
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
1 | { | 1 | { |
2 | "images" : [ | 2 | "images" : [ |
3 | { | 3 | { |
4 | + "filename" : "qidongye.png", | ||
4 | "idiom" : "universal", | 5 | "idiom" : "universal", |
5 | - "filename" : "LaunchImage.png", | ||
6 | "scale" : "1x" | 6 | "scale" : "1x" |
7 | }, | 7 | }, |
8 | { | 8 | { |
9 | "idiom" : "universal", | 9 | "idiom" : "universal", |
10 | - "filename" : "LaunchImage@2x.png", | ||
11 | "scale" : "2x" | 10 | "scale" : "2x" |
12 | }, | 11 | }, |
13 | { | 12 | { |
14 | "idiom" : "universal", | 13 | "idiom" : "universal", |
15 | - "filename" : "LaunchImage@3x.png", | ||
16 | "scale" : "3x" | 14 | "scale" : "3x" |
17 | } | 15 | } |
18 | ], | 16 | ], |
19 | "info" : { | 17 | "info" : { |
20 | - "version" : 1, | ||
21 | - "author" : "xcode" | 18 | + "author" : "xcode", |
19 | + "version" : 1 | ||
22 | } | 20 | } |
23 | } | 21 | } |
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted
68 Bytes
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted
68 Bytes
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted
68 Bytes
ios/Runner/Assets.xcassets/LaunchImage.imageset/qidongye.png
0 → 100644
244 KB
lib/app/splash_page.dart
1 | import 'dart:async'; | 1 | import 'dart:async'; |
2 | +import 'dart:io'; | ||
2 | 3 | ||
3 | import 'package:flutter/foundation.dart'; | 4 | import 'package:flutter/foundation.dart'; |
4 | import 'package:flutter/material.dart'; | 5 | import 'package:flutter/material.dart'; |
@@ -7,6 +8,8 @@ import 'package:wow_english/common/extension/string_extension.dart'; | @@ -7,6 +8,8 @@ import 'package:wow_english/common/extension/string_extension.dart'; | ||
7 | import 'package:wow_english/models/user_entity.dart'; | 8 | import 'package:wow_english/models/user_entity.dart'; |
8 | import 'package:wow_english/route/route.dart'; | 9 | import 'package:wow_english/route/route.dart'; |
9 | import 'package:wow_english/utils/sp_util.dart'; | 10 | import 'package:wow_english/utils/sp_util.dart'; |
11 | +import 'package:flutter/services.dart'; | ||
12 | +import 'package:limiting_direction_csx/limiting_direction_csx.dart'; | ||
10 | 13 | ||
11 | class SplashPage extends StatelessWidget { | 14 | class SplashPage extends StatelessWidget { |
12 | const SplashPage({super.key}); | 15 | const SplashPage({super.key}); |
@@ -52,6 +55,17 @@ class _TransitionViewState extends State<TransitionView> { | @@ -52,6 +55,17 @@ class _TransitionViewState extends State<TransitionView> { | ||
52 | void init() async { | 55 | void init() async { |
53 | await SpUtil.preInit(); | 56 | await SpUtil.preInit(); |
54 | startTime(); | 57 | startTime(); |
58 | + changeDevice(); | ||
59 | + } | ||
60 | + | ||
61 | + void changeDevice() async { | ||
62 | + ///设置设备默认方向 | ||
63 | + WidgetsFlutterBinding.ensureInitialized(); | ||
64 | + if (Platform.isIOS) { | ||
65 | + await LimitingDirectionCsx.setScreenDirection(DeviceDirectionMask.Landscape); | ||
66 | + } else { | ||
67 | + await SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight]); | ||
68 | + } | ||
55 | } | 69 | } |
56 | 70 | ||
57 | @override | 71 | @override |
lib/main.dart
@@ -5,17 +5,10 @@ import 'package:limiting_direction_csx/limiting_direction_csx.dart'; | @@ -5,17 +5,10 @@ import 'package:limiting_direction_csx/limiting_direction_csx.dart'; | ||
5 | import 'package:wow_english/app/app.dart'; | 5 | import 'package:wow_english/app/app.dart'; |
6 | import 'package:flutter/services.dart'; | 6 | import 'package:flutter/services.dart'; |
7 | 7 | ||
8 | -void main() async { | 8 | +void main() { |
9 | ///设置设备默认方向 | 9 | ///设置设备默认方向 |
10 | WidgetsFlutterBinding.ensureInitialized(); | 10 | WidgetsFlutterBinding.ensureInitialized(); |
11 | - if (Platform.isIOS) { | ||
12 | - await LimitingDirectionCsx.setScreenDirection(DeviceDirectionMask.Landscape); | ||
13 | - } else { | ||
14 | - await SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight]); | ||
15 | - // SystemChrome.setEnabledSystemUIMode( | ||
16 | - // SystemUiMode.manual, | ||
17 | - // overlays: [SystemUiOverlay.top], | ||
18 | - // ); | 11 | + if (Platform.isAndroid) { |
19 | SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( //设置状态栏透明 | 12 | SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( //设置状态栏透明 |
20 | statusBarColor: Colors.transparent, | 13 | statusBarColor: Colors.transparent, |
21 | )); | 14 | )); |
lib/pages/repeataftercontent/bloc/repeat_after_content_bloc.dart
@@ -2,7 +2,6 @@ import 'package:audioplayers/audioplayers.dart'; | @@ -2,7 +2,6 @@ import 'package:audioplayers/audioplayers.dart'; | ||
2 | import 'package:flutter/cupertino.dart'; | 2 | import 'package:flutter/cupertino.dart'; |
3 | import 'package:flutter/services.dart'; | 3 | import 'package:flutter/services.dart'; |
4 | import 'package:flutter_bloc/flutter_bloc.dart'; | 4 | import 'package:flutter_bloc/flutter_bloc.dart'; |
5 | -import 'package:flutter_easyloading/flutter_easyloading.dart'; | ||
6 | import 'package:wow_english/common/request/dao/listen_dao.dart'; | 5 | import 'package:wow_english/common/request/dao/listen_dao.dart'; |
7 | 6 | ||
8 | import '../../../common/request/exception.dart'; | 7 | import '../../../common/request/exception.dart'; |
@@ -47,6 +46,8 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -47,6 +46,8 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
47 | 46 | ||
48 | Map? _voiceTestResult; | 47 | Map? _voiceTestResult; |
49 | 48 | ||
49 | + int _recordNumber = 0; | ||
50 | + | ||
50 | VoiceRecordState _voiceRecordState = VoiceRecordState.voiceRecordUnkonw; | 51 | VoiceRecordState _voiceRecordState = VoiceRecordState.voiceRecordUnkonw; |
51 | 52 | ||
52 | bool get videoPlaying => _videoPlaying; | 53 | bool get videoPlaying => _videoPlaying; |
@@ -67,6 +68,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -67,6 +68,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
67 | 68 | ||
68 | RepeatAfterContentBloc(this.courseLessonId) : super(RepeatAfterContentInitial()) { | 69 | RepeatAfterContentBloc(this.courseLessonId) : super(RepeatAfterContentInitial()) { |
69 | on<VoiceRecordStateChangeEvent>(_voiceRecordStateChange); | 70 | on<VoiceRecordStateChangeEvent>(_voiceRecordStateChange); |
71 | + on<PostFollowReadContentEvent>(_postFollowReadContent); | ||
70 | on<VideoPlayChangeEvent>(_videoPlayStateChange); | 72 | on<VideoPlayChangeEvent>(_videoPlayStateChange); |
71 | on<RecordeVoicePlayEvent>(_recordeVoicePlay); | 73 | on<RecordeVoicePlayEvent>(_recordeVoicePlay); |
72 | on<XSVoiceResultEvent>(_voiceXsResult); | 74 | on<XSVoiceResultEvent>(_voiceXsResult); |
@@ -103,6 +105,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -103,6 +105,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
103 | methodChannel.setMethodCallHandler((call) async { | 105 | methodChannel.setMethodCallHandler((call) async { |
104 | if (call.method == 'voiceResult') {//评测结果 | 106 | if (call.method == 'voiceResult') {//评测结果 |
105 | add(XSVoiceResultEvent(call.arguments)); | 107 | add(XSVoiceResultEvent(call.arguments)); |
108 | + add(PostFollowReadContentEvent()); | ||
106 | return; | 109 | return; |
107 | } | 110 | } |
108 | 111 | ||
@@ -117,7 +120,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -117,7 +120,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
117 | } | 120 | } |
118 | 121 | ||
119 | if (call.method == 'voiceFail') {//评测失败 | 122 | if (call.method == 'voiceFail') {//评测失败 |
120 | - EasyLoading.showToast('评测失败'); | 123 | + showToast('评测失败'); |
121 | return; | 124 | return; |
122 | } | 125 | } |
123 | }); | 126 | }); |
@@ -138,6 +141,20 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -138,6 +141,20 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
138 | } | 141 | } |
139 | } | 142 | } |
140 | 143 | ||
144 | + ///跟读结果 | ||
145 | + void _postFollowReadContent(PostFollowReadContentEvent event,Emitter<RepeatAfterContentState> emitter) async { | ||
146 | + try { | ||
147 | + await loading(() async { | ||
148 | + _entityList = await ListenDao.followResult(_recordNumber.toString(),courseLessonId); | ||
149 | + | ||
150 | + }); | ||
151 | + } catch (e) { | ||
152 | + if (e is ApiException) { | ||
153 | + | ||
154 | + } | ||
155 | + } | ||
156 | + } | ||
157 | + | ||
141 | void _videoPlayStateChange(VideoPlayChangeEvent event,Emitter<RepeatAfterContentState> emitter) async { | 158 | void _videoPlayStateChange(VideoPlayChangeEvent event,Emitter<RepeatAfterContentState> emitter) async { |
142 | _videoPlaying = !_videoPlaying; | 159 | _videoPlaying = !_videoPlaying; |
143 | emitter(VideoPlayChangeState()); | 160 | emitter(VideoPlayChangeState()); |
@@ -165,6 +182,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | @@ -165,6 +182,7 @@ class RepeatAfterContentBloc extends Bloc<RepeatAfterContentEvent, RepeatAfterCo | ||
165 | 'startVoice', | 182 | 'startVoice', |
166 | {'word':event.testWord,'type':event.type,'userId':event.userId.toString()} | 183 | {'word':event.testWord,'type':event.type,'userId':event.userId.toString()} |
167 | ); | 184 | ); |
185 | + _recordNumber++; | ||
168 | emitter(XSVoiceTestState()); | 186 | emitter(XSVoiceTestState()); |
169 | } | 187 | } |
170 | 188 |
lib/pages/repeataftercontent/bloc/repeat_after_content_event.dart
@@ -44,4 +44,6 @@ class RecordeVoicePlayEvent extends RepeatAfterContentEvent { | @@ -44,4 +44,6 @@ class RecordeVoicePlayEvent extends RepeatAfterContentEvent { | ||
44 | RecordeVoicePlayEvent(this.audioUrl); | 44 | RecordeVoicePlayEvent(this.audioUrl); |
45 | } | 45 | } |
46 | 46 | ||
47 | +class PostFollowReadContentEvent extends RepeatAfterContentEvent {} | ||
48 | + | ||
47 | 49 |