diff --git a/android/app/build.gradle b/android/app/build.gradle index 84de091..fab8b94 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -43,8 +43,8 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.qinglong_app" - minSdkVersion flutter.minSdkVersion + applicationId "work.master.qinglongapp" + minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index c53e71f..dab2770 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="work.master.qinglongapp"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d5f9a14..c3ce2d5 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,9 @@ + package="work.master.qinglongapp"> + + + package="work.master.qinglongapp"> diff --git a/assets/images/login_bg.png b/assets/images/login_bg.png new file mode 100644 index 0000000..20f1d39 Binary files /dev/null and b/assets/images/login_bg.png differ diff --git a/assets/images/login_tip.png b/assets/images/login_tip.png new file mode 100644 index 0000000..4ca3867 Binary files /dev/null and b/assets/images/login_tip.png differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 947e850..80203a9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -478,4 +478,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..28ff6df 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf0..33a04db 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd9..ce46f07 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b..97265ff 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde121..7666074 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e..ae78225 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc230..ca2b6f0 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd9..ce46f07 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8..a7774e9 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b86..814a504 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b86..814a504 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d16..ec68201 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d..85b65dd 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41..afbdaa3 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f58..eb4db7c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index a574bde..e84ff88 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - qinglong_app + 青龙 CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/base/theme.dart b/lib/base/theme.dart index fb46a35..54c96ff 100644 --- a/lib/base/theme.dart +++ b/lib/base/theme.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel()); +const Color _primaryColor = Color(0xFF299343); class ThemeViewModel extends ChangeNotifier { ThemeData currentTheme = lightTheme; @@ -25,8 +26,29 @@ ThemeData darkTheme = ThemeData.dark().copyWith( primaryColor: const Color(0xffffffff), ); ThemeData lightTheme = ThemeData.light().copyWith( - primaryColor: const Color(0xFF0F77FE), + primaryColor: _primaryColor, scaffoldBackgroundColor: Colors.white, + inputDecorationTheme: const InputDecorationTheme( + labelStyle: TextStyle(color: _primaryColor), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: _primaryColor, + ), + ), + ), + appBarTheme: const AppBarTheme( + backgroundColor: _primaryColor, + ), + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + selectedItemColor: _primaryColor, + ), + buttonTheme: const ButtonThemeData( + buttonColor: _primaryColor, + ), + progressIndicatorTheme: const ProgressIndicatorThemeData( + color: _primaryColor, + ), + ); abstract class ThemeColors { @@ -67,6 +89,6 @@ class DartThemeColors extends ThemeColors { @override Color pinColor() { - return Colors.black12; + return Colors.black12; } } diff --git a/lib/module/config/config_page.dart b/lib/module/config/config_page.dart index 751747e..0da5724 100644 --- a/lib/module/config/config_page.dart +++ b/lib/module/config/config_page.dart @@ -57,7 +57,13 @@ class _ConfigPageState extends State { ), const Spacer(), CupertinoButton( - child: const Text("编辑"), + child: Text( + "编辑", + style: TextStyle( + color: Theme.of(context).primaryColor, + fontSize: 16, + ), + ), onPressed: () { Navigator.of(context).pushNamed(Routes.route_ConfigEdit, arguments: { "title": model.title, diff --git a/lib/module/login/login_page.dart b/lib/module/login/login_page.dart index 3ec3a82..00eb914 100644 --- a/lib/module/login/login_page.dart +++ b/lib/module/login/login_page.dart @@ -44,168 +44,170 @@ class _LoginPageState extends State { } return SizedBox( height: MediaQuery.of(context).size.height, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: MediaQuery.of(context).size.height / 6, + child: Stack( + children: [ + Positioned( + bottom: 0, + child: Image.asset( + "assets/images/login_bg.png", + width: MediaQuery.of(context).size.width, ), - Image.asset( - "assets/images/ql.png", - width: 60, - height: 60, - ), - SizedBox( - height: 15, - ), - Text( - "青龙控制面板", - style: TextStyle( - fontSize: 16, - ), - ), - SizedBox( - height: MediaQuery.of(context).size.height / 10, - ), - Padding( + ), + SingleChildScrollView( + child: Padding( padding: const EdgeInsets.symmetric( - horizontal: 15, + horizontal: 40, ), - child: Row( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - child: Text( - "域名:", - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - width: 60, + SizedBox( + height: MediaQuery.of(context).size.height / 6, ), - const SizedBox( - width: 15, - ), - Expanded( - child: TextField( - onChanged: (_) { - setState(() {}); - }, - controller: _hostController, - decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), - hintText: "http://1.1.1.1:5700", - ), - autofocus: false, - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 15, - ), - child: Row( - children: [ - const SizedBox( - child: Text( - "用户名:", - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - width: 60, - ), - const SizedBox( - width: 15, - ), - Expanded( - child: TextField( - onChanged: (_) { - setState(() {}); - }, - controller: _userNameController, - decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), - hintText: "请输入用户名", - ), - autofocus: false, - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 15, - vertical: 10, - ), - child: Row( - children: [ - const SizedBox( - child: Text( - "密码:", - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - width: 60, - ), - const SizedBox( - width: 15, - ), - Expanded( - child: TextField( - onChanged: (_) { - setState(() {}); - }, - controller: _passwordController, - obscureText: true, - decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), - hintText: "请输入密码", - ), - autofocus: false, - ), - ), - ], - ), - ), - const SizedBox( - height: 30, - ), - SizedBox( - width: MediaQuery.of(context).size.width - 30, - child: IgnorePointer( - ignoring: _hostController.text.isEmpty || _userNameController.text.isEmpty || _passwordController.text.isEmpty || model.isLoading, - child: CupertinoButton( - color: - (_hostController.text.isNotEmpty && _userNameController.text.isNotEmpty && _passwordController.text.isNotEmpty && !model.isLoading) - ? Theme.of(context).primaryColor - : Theme.of(context).primaryColor.withOpacity(0.4), - child: model.isLoading - ? const CupertinoActivityIndicator() - : const Text( + SizedBox( + height: 50, + width: MediaQuery.of(context).size.width, + child: Stack( + children: [ + Positioned( + top: 0, + left: 40, + child: Image.asset( + "assets/images/login_tip.png", + height: 45, + ), + ), + const Positioned( + top: 10, + left: 40, + child: Text( "登录", style: TextStyle( - fontSize: 16, + fontSize: 30, + fontWeight: FontWeight.bold, ), ), - onPressed: () { - Utils.hideKeyBoard(context); - userInfoViewModel.updateHost(_hostController.text); - model.login(_userNameController.text, _passwordController.text); - }), + ), + Positioned( + top: 5, + right: 40, + child: Image.asset( + "assets/images/ql.png", + height: 45, + ), + ), + ], + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height / 10, + ), + const Text( + "域名:", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox( + height: 10, + ), + TextField( + onChanged: (_) { + setState(() {}); + }, + controller: _hostController, + decoration: const InputDecoration( + contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + hintText: "http://1.1.1.1:5700", + ), + autofocus: false, + ), + const SizedBox( + height: 20, + ), + const Text( + "用户名:", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox( + height: 10, + ), + TextField( + onChanged: (_) { + setState(() {}); + }, + controller: _userNameController, + decoration: const InputDecoration( + contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + hintText: "请输入用户名", + ), + autofocus: false, + ), + const SizedBox( + height: 20, + ), + const Text( + "密码:", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox( + height: 10, + ), + TextField( + onChanged: (_) { + setState(() {}); + }, + controller: _passwordController, + obscureText: true, + decoration: const InputDecoration( + contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5), + hintText: "请输入密码", + ), + autofocus: false, + ), + const SizedBox( + height: 30, + ), + SizedBox( + width: MediaQuery.of(context).size.width - 80, + child: IgnorePointer( + ignoring: _hostController.text.isEmpty || _userNameController.text.isEmpty || _passwordController.text.isEmpty || model.isLoading, + child: CupertinoButton( + color: (_hostController.text.isNotEmpty && + _userNameController.text.isNotEmpty && + _passwordController.text.isNotEmpty && + !model.isLoading) + ? Theme.of(context).primaryColor + : Theme.of(context).primaryColor.withOpacity(0.4), + child: model.isLoading + ? const CupertinoActivityIndicator() + : const Text( + "登 录", + style: TextStyle( + fontSize: 16, + ), + ), + onPressed: () { + Utils.hideKeyBoard(context); + userInfoViewModel.updateHost(_hostController.text); + model.login(_userNameController.text, _passwordController.text); + }), + ), + ), + ], ), ), - ], - ), + ), + + ], ), ); }), diff --git a/lib/module/task/add_task_page.dart b/lib/module/task/add_task_page.dart index dd11c29..32489df 100644 --- a/lib/module/task/add_task_page.dart +++ b/lib/module/task/add_task_page.dart @@ -83,7 +83,7 @@ class _AddTaskPageState extends ConsumerState { "名称:", style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, ), ), const SizedBox( @@ -115,7 +115,7 @@ class _AddTaskPageState extends ConsumerState { "命令:", style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, ), ), const SizedBox( @@ -149,7 +149,7 @@ class _AddTaskPageState extends ConsumerState { "定时:", style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, ), ), const SizedBox( diff --git a/lib/module/task/task_page.dart b/lib/module/task/task_page.dart index 9f6c02f..2efba9a 100644 --- a/lib/module/task/task_page.dart +++ b/lib/module/task/task_page.dart @@ -31,6 +31,7 @@ class _TaskPageState extends State { return BaseStateWidget( builder: (ref, model, child) { return RefreshIndicator( + color: Theme.of(context).primaryColor, onRefresh: () async { return model.loadData(false); }, @@ -106,90 +107,108 @@ class TaskItemCell extends StatelessWidget { @override Widget build(BuildContext context) { - return Slidable( - key: const ValueKey(0), - startActionPane: ActionPane( - motion: const ScrollMotion(), - extentRatio: 0.3, - dragDismissible: false, - children: [ - SlidableAction( - flex: 1, - icon: bean.status == 0 ? CupertinoIcons.stop_circle : CupertinoIcons.memories, - foregroundColor: Colors.white, - backgroundColor: const Color(0xFF0F77FE), - onPressed: (BuildContext context) { - if (bean.status == 0) { - stopCron(context, ref); - } else { - startCron(context, ref); - } - }, + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Slidable( + key: const ValueKey(0), + startActionPane: ActionPane( + motion: const ScrollMotion(), + extentRatio: 0.3, + dragDismissible: false, + children: [ + SlidableAction( + flex: 1, + icon: bean.status == 0 ? CupertinoIcons.stop_circle : CupertinoIcons.memories, + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF0F77FE), + onPressed: (BuildContext context) { + if (bean.status == 0) { + stopCron(context, ref); + } else { + startCron(context, ref); + } + }, + ), + SlidableAction( + flex: 1, + backgroundColor: Colors.green, + foregroundColor: Colors.white, + icon: CupertinoIcons.clock_fill, + onPressed: (BuildContext context) { + logCron(context, ref); + }, + ), + ], ), - SlidableAction( - flex: 1, - backgroundColor: Colors.green, - foregroundColor: Colors.white, - icon: CupertinoIcons.clock_fill, - onPressed: (BuildContext context) { - logCron(context, ref); - }, + endActionPane: ActionPane( + motion: const ScrollMotion(), + extentRatio: 0.15, + children: [ + SlidableAction( + backgroundColor: Colors.cyan, + flex: 1, + onPressed: (_) { + more(context, ref); + }, + foregroundColor: Colors.white, + icon: CupertinoIcons.ellipsis, + ), + ], ), - ], - ), - endActionPane: ActionPane( - motion: const ScrollMotion(), - extentRatio: 0.15, - children: [ - SlidableAction( - backgroundColor: Colors.cyan, - flex: 1, - onPressed: (_) { - more(context, ref); - }, - foregroundColor: Colors.white, - icon: CupertinoIcons.ellipsis, - ), - ], - ), - child: Container( - color: bean.isPinned == 1 ? 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( + child: Container( + color: bean.isPinned == 1 ? 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: [ - Text( - bean.name ?? "", - maxLines: 1, - style: TextStyle( - overflow: TextOverflow.ellipsis, - color: bean.isDisabled == 1 ? Color(0xffF85152) : ref.watch(themeProvider).themeColor.taskTitleColor(), - fontSize: 18, - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + bean.name ?? "", + maxLines: 1, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: bean.isDisabled == 1 ? Color(0xffF85152) : ref.watch(themeProvider).themeColor.taskTitleColor(), + fontSize: 18, + ), + ), + const SizedBox( + width: 5, + ), + bean.status == 1 + ? const SizedBox.shrink() + : const SizedBox( + width: 15, + height: 15, + child: CircularProgressIndicator( + strokeWidth: 2, + ), + ), + const Spacer(), + Text( + (bean.lastExecutionTime == null || bean.lastExecutionTime == 0) ? "-" : Utils.formatMessageTime(bean.lastExecutionTime!), + maxLines: 1, + style: const TextStyle( + overflow: TextOverflow.ellipsis, + color: Color(0xff999999), + fontSize: 12, + ), + ), + ], ), const SizedBox( - width: 5, + height: 8, ), - bean.status == 1 - ? const SizedBox.shrink() - : const SizedBox( - width: 15, - height: 15, - child: CircularProgressIndicator( - strokeWidth: 2, - ), - ), - const Spacer(), Text( - (bean.lastExecutionTime == null || bean.lastExecutionTime == 0) ? "-" : Utils.formatMessageTime(bean.lastExecutionTime!), + bean.schedule ?? "", maxLines: 1, style: const TextStyle( overflow: TextOverflow.ellipsis, @@ -199,21 +218,10 @@ class TaskItemCell extends StatelessWidget { ), ], ), - const SizedBox( - height: 8, - ), - Text( - bean.schedule ?? "", - maxLines: 1, - style: const TextStyle( - overflow: TextOverflow.ellipsis, - color: Color(0xff999999), - fontSize: 12, - ), - ), - ], + ), ), - ), + const Divider(height: 1,indent: 15,), + ], ); } diff --git a/lib/module/task/task_viewmodel.dart b/lib/module/task/task_viewmodel.dart index cddbe08..9630204 100644 --- a/lib/module/task/task_viewmodel.dart +++ b/lib/module/task/task_viewmodel.dart @@ -38,9 +38,7 @@ class TaskViewModel extends BaseViewModel { list.sort((a, b) { return a.status!.compareTo(b.status!); }); - list.sort((a, b) { - return b.isPinned!.compareTo(a.isPinned!); - }); + } Future runCrons(String cron) async { diff --git a/pubspec.lock b/pubspec.lock index 8761f6e..207a330 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -106,6 +106,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "8.1.3" + change_app_package_name: + dependency: "direct dev" + description: + name: change_app_package_name + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.3" characters: dependency: transitive description: @@ -237,6 +244,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_app_name: + dependency: "direct dev" + description: + name: flutter_app_name + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.1" flutter_highlight: dependency: transitive description: @@ -244,6 +258,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.2" flutter_lints: dependency: "direct dev" description: @@ -252,7 +273,7 @@ packages: source: hosted version: "1.0.4" flutter_native_splash: - dependency: "direct main" + dependency: "direct dev" description: name: flutter_native_splash url: "https://pub.flutter-io.cn" diff --git a/pubspec.yaml b/pubspec.yaml index 18ff5fe..e738523 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,8 +23,13 @@ dependencies: logger: ^1.1.0 intl: ^0.17.0 code_editor: ^1.3.1 - flutter_native_splash: ^1.3.3 + dev_dependencies: + flutter_native_splash: ^1.3.3 + flutter_launcher_icons: ^0.9.2 + change_app_package_name: ^0.1.3 + flutter_app_name: ^0.1.0 + build_runner: ^2.0.0 json_conversion: ^0.0.4 flutter_test: @@ -39,6 +44,15 @@ flutter: assets: - assets/images/ +flutter_app_name: + name: "青龙" + +flutter_icons: + image_path_android: "assets/images/ql.png" + image_path_ios: "assets/images/ql.png" + android: true # can specify file name here e.g. "ic_launcher" + ios: true # can specify file name here e.g. "My-Launcher-Icon" + flutter_native_splash: