样式调整、全局appbar逻辑调整、注销逻辑调整
This commit is contained in:
parent
ed9035be5b
commit
31d8a7f167
|
@ -26,7 +26,7 @@ class UserService extends GetxService {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
token = StorageService.to.getString(StorageUserTokenKey);
|
token = StorageService.to.getString(StorageUserTokenKey);
|
||||||
var profileOffline = StorageService.to.getString(StorageUserProfileKey);
|
var profileOffline = StorageService.to.getString(StorageUserProfileKey);
|
||||||
if (profileOffline.isNotEmpty) {
|
if (profileOffline.isNotEmpty && token.isNotEmpty) {
|
||||||
_profile(UserLoginResponse.fromJson(jsonDecode(profileOffline)));
|
_profile(UserLoginResponse.fromJson(jsonDecode(profileOffline)));
|
||||||
_isLogin.value = true;
|
_isLogin.value = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ class Global {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
|
|
||||||
// 调整系统UI
|
// 调整系统UI 因为appBar会覆盖这个设置 所以换了个地方设置
|
||||||
setSystemUi();
|
// setSystemUi();
|
||||||
|
|
||||||
// 初始换easyLoading
|
// 初始换easyLoading
|
||||||
Loading();
|
Loading();
|
||||||
|
@ -29,6 +29,7 @@ class Global {
|
||||||
static void setSystemUi() {
|
static void setSystemUi() {
|
||||||
if (GetPlatform.isAndroid) {
|
if (GetPlatform.isAndroid) {
|
||||||
// android 状态栏为透明的沉浸
|
// android 状态栏为透明的沉浸
|
||||||
|
// TODO AppBar会覆盖这里的设置
|
||||||
SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(
|
SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(
|
||||||
statusBarColor: Colors.transparent,
|
statusBarColor: Colors.transparent,
|
||||||
statusBarBrightness: Brightness.light,
|
statusBarBrightness: Brightness.light,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
@ -31,7 +32,18 @@ class MyApp extends StatelessWidget {
|
||||||
var app = GetMaterialApp(
|
var app = GetMaterialApp(
|
||||||
title: 'News',
|
title: 'News',
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: AppTheme.light,
|
theme: AppTheme.light.copyWith(
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarBrightness: Brightness.light,
|
||||||
|
statusBarIconBrightness: Brightness.dark,
|
||||||
|
systemNavigationBarDividerColor: Colors.transparent,
|
||||||
|
systemNavigationBarColor: Colors.white,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.dark,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
unknownRoute: AppPages.notFoundRoute,
|
unknownRoute: AppPages.notFoundRoute,
|
||||||
initialRoute: AppPages.Initial,
|
initialRoute: AppPages.Initial,
|
||||||
getPages: AppPages.pages,
|
getPages: AppPages.pages,
|
||||||
|
|
|
@ -51,11 +51,11 @@ class NewsLetterWidget extends GetView<MainController> {
|
||||||
|
|
||||||
// btn subcrible
|
// btn subcrible
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 15),
|
padding: EdgeInsets.only(top: 15.h),
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
width: 335.w,
|
width: 335,
|
||||||
height: 44.h,
|
height: 44,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
title: "Subscribe",
|
title: "Subscribe",
|
||||||
),
|
),
|
||||||
|
|
|
@ -7,7 +7,6 @@ import 'package:news_getx/modules/application/application_binding.dart';
|
||||||
import 'package:news_getx/modules/application/application_page.dart';
|
import 'package:news_getx/modules/application/application_page.dart';
|
||||||
import 'package:news_getx/modules/bookmarks/bookmarks_binding.dart';
|
import 'package:news_getx/modules/bookmarks/bookmarks_binding.dart';
|
||||||
import 'package:news_getx/modules/category/category_binding.dart';
|
import 'package:news_getx/modules/category/category_binding.dart';
|
||||||
import 'package:news_getx/modules/category/category_page.dart';
|
|
||||||
import 'package:news_getx/modules/detail/detail_binding.dart';
|
import 'package:news_getx/modules/detail/detail_binding.dart';
|
||||||
import 'package:news_getx/modules/detail/detail_page.dart';
|
import 'package:news_getx/modules/detail/detail_page.dart';
|
||||||
import 'package:news_getx/modules/main/main_binding.dart';
|
import 'package:news_getx/modules/main/main_binding.dart';
|
||||||
|
|
Loading…
Reference in New Issue