mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
bug: color seed setting not working (#516)
This commit is contained in:
@@ -22,7 +22,7 @@ class MyApp extends StatelessWidget {
|
||||
listenable: RNodes.app,
|
||||
builder: (context, _) {
|
||||
if (!Stores.setting.useSystemPrimaryColor.fetch()) {
|
||||
UIs.colorSeed = Color(Stores.setting.primaryColor.fetch());
|
||||
UIs.colorSeed = Color(Stores.setting.colorSeed.fetch());
|
||||
return _buildApp(
|
||||
context,
|
||||
light: ThemeData(
|
||||
@@ -88,6 +88,7 @@ class MyApp extends StatelessWidget {
|
||||
context.setLibL10n();
|
||||
final appL10n = AppLocalizations.of(context);
|
||||
if (appL10n != null) l10n = appL10n;
|
||||
UIs.primaryColor = Theme.of(context).colorScheme.primary;
|
||||
|
||||
final intros = _IntroPage.builders;
|
||||
if (intros.isNotEmpty) {
|
||||
|
||||
@@ -55,7 +55,8 @@ class SettingStore extends PersistentStore {
|
||||
1.0,
|
||||
);
|
||||
|
||||
late final primaryColor = property(
|
||||
/// The seed of color scheme
|
||||
late final colorSeed = property(
|
||||
'primaryColor',
|
||||
4287106639,
|
||||
);
|
||||
|
||||
@@ -34,6 +34,7 @@ class BackupPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(13),
|
||||
children: [
|
||||
_buildTip(),
|
||||
CenterGreyTitle(libL10n.sync),
|
||||
if (isMacOS || isIOS) _buildIcloud(context),
|
||||
_buildWebdav(context),
|
||||
_buildFile(context),
|
||||
|
||||
@@ -413,7 +413,7 @@ class _ContainerPageState extends State<ContainerPage> {
|
||||
final host = Stores.container.fetch(id);
|
||||
final ctrl = TextEditingController(text: host);
|
||||
await context.showRoundDialog(
|
||||
title: 'DOCKER_HOST',
|
||||
title: libL10n.edit,
|
||||
child: Input(
|
||||
maxLines: 2,
|
||||
controller: ctrl,
|
||||
|
||||
@@ -159,9 +159,11 @@ class _ProcessPageState extends State<ProcessPage> {
|
||||
'${l10n.stop} ${l10n.process}(${proc.pid})',
|
||||
)),
|
||||
actions: Btn.ok(onTap: (c) async {
|
||||
await _client?.run('kill ${proc.pid}');
|
||||
await _refresh();
|
||||
context.pop();
|
||||
await context.showLoadingDialog(fn: () async {
|
||||
await _client?.run('kill ${proc.pid}');
|
||||
await _refresh();
|
||||
});
|
||||
}).toList,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -529,7 +529,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
onTap: onTap,
|
||||
child: wrapped,
|
||||
).paddingOnly(left: 10);
|
||||
).paddingOnly(left: 5);
|
||||
}
|
||||
|
||||
Widget _buildTopRightText(Server s) {
|
||||
|
||||
@@ -38,9 +38,10 @@ class _SettingPageState extends State<SettingPage> {
|
||||
onPressed: () => context.showRoundDialog(
|
||||
title: libL10n.attention,
|
||||
child: SimpleMarkdown(
|
||||
data: libL10n.askContinue(
|
||||
'${libL10n.delete} **${libL10n.all}** ${l10n.setting}',
|
||||
)),
|
||||
data: libL10n.askContinue(
|
||||
'${libL10n.delete} **${libL10n.all}** ${l10n.setting}',
|
||||
),
|
||||
),
|
||||
actions: Btn.ok(
|
||||
onTap: (c) {
|
||||
context.pop();
|
||||
@@ -223,8 +224,11 @@ class _SettingPageState extends State<SettingPage> {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.colorize),
|
||||
title: Text(l10n.primaryColorSeed),
|
||||
trailing: ClipOval(
|
||||
child: Container(color: UIs.primaryColor, height: 27, width: 27),
|
||||
trailing: _setting.colorSeed.listenable().listenVal(
|
||||
(val) {
|
||||
final c = Color(val);
|
||||
return ClipOval(child: Container(color: c, height: 27, width: 27));
|
||||
},
|
||||
),
|
||||
onTap: () async {
|
||||
final ctrl = TextEditingController(text: UIs.primaryColor.toHex);
|
||||
@@ -252,7 +256,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
suggestion: false,
|
||||
),
|
||||
ColorPicker(
|
||||
color: Color(_setting.primaryColor.fetch()),
|
||||
color: Color(_setting.colorSeed.fetch()),
|
||||
onColorChanged: (c) => ctrl.text = c.toHex,
|
||||
)
|
||||
]);
|
||||
@@ -274,13 +278,10 @@ class _SettingPageState extends State<SettingPage> {
|
||||
context.showSnackBar(libL10n.fail);
|
||||
return;
|
||||
}
|
||||
// Change [primaryColor] first, then change [_selectedColorValue],
|
||||
// So the [ValueBuilder] will be triggered with the new value
|
||||
UIs.colorSeed = color;
|
||||
_setting.primaryColor.put(color.value);
|
||||
_setting.colorSeed.put(color.value);
|
||||
context.pop();
|
||||
context.pop();
|
||||
RNodes.app.notify();
|
||||
Future.delayed(Durations.medium1, RNodes.app.notify);
|
||||
}
|
||||
|
||||
// Widget _buildLaunchPage() {
|
||||
|
||||
@@ -73,15 +73,10 @@ class _SSHTabPageState extends State<SSHTabPage>
|
||||
return AlertDialog(
|
||||
title: Text(libL10n.attention),
|
||||
content: Text('${libL10n.close} SSH ${l10n.conn}($name) ?'),
|
||||
actions: [
|
||||
Btn.ok(
|
||||
onTap: (c) => context.pop(true),
|
||||
red: true,
|
||||
),
|
||||
Btn.cancel(
|
||||
onTap: (c) => context.pop(false),
|
||||
),
|
||||
],
|
||||
actions: Btn.ok(
|
||||
onTap: (c) => context.pop(true),
|
||||
red: true,
|
||||
).toList,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -350,10 +350,10 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
title: libL10n.delete,
|
||||
child: Text(libL10n.askContinue('${libL10n.delete} $fileName')),
|
||||
actions: Btn.ok(
|
||||
onTap: (c) {
|
||||
onTap: (c) async {
|
||||
context.pop();
|
||||
try {
|
||||
file.deleteSync(recursive: true);
|
||||
await file.delete(recursive: true);
|
||||
} catch (e) {
|
||||
context.showSnackBar('${libL10n.fail}:\n$e');
|
||||
return;
|
||||
|
||||
@@ -385,8 +385,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: "v1.0.109"
|
||||
resolved-ref: "27266fdd805a5bb2a9c682ca70aaaef785e609b5"
|
||||
ref: "v1.0.111"
|
||||
resolved-ref: c220f27ce606e0a342cf9add6a90ce4c11844972
|
||||
url: "https://github.com/lppcg/fl_lib"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
|
||||
@@ -61,7 +61,7 @@ dependencies:
|
||||
fl_lib:
|
||||
git:
|
||||
url: https://github.com/lppcg/fl_lib
|
||||
ref: v1.0.109
|
||||
ref: v1.0.111
|
||||
|
||||
dependency_overrides:
|
||||
# dartssh2:
|
||||
|
||||
Reference in New Issue
Block a user