diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a07c4ef..fb6eca4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -5,15 +5,21 @@ PODS: - Toast - move_to_background (0.0.1): - Flutter + - package_info_plus (0.4.5): + - Flutter - shared_preferences_ios (0.0.1): - Flutter - Toast (4.0.0) + - url_launcher_ios (0.0.1): + - Flutter DEPENDENCIES: - Flutter (from `Flutter`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - move_to_background (from `.symlinks/plugins/move_to_background/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) SPEC REPOS: trunk: @@ -26,15 +32,21 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/fluttertoast/ios" move_to_background: :path: ".symlinks/plugins/move_to_background/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" shared_preferences_ios: :path: ".symlinks/plugins/shared_preferences_ios/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58 move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d + package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 + url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af PODFILE CHECKSUM: aea2ed8a4b05dec076f6f7cea39202b1133ed51c diff --git a/lib/base/routes.dart b/lib/base/routes.dart index 0a51954..caafac2 100644 --- a/lib/base/routes.dart +++ b/lib/base/routes.dart @@ -15,6 +15,7 @@ import 'package:qinglong_app/module/others/scripts/script_edit_page.dart'; import 'package:qinglong_app/module/others/scripts/script_page.dart'; import 'package:qinglong_app/module/others/task_log/task_log_detail_page.dart'; import 'package:qinglong_app/module/others/task_log/task_log_page.dart'; +import 'package:qinglong_app/module/others/theme_page.dart'; import 'package:qinglong_app/module/others/update_password_page.dart'; import 'package:qinglong_app/module/task/add_task_page.dart'; import 'package:qinglong_app/module/task/task_bean.dart'; @@ -39,6 +40,7 @@ class Routes { static const String routeDependency = "/Dependency"; static const String routeUpdatePassword = "/updatePassword"; static const String routeAbout = "/about"; + static const String routeTheme = "/theme"; static Route? generateRoute(RouteSettings settings) { switch (settings.name) { @@ -56,7 +58,8 @@ class Routes { return CupertinoPageRoute(builder: (context) => const AddTaskPage()); } case routeAddDependency: - return CupertinoPageRoute(builder: (context) => const AddDependencyPage()); + return CupertinoPageRoute( + builder: (context) => const AddDependencyPage()); case routeAddEnv: if (settings.arguments != null) { return CupertinoPageRoute( @@ -122,6 +125,10 @@ class Routes { return CupertinoPageRoute( builder: (context) => const AboutPage(), ); + case routeTheme: + return CupertinoPageRoute( + builder: (context) => const ThemePage(), + ); case routeScriptUpdate: return CupertinoPageRoute( builder: (context) => ScriptEditPage( diff --git a/lib/base/sp_const.dart b/lib/base/sp_const.dart index 647ce53..b4ae7b4 100644 --- a/lib/base/sp_const.dart +++ b/lib/base/sp_const.dart @@ -4,3 +4,4 @@ String spUserName = "username"; String spPassWord = "password"; String spTheme = "dart_mode"; String spSecretLogined = "secret_logined"; +String spCustomColor = "customColor"; diff --git a/lib/base/theme.dart b/lib/base/theme.dart index 13d0688..5150117 100644 --- a/lib/base/theme.dart +++ b/lib/base/theme.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:qinglong_app/base/sp_const.dart'; +import 'package:qinglong_app/base/userinfo_viewmodel.dart'; +import 'package:qinglong_app/main.dart'; import 'package:qinglong_app/utils/codeeditor_theme.dart'; import 'package:qinglong_app/utils/sp_utils.dart'; @@ -10,8 +12,6 @@ var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel()); Color _primaryColor = const Color(0xFF299343); class ThemeViewModel extends ChangeNotifier { - late ThemeData darkTheme; - late ThemeData lightTheme; late ThemeData currentTheme; bool _isInDarkMode = false; @@ -20,8 +20,8 @@ class ThemeViewModel extends ChangeNotifier { ThemeColors themeColor = LightThemeColors(); ThemeViewModel() { - darkTheme = getDartTheme(); - lightTheme = getLightTheme(); + _primaryColor = Color(getIt().primaryColor); + primaryColor = Color(getIt().primaryColor); var brightness = SchedulerBinding.instance!.window.platformBrightness; _isInDarkMode = brightness == Brightness.dark; changeThemeReal(_isInDarkMode, false); @@ -35,10 +35,10 @@ class ThemeViewModel extends ChangeNotifier { _isInDarkMode = dark; SpUtil.putBool(spTheme, dark); if (!dark) { - currentTheme = lightTheme; + currentTheme = getLightTheme(); themeColor = LightThemeColors(); } else { - currentTheme = darkTheme; + currentTheme = getDartTheme(); themeColor = DartThemeColors(); } if (notify) { @@ -48,6 +48,13 @@ class ThemeViewModel extends ChangeNotifier { get darkMode => _isInDarkMode; + void changePrimaryColor(Color color) { + _primaryColor = color; + primaryColor = color; + getIt().updateCustomColor(color.value); + changeThemeReal(SpUtil.getBool(spTheme, defValue: false), true); + } + void changeTheme() { changeThemeReal(!SpUtil.getBool(spTheme, defValue: false), true); } diff --git a/lib/base/userinfo_viewmodel.dart b/lib/base/userinfo_viewmodel.dart index ab33602..3da7a1f 100644 --- a/lib/base/userinfo_viewmodel.dart +++ b/lib/base/userinfo_viewmodel.dart @@ -8,11 +8,13 @@ class UserInfoViewModel { String? _userName; String? _passWord; bool _useSecertLogined = false; + int _primaryColor = 0xFF299343; UserInfoViewModel() { String userInfoJson = SpUtil.getString(spUserInfo); _userName = SpUtil.getString(spUserName); _passWord = SpUtil.getString(spPassWord); + _primaryColor = SpUtil.getInt(spCustomColor, defValue: 0xFF299343); _useSecertLogined = SpUtil.getBool(spSecretLogined, defValue: false); _host = SpUtil.getString(spHost, defValue: ''); @@ -39,6 +41,11 @@ class UserInfoViewModel { SpUtil.putBool(spSecretLogined, _useSecertLogined); } + void updateCustomColor(int color) { + _primaryColor = color; + SpUtil.putInt(spCustomColor, color); + } + void updateHost(String host) { _host = host; SpUtil.putString(spHost, host); @@ -54,6 +61,8 @@ class UserInfoViewModel { bool get useSecretLogined => _useSecertLogined; + int get primaryColor => _primaryColor; + bool isLogined() { return token != null && token!.isNotEmpty; } diff --git a/lib/module/login/login_page.dart b/lib/module/login/login_page.dart index e99d395..a638c1d 100644 --- a/lib/module/login/login_page.dart +++ b/lib/module/login/login_page.dart @@ -24,7 +24,8 @@ class LoginPage extends ConsumerStatefulWidget { } class _LoginPageState extends ConsumerState { - final TextEditingController _hostController = TextEditingController(text: getIt().host); + final TextEditingController _hostController = + TextEditingController(text: getIt().host); final TextEditingController _userNameController = TextEditingController(); final TextEditingController _passwordController = TextEditingController(); final TextEditingController _cIdController = TextEditingController(); @@ -40,7 +41,8 @@ class _LoginPageState extends ConsumerState { super.initState(); useSecretLogin = getIt().useSecretLogined; - if (getIt().userName != null && getIt().userName!.isNotEmpty) { + if (getIt().userName != null && + getIt().userName!.isNotEmpty) { if (getIt().useSecretLogined) { _cIdController.text = getIt().userName!; } else { @@ -50,7 +52,8 @@ class _LoginPageState extends ConsumerState { } else { rememberPassword = false; } - if (getIt().passWord != null && getIt().passWord!.isNotEmpty) { + if (getIt().passWord != null && + getIt().passWord!.isNotEmpty) { if (getIt().useSecretLogined) { _cSecretController.text = getIt().passWord!; } else { @@ -115,13 +118,22 @@ class _LoginPageState extends ConsumerState { if (debugBtnIsShow()) { dismissDebugBtn(); } else { - showDebugBtn(context, btnColor: ref.watch(themeProvider).primaryColor); + showDebugBtn(context, + btnColor: ref + .watch(themeProvider) + .primaryColor); } WidgetsBinding.instance?.endOfFrame; }, - child: Image.asset( - "assets/images/ql.png", - height: 45, + child: ColorFiltered( + colorFilter: ColorFilter.mode( + ref.watch(themeProvider).primaryColor, + BlendMode.srcIn, + ), + child: Image.asset( + "assets/images/ql.png", + height: 45, + ), ), ), ], @@ -178,7 +190,8 @@ class _LoginPageState extends ConsumerState { }, controller: _userNameController, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + contentPadding: + EdgeInsets.fromLTRB(0, 5, 0, 5), hintText: "请输入用户名", ), autofocus: false, @@ -200,7 +213,8 @@ class _LoginPageState extends ConsumerState { controller: _passwordController, obscureText: true, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + contentPadding: + EdgeInsets.fromLTRB(0, 5, 0, 5), hintText: "请输入密码", ), autofocus: false, @@ -234,7 +248,8 @@ class _LoginPageState extends ConsumerState { }, controller: _cIdController, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + contentPadding: + EdgeInsets.fromLTRB(0, 5, 0, 5), hintText: "请输入client_id", ), autofocus: false, @@ -256,7 +271,8 @@ class _LoginPageState extends ConsumerState { controller: _cSecretController, obscureText: true, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + contentPadding: + EdgeInsets.fromLTRB(0, 5, 0, 5), hintText: "请输入client_secret", ), autofocus: false, @@ -294,7 +310,8 @@ class _LoginPageState extends ConsumerState { GestureDetector( onTap: () { cardKey.currentState?.toggleCard(); - WidgetsBinding.instance?.addPostFrameCallback((timeStamp) { + WidgetsBinding.instance + ?.addPostFrameCallback((timeStamp) { setState(() {}); }); }, @@ -327,7 +344,12 @@ class _LoginPageState extends ConsumerState { padding: const EdgeInsets.symmetric( vertical: 5, ), - color: canClickLoginBtn() ? ref.watch(themeProvider).primaryColor : ref.watch(themeProvider).primaryColor.withOpacity(0.4), + color: canClickLoginBtn() + ? ref.watch(themeProvider).primaryColor + : ref + .watch(themeProvider) + .primaryColor + .withOpacity(0.4), child: isLoading ? const CupertinoActivityIndicator() : const Text( @@ -339,12 +361,15 @@ class _LoginPageState extends ConsumerState { onPressed: () { Http.pushedLoginPage = false; Utils.hideKeyBoard(context); - getIt().updateHost(_hostController.text); + getIt() + .updateHost(_hostController.text); Http.clear(); if (loginByUserName()) { - login(_userNameController.text, _passwordController.text); + login(_userNameController.text, + _passwordController.text); } else { - login(_cIdController.text, _cSecretController.text); + login(_cIdController.text, + _cSecretController.text); } }, ), @@ -381,7 +406,8 @@ class _LoginPageState extends ConsumerState { loginSuccess(response, userName, password); } else if (loginByUserName() && response.code == 401) { //可能用户使用的是老版本qinglong - HttpResponse oldResponse = await Api.loginOld(userName, password); + HttpResponse oldResponse = + await Api.loginOld(userName, password); if (oldResponse.success) { loginSuccess(oldResponse, userName, password); } else { @@ -412,7 +438,8 @@ class _LoginPageState extends ConsumerState { setState(() {}); } - void loginSuccess(HttpResponse response, String userName, String password) { + void loginSuccess( + HttpResponse response, String userName, String password) { getIt().updateToken(response.bean?.token ?? ""); getIt().useSecretLogin(!loginByUserName()); if (rememberPassword) { @@ -428,9 +455,11 @@ class _LoginPageState extends ConsumerState { if (_hostController.text.isEmpty) return false; if (!loginByUserName()) { - return _cIdController.text.isNotEmpty && _cSecretController.text.isNotEmpty; + return _cIdController.text.isNotEmpty && + _cSecretController.text.isNotEmpty; } else { - return _userNameController.text.isNotEmpty && _passwordController.text.isNotEmpty; + return _userNameController.text.isNotEmpty && + _passwordController.text.isNotEmpty; } } @@ -481,7 +510,8 @@ class _LoginPageState extends ConsumerState { ), onPressed: () async { Navigator.of(context).pop(true); - HttpResponse response = await Api.loginTwo(userName, password, twoFact); + HttpResponse response = + await Api.loginTwo(userName, password, twoFact); if (response.success) { loginSuccess(response, userName, password); } else { @@ -501,7 +531,8 @@ class _LoginPageState extends ConsumerState { void update() async { String? result = await UpdateUtils().checkUpdate(); if (result != null && result.isNotEmpty) { - UpdateDialog updateDialog = UpdateDialog(context, title: "发现新版本", updateContent: "版本号:v${result}", onUpdate: () { + UpdateDialog updateDialog = UpdateDialog(context, + title: "发现新版本", updateContent: "版本号:v${result}", onUpdate: () { UpdateUtils.launchURL(result); }); updateDialog.show(); diff --git a/lib/module/others/other_page.dart b/lib/module/others/other_page.dart index 5386f3b..f85f3ca 100644 --- a/lib/module/others/other_page.dart +++ b/lib/module/others/other_page.dart @@ -59,7 +59,10 @@ class _OtherPageState extends ConsumerState { Text( "脚本管理", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -92,7 +95,10 @@ class _OtherPageState extends ConsumerState { Text( "依赖管理", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -127,7 +133,10 @@ class _OtherPageState extends ConsumerState { Text( "任务日志", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -180,7 +189,10 @@ class _OtherPageState extends ConsumerState { Text( "登录日志", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -221,7 +233,10 @@ class _OtherPageState extends ConsumerState { Text( "修改密码", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -265,7 +280,8 @@ class _OtherPageState extends ConsumerState { Text( "夜间模式", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: + ref.watch(themeProvider).themeColor.titleColor(), fontSize: 16, ), ), @@ -282,6 +298,44 @@ class _OtherPageState extends ConsumerState { const Divider( indent: 15, ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed( + Routes.routeTheme, + ); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 5, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "主题设置", + style: TextStyle( + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), + fontSize: 16, + ), + ), + const Spacer(), + const Icon( + CupertinoIcons.right_chevron, + size: 16, + ), + ], + ), + ), + ), + const Divider( + indent: 15, + ), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -303,7 +357,10 @@ class _OtherPageState extends ConsumerState { Text( "关于", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -362,7 +419,8 @@ class _OtherPageState extends ConsumerState { ), onPressed: () { getIt().updateToken(""); - Navigator.of(context).pushReplacementNamed(Routes.routeLogin); + Navigator.of(context) + .pushReplacementNamed(Routes.routeLogin); }, ), ], diff --git a/lib/module/others/theme_page.dart b/lib/module/others/theme_page.dart new file mode 100644 index 0000000..14f08b8 --- /dev/null +++ b/lib/module/others/theme_page.dart @@ -0,0 +1,475 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:flutter_colorpicker/flutter_colorpicker.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:qinglong_app/base/ql_app_bar.dart'; +import 'package:qinglong_app/base/theme.dart'; + +class ThemePage extends ConsumerStatefulWidget { + const ThemePage({Key? key}) : super(key: key); + + @override + _ThemePageState createState() => _ThemePageState(); +} + +class _ThemePageState extends ConsumerState { + late Color _primaryColor; + List colors = []; + double colorHeight = 40; + double smallColorHeight = 8; + + @override + void initState() { + super.initState(); + _primaryColor = ref.read(themeProvider).primaryColor; + colors.add(const Color(0xFF299343)); + colors.addAll([ + Colors.red, + Colors.pink, + Colors.purple, + Colors.deepPurple, + Colors.indigo, + Colors.blue, + Colors.lightBlue, + Colors.cyan, + Colors.teal, + Colors.green, + Colors.lightGreen, + Colors.lime, + Colors.yellow, + Colors.amber, + Colors.orange, + Colors.deepOrange, + Colors.brown, + Colors.blueGrey, + ]); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xff999999), + appBar: QlAppBar( + title: '主题设置', + canBack: true, + actions: [ + InkWell( + onTap: () { + submit(); + }, + child: const Padding( + padding: EdgeInsets.symmetric( + horizontal: 15, + ), + child: Center( + child: Text( + "保存", + style: TextStyle( + color: Colors.white, + fontSize: 16, + ), + ), + ), + ), + ) + ], + ), + body: Column( + children: [ + const SizedBox( + height: 15, + ), + Expanded( + child: SizedBox( + height: + MediaQuery.of(context).size.height * 3 / 4 - kToolbarHeight, + child: Row( + children: [ + const SizedBox( + width: 20, + ), + Expanded( + child: ClipRRect( + borderRadius: BorderRadius.circular(15), + child: Scaffold( + appBar: AppBar( + backgroundColor: _primaryColor, + title: Text("示例页面"), + elevation: 0, + automaticallyImplyLeading: false, + centerTitle: true, + ), + body: ListView.builder( + itemBuilder: (context, index) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width, + color: index == 0 + ? ref + .watch(themeProvider) + .themeColor + .pinColor() + : Colors.transparent, + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 8, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Random().nextBool() + ? const SizedBox.shrink() + : SizedBox( + width: 15, + height: 15, + child: + CircularProgressIndicator( + strokeWidth: 2, + color: _primaryColor, + ), + ), + SizedBox( + width: Random().nextBool() + ? 0 + : 5, + ), + Expanded( + child: Material( + color: Colors.transparent, + child: Text( + "示例名称", + maxLines: 1, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + overflow: TextOverflow + .ellipsis, + color: ref + .watch( + themeProvider) + .themeColor + .titleColor(), + fontSize: 18, + ), + ), + ), + ), + ], + ), + ), + Material( + color: Colors.transparent, + child: Text( + "上午10:00", + maxLines: 1, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: ref + .watch(themeProvider) + .themeColor + .descColor(), + fontSize: 12, + ), + ), + ), + ], + ), + const SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Random().nextBool() + ? const Icon( + Icons.dnd_forwardslash, + size: 12, + color: Colors.red, + ) + : const SizedBox.shrink(), + const SizedBox( + width: 5, + ), + Material( + color: Colors.transparent, + child: Text( + "10 1-12/2 * * *", + maxLines: 1, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: ref + .watch(themeProvider) + .themeColor + .descColor(), + fontSize: 12, + ), + ), + ), + ], + ), + const SizedBox( + height: 8, + ), + Material( + color: Colors.transparent, + child: Text( + "task raw post.js", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: ref + .watch(themeProvider) + .themeColor + .descColor(), + fontSize: 12, + ), + ), + ), + ], + ), + ), + const Divider( + height: 1, + indent: 15, + ), + ], + ); + }, + itemCount: 100, + ), + ), + ), + ), + const SizedBox( + width: 20, + ), + ], + ), + ), + ), + const SizedBox( + height: 15, + ), + Container( + margin: const EdgeInsets.symmetric( + horizontal: 15, + ), + height: colorHeight + 20, + padding: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + ), + child: ListView.separated( + physics: BouncingScrollPhysics(), + padding: const EdgeInsets.symmetric( + horizontal: 15, + ), + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) { + if (index == 0) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + pickColor(); + }, + child: SizedBox( + width: colorHeight, + height: colorHeight, + child: Stack( + children: [ + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[0], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: 0, + top: colorHeight / 4 - smallColorHeight / 2, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[1], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: 0, + bottom: colorHeight / 4 - smallColorHeight / 2, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[2], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: colorHeight / 2 - smallColorHeight / 2, + top: 0, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[3], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + right: 0, + top: colorHeight / 4 - smallColorHeight / 2, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[4], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + right: 0, + bottom: colorHeight / 4 - smallColorHeight / 2, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[5], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: colorHeight / 2 - smallColorHeight / 2, + bottom: 0, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[6], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: colorHeight / 2 - smallColorHeight / 2, + bottom: 0, + ), + Positioned( + child: Container( + width: smallColorHeight, + height: smallColorHeight, + decoration: BoxDecoration( + color: colors[7], + borderRadius: + BorderRadius.circular(smallColorHeight), + ), + ), + left: colorHeight / 2 - smallColorHeight / 2, + bottom: colorHeight / 2 - smallColorHeight / 2, + ), + ], + ), + ), + ); + } else { + index = index - 1; + + return GestureDetector( + onTap: () { + _primaryColor = colors[index]; + setState(() {}); + }, + child: SizedBox( + width: colorHeight, + height: colorHeight, + child: Container( + decoration: BoxDecoration( + color: colors[index], + borderRadius: BorderRadius.circular(colorHeight), + ), + ), + ), + ); + } + }, + itemCount: colors.length + 1, + separatorBuilder: (BuildContext context, int index) { + return const SizedBox( + width: 15, + ); + }, + ), + ), + ], + ), + ); + } + + void pickColor() { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + titlePadding: const EdgeInsets.all(0), + contentPadding: const EdgeInsets.all(0), + content: SingleChildScrollView( + child: ColorPicker( + pickerColor: _primaryColor, + onColorChanged: (color) { + _primaryColor = color; + setState(() {}); + }, + colorPickerWidth: 300, + pickerAreaHeightPercent: 0.7, + enableAlpha: false, + pickerAreaBorderRadius: const BorderRadius.only( + topLeft: Radius.circular(2), + topRight: Radius.circular(2), + ), + hexInputBar: false, + ), + ), + ); + }, + ); + } + + void submit() { + ref.read(themeProvider).changePrimaryColor(_primaryColor); + Navigator.of(context).pop(); + } +} diff --git a/lib/module/task/task_page.dart b/lib/module/task/task_page.dart index 870ed49..3698cc4 100644 --- a/lib/module/task/task_page.dart +++ b/lib/module/task/task_page.dart @@ -102,9 +102,17 @@ class _TaskPageState extends State { TaskBean item = list[index]; if (_searchController.text.isEmpty || - (item.name?.toLowerCase().contains(_searchController.text.toLowerCase()) ?? false) || - (item.command?.toLowerCase().contains(_searchController.text.toLowerCase()) ?? false) || - (item.schedule?.contains(_searchController.text.toLowerCase()) ?? false)) { + (item.name + ?.toLowerCase() + .contains(_searchController.text.toLowerCase()) ?? + false) || + (item.command + ?.toLowerCase() + .contains(_searchController.text.toLowerCase()) ?? + false) || + (item.schedule + ?.contains(_searchController.text.toLowerCase()) ?? + false)) { return TaskItemCell(item, ref); } else { return const SizedBox.shrink(); @@ -175,7 +183,9 @@ class TaskItemCell extends StatelessWidget { child: Text( bean.status! == 1 ? "运行" : "停止运行", ), - trailingIcon: bean.status! == 1 ? CupertinoIcons.memories : CupertinoIcons.stop_circle, + trailingIcon: bean.status! == 1 + ? CupertinoIcons.memories + : CupertinoIcons.stop_circle, onPressed: () { Navigator.of(context).pop(); if (bean.status! == 1) { @@ -197,7 +207,8 @@ class TaskItemCell extends StatelessWidget { child: const Text("编辑"), onPressed: () { Navigator.of(context).pop(); - Navigator.of(context).pushNamed(Routes.routeAddTask, arguments: bean); + Navigator.of(context) + .pushNamed(Routes.routeAddTask, arguments: bean); }, trailingIcon: CupertinoIcons.pencil_outline, ), @@ -207,7 +218,9 @@ class TaskItemCell extends StatelessWidget { Navigator.of(context).pop(); pinTask(); }, - trailingIcon: bean.isPinned! == 0 ? CupertinoIcons.pin : CupertinoIcons.pin_slash, + trailingIcon: bean.isPinned! == 0 + ? CupertinoIcons.pin + : CupertinoIcons.pin_slash, ), QLCupertinoContextMenuAction( child: Text(bean.isDisabled! == 0 ? "禁用" : "启用"), @@ -216,7 +229,9 @@ class TaskItemCell extends StatelessWidget { enableTask(); }, isDestructiveAction: true, - trailingIcon: bean.isDisabled! == 0 ? Icons.dnd_forwardslash : Icons.check_circle_outline_sharp, + trailingIcon: bean.isDisabled! == 0 + ? Icons.dnd_forwardslash + : Icons.check_circle_outline_sharp, ), QLCupertinoContextMenuAction( child: const Text("删除"), @@ -233,7 +248,9 @@ class TaskItemCell extends StatelessWidget { return ClipRRect( borderRadius: BorderRadius.circular(15), child: Container( - color: isDark ? const Color(0xff333333) : Theme.of(context).scaffoldBackgroundColor, + color: isDark + ? const Color(0xff333333) + : Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.only( left: 5, right: 5, @@ -256,7 +273,9 @@ class TaskItemCell extends StatelessWidget { children: [ Container( width: MediaQuery.of(context).size.width, - color: bean.isPinned == 1 ? ref.watch(themeProvider).themeColor.pinColor() : Colors.transparent, + color: bean.isPinned == 1 + ? ref.watch(themeProvider).themeColor.pinColor() + : Colors.transparent, padding: const EdgeInsets.symmetric( horizontal: 15, vertical: 8, @@ -276,11 +295,13 @@ class TaskItemCell extends StatelessWidget { children: [ bean.status == 1 ? const SizedBox.shrink() - : const SizedBox( + : SizedBox( width: 15, height: 15, child: CircularProgressIndicator( strokeWidth: 2, + color: + ref.watch(themeProvider).primaryColor, ), ), SizedBox( @@ -295,7 +316,10 @@ class TaskItemCell extends StatelessWidget { overflow: TextOverflow.ellipsis, style: TextStyle( overflow: TextOverflow.ellipsis, - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 18, ), ), @@ -307,11 +331,16 @@ class TaskItemCell extends StatelessWidget { Material( color: Colors.transparent, child: Text( - (bean.lastExecutionTime == null || bean.lastExecutionTime == 0) ? "-" : Utils.formatMessageTime(bean.lastExecutionTime!), + (bean.lastExecutionTime == null || + bean.lastExecutionTime == 0) + ? "-" + : Utils.formatMessageTime( + bean.lastExecutionTime!), maxLines: 1, style: TextStyle( overflow: TextOverflow.ellipsis, - color: ref.watch(themeProvider).themeColor.descColor(), + color: + ref.watch(themeProvider).themeColor.descColor(), fontSize: 12, ), ), @@ -341,7 +370,8 @@ class TaskItemCell extends StatelessWidget { maxLines: 1, style: TextStyle( overflow: TextOverflow.ellipsis, - color: ref.watch(themeProvider).themeColor.descColor(), + color: + ref.watch(themeProvider).themeColor.descColor(), fontSize: 12, ), ), diff --git a/pubspec.lock b/pubspec.lock index 32253ba..f722a25 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,245 +5,245 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "22.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.7.2" archive: dependency: transitive description: name: archive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.8" + version: "3.1.9" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.8.2" back_button_interceptor: dependency: "direct main" description: name: back_button_interceptor - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" build: dependency: transitive description: name: build - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "8.1.4" change_app_package_name: dependency: "direct dev" description: name: change_app_package_name - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.3" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.4" dio_log: dependency: "direct main" description: name: dio_log - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" drag_and_drop_lists: dependency: "direct main" description: name: drag_and_drop_lists - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.2+2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" flip_card: dependency: "direct main" description: name: flip_card - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.0" flutter: @@ -255,49 +255,56 @@ packages: dependency: "direct dev" description: name: flutter_app_name - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.1" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" flutter_highlight: dependency: "direct main" description: name: flutter_highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" flutter_launcher_icons: dependency: "direct dev" description: name: flutter_launcher_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.2" flutter_lints: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" flutter_native_splash: dependency: "direct dev" description: name: flutter_native_splash - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.3" flutter_riverpod: dependency: "direct main" description: name: flutter_riverpod - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" flutter_test: @@ -314,371 +321,371 @@ packages: dependency: "direct main" description: name: fluttertoast - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "8.0.8" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.2" get_it: dependency: "direct main" description: name: get_it - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" highlight: dependency: transitive description: name: highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" http: dependency: transitive description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" image: dependency: transitive description: name: image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" json_conversion: dependency: "direct dev" description: name: json_conversion - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.4" json_conversion_annotation: dependency: "direct main" description: name: json_conversion_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.4" lints: dependency: transitive description: name: lints - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" logger: dependency: "direct main" description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" logging: dependency: transitive description: name: logging - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.11" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" move_to_background: dependency: "direct main" description: name: move_to_background - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info_plus: dependency: "direct main" description: name: package_info_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.1" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.2" pool: dependency: transitive description: name: pool - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.0" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.4" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" riverpod: dependency: transitive description: name: riverpod - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.12" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.10" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.9" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" shelf: dependency: transitive description: name: shelf - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" sky_engine: @@ -690,196 +697,196 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" state_notifier: dependency: transitive description: name: state_notifier - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.2+1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: "direct main" description: name: synchronized - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.3" timing: dependency: transitive description: name: timing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.18" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.14" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.14" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" watcher: dependency: transitive description: name: watcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.6" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.3.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 3df434f..4897f1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: flip_card: ^0.6.0 package_info_plus: ^1.3.0 url_launcher: ^6.0.18 + flutter_colorpicker: ^1.0.3 dev_dependencies: flutter_native_splash: ^1.3.3 diff --git a/screen.png b/screen.png new file mode 100644 index 0000000..e69de29