add theme color
@@ -43,8 +43,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.example.qinglong_app"
|
applicationId "work.master.qinglongapp"
|
||||||
minSdkVersion flutter.minSdkVersion
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.qinglong_app">
|
package="work.master.qinglongapp">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.qinglong_app">
|
package="work.master.qinglongapp">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<application
|
<application
|
||||||
android:label="qinglong_app"
|
android:label="青龙"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.qinglong_app
|
package work.master.qinglongapp
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 79 KiB |
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.qinglong_app">
|
package="work.master.qinglongapp">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
|||||||
BIN
assets/images/login_bg.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
assets/images/login_tip.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -478,4 +478,4 @@
|
|||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
};
|
};
|
||||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 62 KiB |
@@ -13,7 +13,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>qinglong_app</string>
|
<string>青龙</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel());
|
var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel());
|
||||||
|
const Color _primaryColor = Color(0xFF299343);
|
||||||
|
|
||||||
class ThemeViewModel extends ChangeNotifier {
|
class ThemeViewModel extends ChangeNotifier {
|
||||||
ThemeData currentTheme = lightTheme;
|
ThemeData currentTheme = lightTheme;
|
||||||
@@ -25,8 +26,29 @@ ThemeData darkTheme = ThemeData.dark().copyWith(
|
|||||||
primaryColor: const Color(0xffffffff),
|
primaryColor: const Color(0xffffffff),
|
||||||
);
|
);
|
||||||
ThemeData lightTheme = ThemeData.light().copyWith(
|
ThemeData lightTheme = ThemeData.light().copyWith(
|
||||||
primaryColor: const Color(0xFF0F77FE),
|
primaryColor: _primaryColor,
|
||||||
scaffoldBackgroundColor: Colors.white,
|
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 {
|
abstract class ThemeColors {
|
||||||
@@ -67,6 +89,6 @@ class DartThemeColors extends ThemeColors {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Color pinColor() {
|
Color pinColor() {
|
||||||
return Colors.black12;
|
return Colors.black12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,13 @@ class _ConfigPageState extends State<ConfigPage> {
|
|||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
CupertinoButton(
|
CupertinoButton(
|
||||||
child: const Text("编辑"),
|
child: Text(
|
||||||
|
"编辑",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pushNamed(Routes.route_ConfigEdit, arguments: {
|
Navigator.of(context).pushNamed(Routes.route_ConfigEdit, arguments: {
|
||||||
"title": model.title,
|
"title": model.title,
|
||||||
|
|||||||
@@ -44,168 +44,170 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
child: SingleChildScrollView(
|
child: Stack(
|
||||||
child: Column(
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
Positioned(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
bottom: 0,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Image.asset(
|
||||||
children: [
|
"assets/images/login_bg.png",
|
||||||
SizedBox(
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height / 6,
|
|
||||||
),
|
),
|
||||||
Image.asset(
|
),
|
||||||
"assets/images/ql.png",
|
SingleChildScrollView(
|
||||||
width: 60,
|
child: Padding(
|
||||||
height: 60,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 15,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"青龙控制面板",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: MediaQuery.of(context).size.height / 10,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 15,
|
horizontal: 40,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(
|
SizedBox(
|
||||||
child: Text(
|
height: MediaQuery.of(context).size.height / 6,
|
||||||
"域名:",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
width: 60,
|
|
||||||
),
|
),
|
||||||
const SizedBox(
|
SizedBox(
|
||||||
width: 15,
|
height: 50,
|
||||||
),
|
width: MediaQuery.of(context).size.width,
|
||||||
Expanded(
|
child: Stack(
|
||||||
child: TextField(
|
children: [
|
||||||
onChanged: (_) {
|
Positioned(
|
||||||
setState(() {});
|
top: 0,
|
||||||
},
|
left: 40,
|
||||||
controller: _hostController,
|
child: Image.asset(
|
||||||
decoration: const InputDecoration(
|
"assets/images/login_tip.png",
|
||||||
contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5),
|
height: 45,
|
||||||
hintText: "http://1.1.1.1:5700",
|
),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
const Positioned(
|
||||||
),
|
top: 10,
|
||||||
),
|
left: 40,
|
||||||
],
|
child: Text(
|
||||||
),
|
|
||||||
),
|
|
||||||
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(
|
|
||||||
"登录",
|
"登录",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 30,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
),
|
||||||
Utils.hideKeyBoard(context);
|
Positioned(
|
||||||
userInfoViewModel.updateHost(_hostController.text);
|
top: 5,
|
||||||
model.login(_userNameController.text, _passwordController.text);
|
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);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
|||||||
"名称:",
|
"名称:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
@@ -115,7 +115,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
|||||||
"命令:",
|
"命令:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
@@ -149,7 +149,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
|||||||
"定时:",
|
"定时:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class _TaskPageState extends State<TaskPage> {
|
|||||||
return BaseStateWidget<TaskViewModel>(
|
return BaseStateWidget<TaskViewModel>(
|
||||||
builder: (ref, model, child) {
|
builder: (ref, model, child) {
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
return model.loadData(false);
|
return model.loadData(false);
|
||||||
},
|
},
|
||||||
@@ -106,90 +107,108 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Slidable(
|
return Column(
|
||||||
key: const ValueKey(0),
|
mainAxisSize: MainAxisSize.min,
|
||||||
startActionPane: ActionPane(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
motion: const ScrollMotion(),
|
children: [
|
||||||
extentRatio: 0.3,
|
Slidable(
|
||||||
dragDismissible: false,
|
key: const ValueKey(0),
|
||||||
children: [
|
startActionPane: ActionPane(
|
||||||
SlidableAction(
|
motion: const ScrollMotion(),
|
||||||
flex: 1,
|
extentRatio: 0.3,
|
||||||
icon: bean.status == 0 ? CupertinoIcons.stop_circle : CupertinoIcons.memories,
|
dragDismissible: false,
|
||||||
foregroundColor: Colors.white,
|
children: [
|
||||||
backgroundColor: const Color(0xFF0F77FE),
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
flex: 1,
|
||||||
if (bean.status == 0) {
|
icon: bean.status == 0 ? CupertinoIcons.stop_circle : CupertinoIcons.memories,
|
||||||
stopCron(context, ref);
|
foregroundColor: Colors.white,
|
||||||
} else {
|
backgroundColor: const Color(0xFF0F77FE),
|
||||||
startCron(context, ref);
|
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(
|
endActionPane: ActionPane(
|
||||||
flex: 1,
|
motion: const ScrollMotion(),
|
||||||
backgroundColor: Colors.green,
|
extentRatio: 0.15,
|
||||||
foregroundColor: Colors.white,
|
children: [
|
||||||
icon: CupertinoIcons.clock_fill,
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
backgroundColor: Colors.cyan,
|
||||||
logCron(context, ref);
|
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,
|
||||||
endActionPane: ActionPane(
|
padding: const EdgeInsets.symmetric(
|
||||||
motion: const ScrollMotion(),
|
horizontal: 15,
|
||||||
extentRatio: 0.15,
|
vertical: 8,
|
||||||
children: [
|
),
|
||||||
SlidableAction(
|
child: Column(
|
||||||
backgroundColor: Colors.cyan,
|
mainAxisSize: MainAxisSize.min,
|
||||||
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(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Row(
|
||||||
bean.name ?? "",
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
maxLines: 1,
|
children: [
|
||||||
style: TextStyle(
|
Text(
|
||||||
overflow: TextOverflow.ellipsis,
|
bean.name ?? "",
|
||||||
color: bean.isDisabled == 1 ? Color(0xffF85152) : ref.watch(themeProvider).themeColor.taskTitleColor(),
|
maxLines: 1,
|
||||||
fontSize: 18,
|
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(
|
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(
|
Text(
|
||||||
(bean.lastExecutionTime == null || bean.lastExecutionTime == 0) ? "-" : Utils.formatMessageTime(bean.lastExecutionTime!),
|
bean.schedule ?? "",
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
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,),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
list.sort((a, b) {
|
list.sort((a, b) {
|
||||||
return a.status!.compareTo(b.status!);
|
return a.status!.compareTo(b.status!);
|
||||||
});
|
});
|
||||||
list.sort((a, b) {
|
|
||||||
return b.isPinned!.compareTo(a.isPinned!);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> runCrons(String cron) async {
|
Future<void> runCrons(String cron) async {
|
||||||
|
|||||||
23
pubspec.lock
@@ -106,6 +106,13 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.3"
|
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:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -237,6 +244,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
flutter_highlight:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -244,6 +258,13 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
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:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -252,7 +273,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
flutter_native_splash:
|
flutter_native_splash:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_native_splash
|
name: flutter_native_splash
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
|
|||||||
16
pubspec.yaml
@@ -23,8 +23,13 @@ dependencies:
|
|||||||
logger: ^1.1.0
|
logger: ^1.1.0
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
code_editor: ^1.3.1
|
code_editor: ^1.3.1
|
||||||
flutter_native_splash: ^1.3.3
|
|
||||||
dev_dependencies:
|
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
|
build_runner: ^2.0.0
|
||||||
json_conversion: ^0.0.4
|
json_conversion: ^0.0.4
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -39,6 +44,15 @@ flutter:
|
|||||||
|
|
||||||
assets:
|
assets:
|
||||||
- assets/images/
|
- 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:
|
flutter_native_splash:
|
||||||
|
|
||||||
|
|||||||