mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 13:23:41 +00:00
fix(ui): keep mobile create task actions in safe area (#1504)
This commit is contained in:
2 files changed
+26
-19
No files matched your search
@@ -687,24 +687,27 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
SafeArea(
|
||||||
padding: const EdgeInsets.fromLTRB(24, 12, 24, 20),
|
top: false,
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
border: Border(top: BorderSide(color: palette.border)),
|
padding: const EdgeInsets.fromLTRB(24, 12, 24, 20),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: Row(
|
border: Border(top: BorderSide(color: palette.border)),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
),
|
||||||
children: [
|
child: Row(
|
||||||
CreateTaskActionButtons(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
submitting: _creating,
|
children: [
|
||||||
onCancel: _closeWindow,
|
CreateTaskActionButtons(
|
||||||
onSubmit: _confirm,
|
submitting: _creating,
|
||||||
cancelLabel: context.l10n.cancel,
|
onCancel: _closeWindow,
|
||||||
submitLabel: context.l10n.confirm,
|
onSubmit: _confirm,
|
||||||
cancelButtonKey: const ValueKey('create-task-cancel-button'),
|
cancelLabel: context.l10n.cancel,
|
||||||
submitButtonKey: const ValueKey('create-task-confirm-button'),
|
submitLabel: context.l10n.confirm,
|
||||||
),
|
cancelButtonKey: const ValueKey('create-task-cancel-button'),
|
||||||
],
|
submitButtonKey: const ValueKey('create-task-confirm-button'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('mobile create task page starts below the system status bar', (WidgetTester tester) async {
|
testWidgets('mobile create task page stays within the system safe areas', (WidgetTester tester) async {
|
||||||
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
||||||
tester.view.physicalSize = const Size(700, 760);
|
tester.view.physicalSize = const Size(700, 760);
|
||||||
tester.view.devicePixelRatio = 1;
|
tester.view.devicePixelRatio = 1;
|
||||||
@@ -193,6 +193,10 @@ void main() {
|
|||||||
|
|
||||||
final contentPadding = tester.widget<Padding>(find.byKey(const ValueKey('create-task-safe-content')));
|
final contentPadding = tester.widget<Padding>(find.byKey(const ValueKey('create-task-safe-content')));
|
||||||
expect((contentPadding.padding as EdgeInsets).top, 32);
|
expect((contentPadding.padding as EdgeInsets).top, 32);
|
||||||
|
expect(
|
||||||
|
tester.getBottomRight(find.byKey(const ValueKey('create-task-confirm-button'))).dy,
|
||||||
|
lessThanOrEqualTo(tester.view.physicalSize.height / tester.view.devicePixelRatio - 24),
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
debugDefaultTargetPlatformOverride = null;
|
debugDefaultTargetPlatformOverride = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user