69 lines
2.6 KiB
Dart
Raw Normal View History

2021-12-07 23:01:23 +05:30
import 'package:easy_localization/easy_localization.dart';
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';
2021-12-07 23:01:23 +05:30
import 'package:app_flowy/generated/locale_keys.g.dart';
2022-02-23 22:17:47 +08:00
class DocumentBanner extends StatelessWidget {
final void Function() onRestore;
final void Function() onDelete;
2022-08-09 18:04:23 +08:00
const DocumentBanner(
{required this.onRestore, required this.onDelete, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
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,
color: Theme.of(context).colorScheme.primary,
2022-02-23 14:33:08 -03:00
child: FittedBox(
alignment: Alignment.center,
fit: BoxFit.scaleDown,
child: Row(
children: [
2022-08-09 18:04:23 +08:00
FlowyText.medium(LocaleKeys.deletePagePrompt_text.tr(),
color: Colors.white),
2022-02-23 14:33:08 -03:00
const HSpace(20),
BaseStyledButton(
minWidth: 160,
minHeight: 40,
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: Theme.of(context).colorScheme.primary,
downColor: Theme.of(context).colorScheme.primaryContainer,
2022-02-23 14:33:08 -03:00
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
2022-08-31 09:19:31 +08:00
onPressed: onRestore,
2022-08-09 18:04:23 +08:00
child: FlowyText.medium(
LocaleKeys.deletePagePrompt_restore.tr(),
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 14,
)),
2022-02-23 14:33:08 -03:00
const HSpace(20),
BaseStyledButton(
minWidth: 220,
minHeight: 40,
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: Theme.of(context).colorScheme.primaryContainer,
downColor: Theme.of(context).colorScheme.primary,
2022-02-23 14:33:08 -03:00
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
2022-08-31 09:19:31 +08:00
onPressed: onDelete,
2022-08-09 18:04:23 +08:00
child: FlowyText.medium(
LocaleKeys.deletePagePrompt_deletePermanent.tr(),
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 14,
)),
2022-02-23 14:33:08 -03:00
],
),
2021-11-01 18:37:21 +08:00
),
),
);
}
}