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