Showing
7 changed files
with
20 additions
and
6 deletions
| ... | @@ -6,6 +6,7 @@ | ... | @@ -6,6 +6,7 @@ |
| 6 | android:icon="@mipmap/ic_launcher" | 6 | android:icon="@mipmap/ic_launcher" |
| 7 | android:label="Parlando" | 7 | android:label="Parlando" |
| 8 | android:requestLegacyExternalStorage="true" | 8 | android:requestLegacyExternalStorage="true" |
| 9 | + android:networkSecurityConfig="@xml/network_security_config" | ||
| 9 | tools:replace="android:label"> | 10 | tools:replace="android:label"> |
| 10 | <activity | 11 | <activity |
| 11 | android:name=".MainActivity" | 12 | android:name=".MainActivity" |
| ... | @@ -51,6 +52,9 @@ | ... | @@ -51,6 +52,9 @@ |
| 51 | <meta-data | 52 | <meta-data |
| 52 | android:name="com.facebook.sdk.ClientToken" | 53 | android:name="com.facebook.sdk.ClientToken" |
| 53 | android:value="@string/facebook_client_token" /> | 54 | android:value="@string/facebook_client_token" /> |
| 55 | + <meta-data | ||
| 56 | + android:name="com.amap.api.v2.apikey" | ||
| 57 | + android:value="038a8a2d7280a244b5c51d517023ede3" /> | ||
| 54 | </application> | 58 | </application> |
| 55 | 59 | ||
| 56 | <queries> | 60 | <queries> | ... | ... |
| ... | @@ -15,6 +15,7 @@ import 'package:pausable_timer/pausable_timer.dart'; | ... | @@ -15,6 +15,7 @@ import 'package:pausable_timer/pausable_timer.dart'; |
| 15 | import 'package:flutter_sound_platform_interface/flutter_sound_recorder_platform_interface.dart'; | 15 | import 'package:flutter_sound_platform_interface/flutter_sound_recorder_platform_interface.dart'; |
| 16 | import 'package:flutter/foundation.dart' show kIsWeb; | 16 | import 'package:flutter/foundation.dart' show kIsWeb; |
| 17 | import 'package:permission_handler/permission_handler.dart'; | 17 | import 'package:permission_handler/permission_handler.dart'; |
| 18 | +import 'package:wakelock/wakelock.dart'; | ||
| 18 | 19 | ||
| 19 | import '../poem_router.dart'; | 20 | import '../poem_router.dart'; |
| 20 | 21 | ||
| ... | @@ -158,10 +159,10 @@ class AudioToolBar extends StatefulWidget { | ... | @@ -158,10 +159,10 @@ class AudioToolBar extends StatefulWidget { |
| 158 | }) : super(key: key); | 159 | }) : super(key: key); |
| 159 | 160 | ||
| 160 | @override | 161 | @override |
| 161 | - _AudioToolBarState createState() => _AudioToolBarState(); | 162 | + AudioToolBarState createState() => AudioToolBarState(); |
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | -class _AudioToolBarState extends State<AudioToolBar> { | 165 | +class AudioToolBarState extends State<AudioToolBar> { |
| 165 | late final PausableTimer _timer; | 166 | late final PausableTimer _timer; |
| 166 | int currentTimer = 0; | 167 | int currentTimer = 0; |
| 167 | int duration = 60 * 1000; | 168 | int duration = 60 * 1000; |
| ... | @@ -180,7 +181,7 @@ class _AudioToolBarState extends State<AudioToolBar> { | ... | @@ -180,7 +181,7 @@ class _AudioToolBarState extends State<AudioToolBar> { |
| 180 | @override | 181 | @override |
| 181 | void initState() { | 182 | void initState() { |
| 182 | super.initState(); | 183 | super.initState(); |
| 183 | - | 184 | + Wakelock.enable(); |
| 184 | _mPlayer!.openPlayer().then((value) { | 185 | _mPlayer!.openPlayer().then((value) { |
| 185 | setState(() { | 186 | setState(() { |
| 186 | _mPlayerIsInited = true; | 187 | _mPlayerIsInited = true; |
| ... | @@ -216,6 +217,7 @@ class _AudioToolBarState extends State<AudioToolBar> { | ... | @@ -216,6 +217,7 @@ class _AudioToolBarState extends State<AudioToolBar> { |
| 216 | 217 | ||
| 217 | _mRecorder!.closeRecorder(); | 218 | _mRecorder!.closeRecorder(); |
| 218 | _mRecorder = null; | 219 | _mRecorder = null; |
| 220 | + Wakelock.disable(); | ||
| 219 | super.dispose(); | 221 | super.dispose(); |
| 220 | } | 222 | } |
| 221 | 223 | ... | ... |
| ... | @@ -12,6 +12,7 @@ import 'package:path_provider/path_provider.dart'; | ... | @@ -12,6 +12,7 @@ import 'package:path_provider/path_provider.dart'; |
| 12 | import 'package:pausable_timer/pausable_timer.dart'; | 12 | import 'package:pausable_timer/pausable_timer.dart'; |
| 13 | import 'package:video_player/video_player.dart'; | 13 | import 'package:video_player/video_player.dart'; |
| 14 | import 'package:Parlando/extension/int_extension.dart'; | 14 | import 'package:Parlando/extension/int_extension.dart'; |
| 15 | +import 'package:wakelock/wakelock.dart'; | ||
| 15 | 16 | ||
| 16 | import '../poem_router.dart'; | 17 | import '../poem_router.dart'; |
| 17 | 18 | ||
| ... | @@ -55,6 +56,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> | ... | @@ -55,6 +56,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> |
| 55 | 56 | ||
| 56 | @override | 57 | @override |
| 57 | void initState() { | 58 | void initState() { |
| 59 | + Wakelock.enable(); | ||
| 58 | // Hide the status bar in Android | 60 | // Hide the status bar in Android |
| 59 | SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); | 61 | SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); |
| 60 | initCameras().then((value) { | 62 | initCameras().then((value) { |
| ... | @@ -69,7 +71,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> | ... | @@ -69,7 +71,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> |
| 69 | 71 | ||
| 70 | _timer = PausableTimer( | 72 | _timer = PausableTimer( |
| 71 | const Duration(milliseconds: 100), | 73 | const Duration(milliseconds: 100), |
| 72 | - () { | 74 | + () { |
| 73 | currentTimer += 100; | 75 | currentTimer += 100; |
| 74 | _timer | 76 | _timer |
| 75 | ..reset() | 77 | ..reset() |
| ... | @@ -244,6 +246,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> | ... | @@ -244,6 +246,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage> |
| 244 | 246 | ||
| 245 | ///取消计时器 | 247 | ///取消计时器 |
| 246 | _timer.cancel(); | 248 | _timer.cancel(); |
| 249 | + Wakelock.disable(); | ||
| 247 | super.dispose(); | 250 | super.dispose(); |
| 248 | } | 251 | } |
| 249 | 252 | ... | ... |
| ... | @@ -29,7 +29,7 @@ class _AddressSelectPageState extends State<AddressSelectPage> { | ... | @@ -29,7 +29,7 @@ class _AddressSelectPageState extends State<AddressSelectPage> { |
| 29 | super.initState(); | 29 | super.initState(); |
| 30 | // TODO 需要根据项目单独设置keys | 30 | // TODO 需要根据项目单独设置keys |
| 31 | Flutter2dAMap.setApiKey( | 31 | Flutter2dAMap.setApiKey( |
| 32 | - iOSKey: '4327916279bf45a044bb53b947442387', | 32 | + iOSKey: 'd94fbf50f5bfa86cd4e793c9ed4a9a97', |
| 33 | ); | 33 | ); |
| 34 | } | 34 | } |
| 35 | 35 | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev | ... | @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev |
| 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. | 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. |
| 16 | # Read more about iOS versioning at | 16 | # Read more about iOS versioning at |
| 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html |
| 18 | -version: 1.0.0+4 | 18 | +version: 1.0.0+5 |
| 19 | 19 | ||
| 20 | environment: | 20 | environment: |
| 21 | sdk: ">=2.16.2 <3.0.0" | 21 | sdk: ">=2.16.2 <3.0.0" |
| ... | @@ -128,6 +128,7 @@ dependencies: | ... | @@ -128,6 +128,7 @@ dependencies: |
| 128 | flutter_easy_permission: ^1.1.2 | 128 | flutter_easy_permission: ^1.1.2 |
| 129 | 129 | ||
| 130 | google_fonts: ^3.0.1 | 130 | google_fonts: ^3.0.1 |
| 131 | + wakelock: ^0.6.1+2 | ||
| 131 | 132 | ||
| 132 | dependency_overrides: | 133 | dependency_overrides: |
| 133 | decimal: 1.5.0 | 134 | decimal: 1.5.0 | ... | ... |
-
Please register or login to post a comment