opt: set&get sheetHeight
This commit is contained in:
@ -10,6 +10,7 @@ import 'package:pilipala/pages/media/index.dart';
|
||||
import 'package:pilipala/pages/rank/index.dart';
|
||||
import 'package:pilipala/utils/event_bus.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import './controller.dart';
|
||||
|
||||
@ -125,6 +126,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
double sheetHeight = MediaQuery.sizeOf(context).height -
|
||||
MediaQuery.of(context).padding.top -
|
||||
MediaQuery.sizeOf(context).width * 9 / 16;
|
||||
GlobalDataCache().sheetHeight = sheetHeight;
|
||||
localCache.put('sheetHeight', sheetHeight);
|
||||
localCache.put('statusBarHeight', statusBarHeight);
|
||||
return PopScope(
|
||||
|
||||
@ -106,7 +106,7 @@ class GlobalDataCache {
|
||||
speedsList.addAll(playSpeedSystem);
|
||||
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
sheetHeight = localCache.get('sheetHeight');
|
||||
sheetHeight = localCache.get('sheetHeight', defaultValue: 0.0);
|
||||
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user