mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
Add check update btn in setting
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ToolBox";
|
||||
static const int build = 58;
|
||||
static const int build = 59;
|
||||
static const String engine = "Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 18116933e7 (3 weeks ago) • 2021-10-15 10:46:35 -0700\nEngine • revision d3ea636dc5\nTools • Dart 2.14.4\n";
|
||||
static const String buildAt = "2021-11-02 19:44:10.383544";
|
||||
static const String buildAt = "2021-11-02 20:31:21.141578";
|
||||
static const int modifications = 4;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_color_picker/flutter_material_color_picker.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:toolbox/core/update.dart';
|
||||
import 'package:toolbox/data/provider/app.dart';
|
||||
import 'package:toolbox/data/res/build_data.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
@@ -40,9 +44,33 @@ class _SettingPageState extends State<SettingPage> {
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(17),
|
||||
children: [
|
||||
RoundRectCard(_buildAppColorPreview()),
|
||||
RoundRectCard(
|
||||
ExpansionTile(
|
||||
_buildAppColorPreview(),
|
||||
_buildUpdateInterval(),
|
||||
_buildCheckUpdate()
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCheckUpdate() {
|
||||
return Consumer<AppProvider>(builder: (_, app, __) {
|
||||
String display;
|
||||
if (app.newestBuild != null) {
|
||||
if (app.newestBuild! > BuildData.build) {
|
||||
display = '发现新版本:${app.newestBuild}';
|
||||
} else {
|
||||
display = '当前版本:${BuildData.build},已是最新';
|
||||
}
|
||||
} else {
|
||||
display = '当前版本:${BuildData.build},点击检查更新';
|
||||
}
|
||||
return ListTile(
|
||||
title: Text(display), onTap: () => doUpdate(context, force: true));
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildUpdateInterval() {
|
||||
return ExpansionTile(
|
||||
tilePadding: EdgeInsets.zero,
|
||||
childrenPadding: EdgeInsets.zero,
|
||||
textColor: priColor,
|
||||
@@ -83,10 +111,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
height: 13,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@ class SnippetEditPage extends StatefulWidget {
|
||||
class _SnippetEditPageState extends State<SnippetEditPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
return Scaffold(appBar: AppBar(title: const Text('Snippet Edit'),), body: const Center(child: Text('Developing'),),);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ class SnippetListPage extends StatefulWidget {
|
||||
class _SnippetListPageState extends State<SnippetListPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
return Scaffold(appBar: AppBar(title: const Text('Snippet List'),), body: const Center(child: Text('Developing'),),);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user