mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
update style
This commit is contained in:
@@ -6,7 +6,6 @@ import 'package:dio_log/dio_log.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:qinglong_app/base/http/token_interceptor.dart';
|
import 'package:qinglong_app/base/http/token_interceptor.dart';
|
||||||
import 'package:qinglong_app/base/userinfo_viewmodel.dart';
|
import 'package:qinglong_app/base/userinfo_viewmodel.dart';
|
||||||
import 'package:qinglong_app/utils/QlNavigatorObserver.dart';
|
|
||||||
|
|
||||||
import '../../json.jc.dart';
|
import '../../json.jc.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ ThemeData lightTheme = ThemeData.light().copyWith(
|
|||||||
abstract class ThemeColors {
|
abstract class ThemeColors {
|
||||||
Color settingBgColor();
|
Color settingBgColor();
|
||||||
|
|
||||||
Color taskTitleColor();
|
Color titleColor();
|
||||||
|
|
||||||
Color descColor();
|
Color descColor();
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ abstract class ThemeColors {
|
|||||||
|
|
||||||
class LightThemeColors extends ThemeColors {
|
class LightThemeColors extends ThemeColors {
|
||||||
@override
|
@override
|
||||||
Color taskTitleColor() {
|
Color titleColor() {
|
||||||
return const Color(0xff333333);
|
return const Color(0xff333333);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ class LightThemeColors extends ThemeColors {
|
|||||||
|
|
||||||
class DartThemeColors extends ThemeColors {
|
class DartThemeColors extends ThemeColors {
|
||||||
@override
|
@override
|
||||||
Color taskTitleColor() {
|
Color titleColor() {
|
||||||
return Colors.white;
|
return Colors.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import 'package:get_it/get_it.dart';
|
|||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
import 'package:qinglong_app/base/theme.dart';
|
import 'package:qinglong_app/base/theme.dart';
|
||||||
import 'package:qinglong_app/module/login/login_page.dart';
|
import 'package:qinglong_app/module/login/login_page.dart';
|
||||||
import 'package:qinglong_app/utils/QlNavigatorObserver.dart';
|
|
||||||
import 'package:qinglong_app/utils/sp_utils.dart';
|
import 'package:qinglong_app/utils/sp_utils.dart';
|
||||||
|
|
||||||
import 'base/routes.dart';
|
import 'base/routes.dart';
|
||||||
@@ -25,7 +24,6 @@ void main() async {
|
|||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await SpUtil.getInstance();
|
await SpUtil.getInstance();
|
||||||
getIt.registerSingleton<UserInfoViewModel>(UserInfoViewModel());
|
getIt.registerSingleton<UserInfoViewModel>(UserInfoViewModel());
|
||||||
getIt.registerSingleton<QlNavigatorObserver>(QlNavigatorObserver());
|
|
||||||
|
|
||||||
runApp(
|
runApp(
|
||||||
ProviderScope(
|
ProviderScope(
|
||||||
@@ -58,7 +56,6 @@ class QlAppState extends ConsumerState<QlApp> {
|
|||||||
},
|
},
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
locale: const Locale('zh', 'cn'),
|
locale: const Locale('zh', 'cn'),
|
||||||
navigatorObservers: [getIt<QlNavigatorObserver>()],
|
|
||||||
navigatorKey: navigatorState,
|
navigatorKey: navigatorState,
|
||||||
theme: ref.watch<ThemeViewModel>(themeProvider).currentTheme,
|
theme: ref.watch<ThemeViewModel>(themeProvider).currentTheme,
|
||||||
onGenerateRoute: (setting) {
|
onGenerateRoute: (setting) {
|
||||||
|
|||||||
39
lib/module/env/env_page.dart
vendored
39
lib/module/env/env_page.dart
vendored
@@ -49,8 +49,7 @@ class _EnvPageState extends State<EnvPage> {
|
|||||||
return model.loadData(false);
|
return model.loadData(false);
|
||||||
},
|
},
|
||||||
child: ReorderableListView(
|
child: ReorderableListView(
|
||||||
keyboardDismissBehavior:
|
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||||
ScrollViewKeyboardDismissBehavior.onDrag,
|
|
||||||
header: searchCell(ref),
|
header: searchCell(ref),
|
||||||
onReorder: (int oldIndex, int newIndex) {
|
onReorder: (int oldIndex, int newIndex) {
|
||||||
if (list.length != model.list.length) {
|
if (list.length != model.list.length) {
|
||||||
@@ -142,8 +141,7 @@ class EnvItemCell extends StatelessWidget {
|
|||||||
backgroundColor: Colors.grey,
|
backgroundColor: Colors.grey,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
onPressed: (_) {
|
onPressed: (_) {
|
||||||
Navigator.of(context)
|
Navigator.of(context).pushNamed(Routes.routeAddEnv, arguments: bean);
|
||||||
.pushNamed(Routes.routeAddEnv, arguments: bean);
|
|
||||||
},
|
},
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
icon: CupertinoIcons.pencil,
|
icon: CupertinoIcons.pencil,
|
||||||
@@ -155,9 +153,7 @@ class EnvItemCell extends StatelessWidget {
|
|||||||
enableEnv();
|
enableEnv();
|
||||||
},
|
},
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
icon: bean.status == 0
|
icon: bean.status == 0 ? Icons.dnd_forwardslash : Icons.check_circle_outline_sharp,
|
||||||
? Icons.dnd_forwardslash
|
|
||||||
: Icons.check_circle_outline_sharp,
|
|
||||||
),
|
),
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
@@ -190,23 +186,30 @@ class EnvItemCell extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Text(
|
child: Text(
|
||||||
bean.name ?? "",
|
bean.name ?? "",
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color: bean.status == 1
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
? const Color(0xffF85152)
|
|
||||||
: ref
|
|
||||||
.watch(themeProvider)
|
|
||||||
.themeColor
|
|
||||||
.taskTitleColor(),
|
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
bean.status == 1
|
||||||
|
? const Icon(
|
||||||
|
Icons.dnd_forwardslash,
|
||||||
|
size: 12,
|
||||||
|
color: Colors.red,
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
const Spacer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
@@ -218,10 +221,7 @@ class EnvItemCell extends StatelessWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color: ref
|
color: ref.watch(themeProvider).themeColor.descColor(),
|
||||||
.watch(themeProvider)
|
|
||||||
.themeColor
|
|
||||||
.descColor(),
|
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -238,8 +238,7 @@ class EnvItemCell extends StatelessWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color:
|
color: ref.watch(themeProvider).themeColor.descColor(),
|
||||||
ref.watch(themeProvider).themeColor.descColor(),
|
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ class DependencyCell extends ConsumerWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -220,7 +220,7 @@ class DependencyCell extends ConsumerWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class _LoginLogPageState extends ConsumerState<LoginLogPage> with LazyLoadState<
|
|||||||
Utils.formatMessageTime(item.timestamp ?? 0),
|
Utils.formatMessageTime(item.timestamp ?? 0),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
|||||||
Text(
|
Text(
|
||||||
"脚本管理",
|
"脚本管理",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -90,7 +90,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
|||||||
Text(
|
Text(
|
||||||
"依赖管理",
|
"依赖管理",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -123,7 +123,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
|||||||
Text(
|
Text(
|
||||||
"任务日志",
|
"任务日志",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -157,7 +157,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
|||||||
Text(
|
Text(
|
||||||
"登录日志",
|
"登录日志",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -202,7 +202,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
|||||||
Text(
|
Text(
|
||||||
"夜间模式",
|
"夜间模式",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class _ScriptPageState extends ConsumerState<ScriptPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (item.disabled ?? false)
|
color: (item.disabled ?? false)
|
||||||
? ref.watch(themeProvider).themeColor.descColor()
|
? ref.watch(themeProvider).themeColor.descColor()
|
||||||
: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -73,7 +73,7 @@ class _ScriptPageState extends ConsumerState<ScriptPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (item.disabled ?? false)
|
color: (item.disabled ?? false)
|
||||||
? ref.watch(themeProvider).themeColor.descColor()
|
? ref.watch(themeProvider).themeColor.descColor()
|
||||||
: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -95,7 +95,7 @@ class _ScriptPageState extends ConsumerState<ScriptPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (item.disabled ?? false)
|
color: (item.disabled ?? false)
|
||||||
? ref.watch(themeProvider).themeColor.descColor()
|
? ref.watch(themeProvider).themeColor.descColor()
|
||||||
: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class _TaskLogPageState extends ConsumerState<TaskLogPage> with LazyLoadState<Ta
|
|||||||
title: Text(
|
title: Text(
|
||||||
item.name ?? "",
|
item.name ?? "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -58,7 +58,7 @@ class _TaskLogPageState extends ConsumerState<TaskLogPage> with LazyLoadState<Ta
|
|||||||
title: Text(
|
title: Text(
|
||||||
e,
|
e,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -72,7 +72,7 @@ class _TaskLogPageState extends ConsumerState<TaskLogPage> with LazyLoadState<Ta
|
|||||||
title: Text(
|
title: Text(
|
||||||
item.name ?? "",
|
item.name ?? "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ref.watch(themeProvider).themeColor.taskTitleColor(),
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
color:
|
color:
|
||||||
ref.watch(themeProvider).themeColor.taskTitleColor(),
|
ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -292,7 +292,7 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
color: ref
|
color: ref
|
||||||
.watch(themeProvider)
|
.watch(themeProvider)
|
||||||
.themeColor
|
.themeColor
|
||||||
.taskTitleColor(),
|
.titleColor(),
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:qinglong_app/base/routes.dart';
|
|
||||||
|
|
||||||
class QlNavigatorObserver extends NavigatorObserver {
|
|
||||||
bool isInLoginPage = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didPush(Route route, Route? previousRoute) {
|
|
||||||
super.didPush(route, previousRoute);
|
|
||||||
if (Routes.routeLogin == route.settings.name) {
|
|
||||||
isInLoginPage = true;
|
|
||||||
} else {
|
|
||||||
isInLoginPage = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user