mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-02 14:16:58 +00:00
Add a new filled card style and fix red texts
This commit is contained in:
parent
981b9865cd
commit
2826892400
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
|
||||
class ActionButton extends StatelessWidget {
|
||||
const ActionButton({
|
||||
|
@ -20,7 +19,9 @@ class ActionButton extends StatelessWidget {
|
|||
return TextButton(
|
||||
child: Text(
|
||||
text!,
|
||||
style: isRed ? const TextStyle(color: BrandColors.red1) : null,
|
||||
style: isRed
|
||||
? TextStyle(color: Theme.of(context).colorScheme.error)
|
||||
: null,
|
||||
),
|
||||
onPressed: () {
|
||||
navigator.pop();
|
||||
|
|
|
@ -25,11 +25,15 @@ class BrandCards {
|
|||
static Widget filled({
|
||||
required final Widget child,
|
||||
final bool tertiary = false,
|
||||
final bool secondary = false,
|
||||
final bool error = false,
|
||||
final bool clipped = true,
|
||||
}) =>
|
||||
_FilledCard(
|
||||
tertiary: tertiary,
|
||||
secondary: secondary,
|
||||
error: error,
|
||||
clipped: clipped,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
@ -82,25 +86,31 @@ class _OutlinedCard extends StatelessWidget {
|
|||
class _FilledCard extends StatelessWidget {
|
||||
const _FilledCard({
|
||||
required this.child,
|
||||
required this.secondary,
|
||||
required this.tertiary,
|
||||
required this.error,
|
||||
required this.clipped,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final bool tertiary;
|
||||
final bool error;
|
||||
final bool clipped;
|
||||
final bool secondary;
|
||||
@override
|
||||
Widget build(final BuildContext context) => Card(
|
||||
elevation: 0.0,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
clipBehavior: clipped ? Clip.antiAlias : Clip.none,
|
||||
color: error
|
||||
? Theme.of(context).colorScheme.errorContainer
|
||||
: tertiary
|
||||
? Theme.of(context).colorScheme.tertiaryContainer
|
||||
: Theme.of(context).colorScheme.surfaceVariant,
|
||||
: secondary
|
||||
? Theme.of(context).colorScheme.secondaryContainer
|
||||
: tertiary
|
||||
? Theme.of(context).colorScheme.tertiaryContainer
|
||||
: Theme.of(context).colorScheme.surfaceVariant,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart';
|
||||
|
@ -110,9 +109,9 @@ class _BackupDetailsState extends State<BackupDetails>
|
|||
),
|
||||
if (backupStatus == BackupStatusEnum.error)
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
leading: Icon(
|
||||
Icons.error_outline,
|
||||
color: BrandColors.red1,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
title: Text(
|
||||
'providers.backup.error_pending'.tr(),
|
||||
|
|
Loading…
Reference in a new issue