mod: 依赖升级
This commit is contained in:
@ -16,9 +16,10 @@ void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
await GStrorage.init();
|
||||
runApp(const MyApp());
|
||||
await Request.setCookie();
|
||||
await Data.init();
|
||||
runApp(const MyApp());
|
||||
await GStrorage.lazyInit();
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
@ -105,7 +105,7 @@ class _ActionPanelState extends State<ActionPanel> {
|
||||
},
|
||||
child: Text(
|
||||
stat.like!.count ?? '点赞',
|
||||
key: ValueKey<String>(stat.like!.count!),
|
||||
key: ValueKey<String>(stat.like!.count ?? '点赞'),
|
||||
style: TextStyle(
|
||||
color: stat.like!.status! ? primary : color,
|
||||
),
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:pilipala/models/search/hot.dart';
|
||||
import 'package:pilipala/models/search/suggest.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class SearchController extends GetxController {
|
||||
class SSearchController extends GetxController {
|
||||
final FocusNode searchFocusNode = FocusNode();
|
||||
RxString searchKeyWord = ''.obs;
|
||||
Rx<TextEditingController> controller = TextEditingController().obs;
|
||||
|
||||
@ -17,7 +17,7 @@ class SearchPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SearchPageState extends State<SearchPage> with RouteAware {
|
||||
final SearchController _searchController = Get.put(SearchController());
|
||||
final SSearchController _searchController = Get.put(SSearchController());
|
||||
|
||||
@override
|
||||
// 返回当前页面时
|
||||
|
||||
@ -9,7 +9,6 @@ import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/controller.dart';
|
||||
import 'package:pilipala/pages/video/detail/introduction/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/related/index.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
|
||||
import 'widgets/app_bar.dart';
|
||||
|
||||
@ -45,7 +44,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
videoDetailController.markHeartBeat();
|
||||
playerStatus = status;
|
||||
if (status == PlayerStatus.playing) {
|
||||
Wakelock.enable();
|
||||
isPlay = false;
|
||||
isShowCover = false;
|
||||
setState(() {});
|
||||
@ -54,7 +52,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
videoDetailController.timer!.cancel();
|
||||
isPlay = true;
|
||||
setState(() {});
|
||||
Wakelock.disable();
|
||||
// 播放完成停止 or 切换下一个
|
||||
if (status == PlayerStatus.completed) {}
|
||||
}
|
||||
@ -77,7 +74,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
await _meeduPlayerController!.dispose();
|
||||
_meeduPlayerController = null;
|
||||
// The next line disables the wakelock again.
|
||||
await Wakelock.disable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,10 +25,6 @@ class GStrorage {
|
||||
recVideo = await Hive.openBox('recVideo');
|
||||
// 登录用户信息
|
||||
userInfo = await Hive.openBox('userInfo');
|
||||
// 热搜关键词
|
||||
hotKeyword = await Hive.openBox('hotKeyword');
|
||||
// 搜索历史
|
||||
historyword = await Hive.openBox('historyWord');
|
||||
// 本地缓存
|
||||
localCache = await Hive.openBox('localCache');
|
||||
}
|
||||
@ -43,6 +39,13 @@ class GStrorage {
|
||||
Hive.registerAdapter(HotSearchModelAdapter());
|
||||
Hive.registerAdapter(HotSearchItemAdapter());
|
||||
}
|
||||
|
||||
static Future<void> lazyInit() async {
|
||||
// 热搜关键词
|
||||
hotKeyword = await Hive.openBox('hotKeyword');
|
||||
// 搜索历史
|
||||
historyword = await Hive.openBox('historyWord');
|
||||
}
|
||||
}
|
||||
|
||||
// 约定 key
|
||||
|
||||
Reference in New Issue
Block a user