1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 15:03:22 +00:00
comunicmobile/lib/ui/widgets/login_routes_theme.dart

67 lines
2.6 KiB
Dart
Raw Normal View History

2021-04-17 09:16:21 +00:00
import 'package:comunic/models/config.dart';
import 'package:flutter/material.dart';
/// Login forms base theme
///
/// @author Pierre Hubert
class LoginRoutesTheme extends StatelessWidget {
final Widget child;
const LoginRoutesTheme({Key? key, required this.child}) : super(key: key);
2021-04-17 09:16:21 +00:00
@override
Widget build(BuildContext context) => Theme(
data: Theme.of(context).copyWith(
scaffoldBackgroundColor: Config.get()!.splashBackgroundColor,
2021-04-17 09:16:21 +00:00
appBarTheme: AppBarTheme(
backgroundColor: Colors.transparent,
elevation: 0,
),
iconTheme: IconThemeData(color: Colors.white),
inputDecorationTheme: InputDecorationTheme(
fillColor: Colors.white,
hintStyle: TextStyle(color: Colors.white),
labelStyle: TextStyle(color: Colors.white),
prefixStyle: TextStyle(color: Colors.white),
hoverColor: Colors.white,
errorStyle: TextStyle(color: Colors.deepOrangeAccent),
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.all(Colors.white),
checkColor:
MaterialStateProperty.all(Config.get()!.splashBackgroundColor),
2021-04-17 09:16:21 +00:00
),
dialogBackgroundColor: Config.get()!.splashBackgroundColor,
2021-04-17 09:26:37 +00:00
dialogTheme: DialogTheme(
contentTextStyle: TextStyle(
color: Colors.white,
),
),
buttonTheme: ButtonThemeData(buttonColor: Colors.white),
2021-04-17 09:16:21 +00:00
primaryColor: Colors.white,
backgroundColor: Config.get()!.splashBackgroundColor,
2021-04-17 09:16:21 +00:00
disabledColor: Colors.grey,
highlightColor: Colors.white12,
hintColor: Colors.white,
textTheme: TextTheme(subtitle1: TextStyle(color: Colors.white)),
2021-04-23 17:32:34 +00:00
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.all(Colors.white),
),
2021-04-17 09:16:21 +00:00
colorScheme: ColorScheme(
primary: Colors.white,
secondary: Colors.white,
surface: Config.get()!.splashBackgroundColor,
background: Config.get()!.splashBackgroundColor,
2021-04-17 09:16:21 +00:00
error: Colors.redAccent,
onPrimary: Config.get()!.splashBackgroundColor,
onSecondary: Config.get()!.splashBackgroundColor,
2021-04-17 09:16:21 +00:00
onSurface: Colors.white,
onBackground: Colors.white,
onError: Colors.redAccent,
brightness: Brightness.dark,
2021-12-28 14:33:27 +00:00
).copyWith(secondary: Colors.white)),
2021-04-17 09:16:21 +00:00
child: child,
);
}