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