dark theme install page

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-02-27 17:54:18 +08:00
parent 6048efe02b
commit 6971f45fd0
2 changed files with 11 additions and 11 deletions

View File

@ -46,15 +46,19 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
final double em = 13;
final btnFontSize = 0.9 * em;
final double button_radius = 6;
final isDarkTheme = MyTheme.currentThemeMode() == ThemeMode.dark;
final buttonStyle = OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(button_radius)),
));
final inputBorder = OutlineInputBorder(
borderRadius: BorderRadius.zero,
borderSide: BorderSide(color: Colors.black12));
borderSide:
BorderSide(color: isDarkTheme ? Colors.white70 : Colors.black12));
final textColor = isDarkTheme ? null : Colors.black87;
final dividerColor = isDarkTheme ? Colors.white70 : Colors.black87;
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: null,
body: SingleChildScrollView(
child: Column(
children: [
@ -91,8 +95,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
style: buttonStyle,
child: Text(translate('Change Path'),
style: TextStyle(
color: Colors.black87,
fontSize: btnFontSize)))
color: textColor, fontSize: btnFontSize)))
.marginOnly(left: em))
],
).marginSymmetric(vertical: 2 * em),
@ -127,8 +130,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
)).marginOnly(top: 2 * em),
Row(children: [Text(translate('agreement_tip'))])
.marginOnly(top: em),
Divider(color: Colors.black87)
.marginSymmetric(vertical: 0.5 * em),
Divider(color: dividerColor).marginSymmetric(vertical: 0.5 * em),
Row(
children: [
Expanded(
@ -143,8 +145,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
style: buttonStyle,
child: Text(translate('Cancel'),
style: TextStyle(
color: Colors.black87,
fontSize: btnFontSize)))
color: textColor, fontSize: btnFontSize)))
.marginOnly(right: 2 * em)),
Obx(() => ElevatedButton(
onPressed: btnEnabled.value ? install : null,
@ -167,8 +168,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
style: buttonStyle,
child: Text(translate('Run without install'),
style: TextStyle(
color: Colors.black87,
fontSize: btnFontSize)))
color: textColor, fontSize: btnFontSize)))
.marginOnly(left: 2 * em)),
),
],

View File

@ -291,7 +291,7 @@ void _runApp(
void runInstallPage() async {
await windowManager.ensureInitialized();
await initEnv(kAppTypeMain);
_runApp('', const InstallPage(), ThemeMode.light);
_runApp('', const InstallPage(), MyTheme.currentThemeMode());
windowManager.waitUntilReadyToShow(
WindowOptions(size: Size(800, 600), center: true), () async {
windowManager.show();