fix(following): 收紧取消追剧确认弹窗
This commit is contained in:
1 parent
8d511933df
commit
72dcb92aca
2 files changed
+45
No files matched your search
@@ -27,6 +27,7 @@ const double _barButtonHeight = 30;
|
|||||||
const double _removeDialogButtonHeight = 32;
|
const double _removeDialogButtonHeight = 32;
|
||||||
const double _removeDialogRadius = 6;
|
const double _removeDialogRadius = 6;
|
||||||
const double _removeDialogBottomInset = 8;
|
const double _removeDialogBottomInset = 8;
|
||||||
|
const double _cancelFollowingDialogPadding = 20;
|
||||||
|
|
||||||
/// 播放历史移除确认。只把移除按钮压矮。
|
/// 播放历史移除确认。只把移除按钮压矮。
|
||||||
Future<bool> confirmHistoryRemove(BuildContext context) async {
|
Future<bool> confirmHistoryRemove(BuildContext context) async {
|
||||||
@@ -71,13 +72,32 @@ Future<bool> confirmCancelFollowing(BuildContext context) async {
|
|||||||
return await showDialog<bool>(
|
return await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (dialogContext) => AlertDialog(
|
builder: (dialogContext) => AlertDialog(
|
||||||
|
contentPadding: const EdgeInsets.all(_cancelFollowingDialogPadding),
|
||||||
|
actionsPadding: const EdgeInsets.fromLTRB(
|
||||||
|
_cancelFollowingDialogPadding,
|
||||||
|
0,
|
||||||
|
_cancelFollowingDialogPadding,
|
||||||
|
_cancelFollowingDialogPadding,
|
||||||
|
),
|
||||||
content: Text(l10n.confirmCancelFollowing),
|
content: Text(l10n.confirmCancelFollowing),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
visualDensity: VisualDensity.standard,
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
|
minimumSize: const Size(0, _removeDialogButtonHeight),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
),
|
||||||
onPressed: () => Navigator.pop(dialogContext, false),
|
onPressed: () => Navigator.pop(dialogContext, false),
|
||||||
child: Text(l10n.cancel),
|
child: Text(l10n.cancel),
|
||||||
),
|
),
|
||||||
FilledButton(
|
FilledButton(
|
||||||
|
style: FilledButton.styleFrom(
|
||||||
|
visualDensity: VisualDensity.standard,
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
|
minimumSize: const Size(0, _removeDialogButtonHeight),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
),
|
||||||
onPressed: () => Navigator.pop(dialogContext, true),
|
onPressed: () => Navigator.pop(dialogContext, true),
|
||||||
child: Text(l10n.cancelFollowing),
|
child: Text(l10n.cancelFollowing),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -143,6 +143,31 @@ void main() {
|
|||||||
await tester.tap(find.byKey(const Key('following-cancel-follow')));
|
await tester.tap(find.byKey(const Key('following-cancel-follow')));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('Unfollow the selected dramas?'), findsOneWidget);
|
expect(find.text('Unfollow the selected dramas?'), findsOneWidget);
|
||||||
|
final dialog = tester.widget<AlertDialog>(find.byType(AlertDialog));
|
||||||
|
expect(dialog.contentPadding, const EdgeInsets.all(20));
|
||||||
|
expect(dialog.actionsPadding, const EdgeInsets.fromLTRB(20, 0, 20, 20));
|
||||||
|
expect(
|
||||||
|
tester
|
||||||
|
.getSize(
|
||||||
|
find.descendant(
|
||||||
|
of: find.byType(AlertDialog),
|
||||||
|
matching: find.byType(TextButton),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.height,
|
||||||
|
32,
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
tester
|
||||||
|
.getSize(
|
||||||
|
find.descendant(
|
||||||
|
of: find.byType(AlertDialog),
|
||||||
|
matching: find.byType(FilledButton),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.height,
|
||||||
|
32,
|
||||||
|
);
|
||||||
await tester.tap(
|
await tester.tap(
|
||||||
find.descendant(
|
find.descendant(
|
||||||
of: find.byType(AlertDialog),
|
of: find.byType(AlertDialog),
|
||||||
|
|||||||
Reference in new issue
Block a user