mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-19 04:55:09 +00:00
design: Redesign style page
This commit is contained in:
parent
6bd518fa36
commit
7faa01f67a
4 changed files with 77 additions and 12 deletions
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB |
|
@ -1225,6 +1225,7 @@
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"messages": "Messages",
|
"messages": "Messages",
|
||||||
|
"messagesStyle": "Messages:",
|
||||||
"@messages": {
|
"@messages": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
@ -2132,7 +2133,7 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"wallpaper": "Wallpaper",
|
"wallpaper": "Wallpaper:",
|
||||||
"@wallpaper": {
|
"@wallpaper": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
@ -2501,5 +2502,7 @@
|
||||||
"provider": {}
|
"provider": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profileNotFound": "The user could not be found on the server. Maybe there is a connection problem or the user doesn't exist."
|
"profileNotFound": "The user could not be found on the server. Maybe there is a connection problem or the user doesn't exist.",
|
||||||
|
"setTheme": "Set theme:",
|
||||||
|
"setColorTheme": "Set color theme:"
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,13 +46,13 @@ class SettingsStyleController extends State<SettingsStyle> {
|
||||||
Color? get currentColor => ThemeController.of(context).primaryColor;
|
Color? get currentColor => ThemeController.of(context).primaryColor;
|
||||||
|
|
||||||
static final List<Color?> customColors = [
|
static final List<Color?> customColors = [
|
||||||
|
null,
|
||||||
AppConfig.chatColor,
|
AppConfig.chatColor,
|
||||||
Colors.indigo,
|
Colors.indigo,
|
||||||
Colors.green,
|
Colors.green,
|
||||||
Colors.orange,
|
Colors.orange,
|
||||||
Colors.pink,
|
Colors.pink,
|
||||||
Colors.blueGrey,
|
Colors.blueGrey,
|
||||||
null,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
void switchTheme(ThemeMode? newTheme) {
|
void switchTheme(ThemeMode? newTheme) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||||
import '../../config/app_config.dart';
|
import '../../config/app_config.dart';
|
||||||
import '../../widgets/matrix.dart';
|
import '../../widgets/matrix.dart';
|
||||||
|
@ -26,6 +27,15 @@ class SettingsStyleView extends StatelessWidget {
|
||||||
withScrolling: true,
|
withScrolling: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
L10n.of(context)!.setColorTheme,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: colorPickerSize + 24,
|
height: colorPickerSize + 24,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
|
@ -40,17 +50,59 @@ class SettingsStyleView extends StatelessWidget {
|
||||||
onTap: () => controller.setChatColor(color),
|
onTap: () => controller.setChatColor(color),
|
||||||
child: color == null
|
child: color == null
|
||||||
? Material(
|
? Material(
|
||||||
elevation:
|
elevation: 6,
|
||||||
AppConfig.colorSchemeSeed?.value == null
|
|
||||||
? 100
|
|
||||||
: 0,
|
|
||||||
shadowColor: AppConfig.colorSchemeSeed,
|
shadowColor: AppConfig.colorSchemeSeed,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(colorPickerSize),
|
BorderRadius.circular(colorPickerSize),
|
||||||
child: Image.asset(
|
child: DecoratedBox(
|
||||||
'assets/colors.png',
|
decoration: BoxDecoration(
|
||||||
width: colorPickerSize,
|
borderRadius: BorderRadius.circular(
|
||||||
|
colorPickerSize,
|
||||||
|
),
|
||||||
|
gradient: FluffyThemes.backgroundGradient(
|
||||||
|
context,
|
||||||
|
255,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: SizedBox(
|
||||||
height: colorPickerSize,
|
height: colorPickerSize,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0,
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
if (controller.currentColor ==
|
||||||
|
null)
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
right: 8.0,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.check,
|
||||||
|
size: 16,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onBackground,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
L10n.of(context)!.systemTheme,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onBackground,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Material(
|
: Material(
|
||||||
|
@ -78,7 +130,17 @@ class SettingsStyleView extends StatelessWidget {
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
const Divider(height: 1),
|
const Divider(height: 1),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
L10n.of(context)!.setTheme,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
RadioListTile<ThemeMode>(
|
RadioListTile<ThemeMode>(
|
||||||
groupValue: controller.currentTheme,
|
groupValue: controller.currentTheme,
|
||||||
value: ThemeMode.system,
|
value: ThemeMode.system,
|
||||||
|
@ -135,7 +197,7 @@ class SettingsStyleView extends StatelessWidget {
|
||||||
const Divider(height: 1),
|
const Divider(height: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
L10n.of(context)!.messages,
|
L10n.of(context)!.messagesStyle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|
Loading…
Reference in a new issue