2021-12-07 23:01:23 +05:30
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2021-10-31 19:48:20 +08:00
|
|
|
import 'package:flowy_infra/size.dart';
|
|
|
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
|
|
|
import 'package:flowy_infra_ui/widget/buttons/base_styled_button.dart';
|
|
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2023-02-26 16:27:17 +08:00
|
|
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
2021-10-31 19:48:20 +08:00
|
|
|
|
2022-02-23 22:17:47 +08:00
|
|
|
class DocumentBanner extends StatelessWidget {
|
2021-10-31 19:48:20 +08:00
|
|
|
final void Function() onRestore;
|
|
|
|
final void Function() onDelete;
|
2023-04-10 15:10:42 +08:00
|
|
|
const DocumentBanner({
|
|
|
|
required this.onRestore,
|
|
|
|
required this.onDelete,
|
2023-12-08 20:01:54 +07:00
|
|
|
super.key,
|
|
|
|
});
|
2021-10-31 19:48:20 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-09-14 16:18:42 +05:30
|
|
|
final colorScheme = Theme.of(context).colorScheme;
|
2021-11-02 13:45:01 +08:00
|
|
|
return ConstrainedBox(
|
|
|
|
constraints: const BoxConstraints(minHeight: 60),
|
2021-11-01 18:37:21 +08:00
|
|
|
child: Container(
|
2022-02-23 14:33:08 -03:00
|
|
|
width: double.infinity,
|
2023-10-05 07:04:36 +05:30
|
|
|
color: colorScheme.surfaceVariant,
|
2022-02-23 14:33:08 -03:00
|
|
|
child: FittedBox(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
2023-04-10 15:10:42 +08:00
|
|
|
FlowyText.medium(
|
|
|
|
LocaleKeys.deletePagePrompt_text.tr(),
|
2023-10-05 07:04:36 +05:30
|
|
|
color: colorScheme.tertiary,
|
2023-09-14 16:18:42 +05:30
|
|
|
fontSize: 14,
|
2023-04-10 15:10:42 +08:00
|
|
|
),
|
2022-02-23 14:33:08 -03:00
|
|
|
const HSpace(20),
|
|
|
|
BaseStyledButton(
|
2023-04-10 15:10:42 +08:00
|
|
|
minWidth: 160,
|
|
|
|
minHeight: 40,
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
bgColor: Colors.transparent,
|
2023-10-05 07:04:36 +05:30
|
|
|
highlightColor: Theme.of(context).colorScheme.onErrorContainer,
|
|
|
|
outlineColor: colorScheme.tertiaryContainer,
|
2023-04-10 15:10:42 +08:00
|
|
|
borderRadius: Corners.s8Border,
|
|
|
|
onPressed: onRestore,
|
|
|
|
child: FlowyText.medium(
|
|
|
|
LocaleKeys.deletePagePrompt_restore.tr(),
|
2023-10-05 07:04:36 +05:30
|
|
|
color: colorScheme.tertiary,
|
2023-09-14 16:18:42 +05:30
|
|
|
fontSize: 13,
|
2023-04-10 15:10:42 +08:00
|
|
|
),
|
|
|
|
),
|
2022-02-23 14:33:08 -03:00
|
|
|
const HSpace(20),
|
|
|
|
BaseStyledButton(
|
2023-04-10 15:10:42 +08:00
|
|
|
minWidth: 220,
|
|
|
|
minHeight: 40,
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
bgColor: Colors.transparent,
|
2023-10-05 07:04:36 +05:30
|
|
|
highlightColor: Theme.of(context).colorScheme.error,
|
|
|
|
outlineColor: colorScheme.tertiaryContainer,
|
2023-04-10 15:10:42 +08:00
|
|
|
borderRadius: Corners.s8Border,
|
|
|
|
onPressed: onDelete,
|
|
|
|
child: FlowyText.medium(
|
|
|
|
LocaleKeys.deletePagePrompt_deletePermanent.tr(),
|
2023-10-05 07:04:36 +05:30
|
|
|
color: colorScheme.tertiary,
|
2023-09-14 16:18:42 +05:30
|
|
|
fontSize: 13,
|
2023-04-10 15:10:42 +08:00
|
|
|
),
|
|
|
|
),
|
2022-02-23 14:33:08 -03:00
|
|
|
],
|
|
|
|
),
|
2021-11-01 18:37:21 +08:00
|
|
|
),
|
2021-10-31 19:48:20 +08:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|