Improved non dynamic theme

This commit is contained in:
Juan Gilsanz Polo 2023-01-25 20:51:23 +01:00
parent 386af8e809
commit 1f0f158251
40 changed files with 118 additions and 277 deletions

View file

@ -63,7 +63,7 @@ class HomeAppBar extends StatelessWidget with PreferredSizeWidget {
color: serversProvider.selectedServer != null && serversProvider.serverStatus.data != null
? serversProvider.serverStatus.data!.generalEnabled == true
? appConfigProvider.useThemeColorForStatus
? Theme.of(context).primaryColor
? Theme.of(context).colorScheme.primary
: Colors.green
: appConfigProvider.useThemeColorForStatus == true
? Theme.of(context).colorScheme.onSurface.withOpacity(0.38)

View file

@ -194,7 +194,7 @@ class _HomeState extends State<Home> {
return Scaffold(
appBar: const HomeAppBar(),
body: RefreshIndicator(
color: Theme.of(context).primaryColor,
color: Theme.of(context).colorScheme.primary,
onRefresh: () async {
final result = await getServerStatus(serversProvider.selectedServer!);
if (result['result'] == 'success') {

View file

@ -38,7 +38,7 @@ class ManagementModal extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Material(
color: Theme.of(context).primaryColor.withOpacity(0.1),
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(28),
child: InkWell(
onTap: serversProvider.protectionsManagementProcess.contains('general') == false
@ -64,7 +64,7 @@ class ManagementModal extends StatelessWidget {
onChanged: serversProvider.protectionsManagementProcess.contains('general') == false
? (value) => updateBlocking(value, 'general')
: null,
activeColor: Theme.of(context).primaryColor,
activeColor: Theme.of(context).colorScheme.primary,
)
],
),
@ -112,7 +112,7 @@ class ManagementModal extends StatelessWidget {
onChanged: disabled == false
? onChange
: null,
activeColor: Theme.of(context).primaryColor,
activeColor: Theme.of(context).colorScheme.primary,
)
],
),

View file

@ -28,7 +28,7 @@ class StatusBox extends StatelessWidget {
decoration: BoxDecoration(
color: isEnabled == true
? appConfigProvider.useThemeColorForStatus == true
? Theme.of(context).primaryColor
? Theme.of(context).colorScheme.primary
: Colors.green
: appConfigProvider.useThemeColorForStatus == true
? Colors.grey
@ -40,7 +40,7 @@ class StatusBox extends StatelessWidget {
Icon(
icon,
color: appConfigProvider.useThemeColorForStatus == true
? Theme.of(context).primaryColor.computeLuminance() > 0.5 ? Colors.black : Colors.white
? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 ? Colors.black : Colors.white
: Colors.grey.computeLuminance() > 0.5 ? Colors.black : Colors.white,
),
const SizedBox(width: 12),
@ -48,7 +48,7 @@ class StatusBox extends StatelessWidget {
label,
style: TextStyle(
color: appConfigProvider.useThemeColorForStatus == true
? Theme.of(context).primaryColor.computeLuminance() > 0.5 ? Colors.black : Colors.white
? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 ? Colors.black : Colors.white
: Colors.grey.computeLuminance() > 0.5 ? Colors.black : Colors.white,
fontWeight: FontWeight.w500
),