Dark theme

This commit is contained in:
Yannick Mauray 2021-11-08 00:40:29 +01:00
parent adcd5f9b92
commit 71c43b08b5
No known key found for this signature in database
GPG Key ID: 67C4AAC5E99CB909
5 changed files with 17 additions and 9 deletions

View File

@ -1,15 +1,20 @@
import 'package:flutter/material.dart';
import 'package:quickgui/src/pages/main_page.dart';
class App extends StatelessWidget {
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.pink,
),
home: const MainPage(title: 'Quickgui - A Flutter frontend for Quickget and Quickemu'));
theme: ThemeData(primarySwatch: Colors.pink),
darkTheme: ThemeData.dark(),
home: const MainPage(title: 'Quickgui - A Flutter frontend for Quickget and Quickemu'),
);
}
}

View File

@ -18,6 +18,9 @@ class CancelDismissButton extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).colorScheme.surface,
),
onPressed: !downloadFinished
? onCancel
: () {

View File

@ -29,7 +29,7 @@ class _DownloaderMenuState extends State<DownloaderMenu> with PreferencesMixin {
Widget build(BuildContext context) {
return Expanded(
child: Container(
color: Colors.pink,
color: Theme.of(context).brightness == Brightness.dark ? Theme.of(context).colorScheme.surface : Theme.of(context).colorScheme.primary,
child: Column(
children: [
Row(

View File

@ -32,8 +32,8 @@ class HomePageButton extends StatelessWidget {
),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.white,
onPrimary: Colors.pink,
primary: Theme.of(context).canvasColor, //Theme.of(context).canvasColor
onPrimary: Theme.of(context).brightness == Brightness.dark ? Colors.white70 : Theme.of(context).colorScheme.primary,
),
onPressed: onPressed,
child: Padding(

View File

@ -10,7 +10,7 @@ class MainMenu extends StatelessWidget {
Widget build(BuildContext context) {
return Expanded(
child: Container(
color: Colors.pink,
color: Theme.of(context).brightness == Brightness.dark ? Theme.of(context).colorScheme.surface : Theme.of(context).colorScheme.primary,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(