yim
7b262d926d
Test SliverMainAxisGroup
offstage child ( #159406 )
...
```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('my test', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: LayoutBuilder(
builder: (context, view) {
return CustomScrollView(
slivers: [
SliverMainAxisGroup(
slivers: [
SliverToBoxAdapter(child: SizedBox(height: view.maxHeight)),
const SliverToBoxAdapter(child: Text('1')),
],
)
],
);
},
),
),
);
expect(find.text('1'), findsNothing);
});
}
```
The above test should have passed, but it failed. This PR fixes the
issue.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-11 00:58:59 +00:00
Nate Wilson
dc5809309a
Fix SafeArea
DartPad sample ( #159344 )
...
This pull request fixes a bug I introduced in
https://github.com/flutter/flutter/pull/158019 .
<br>
<h3 align="center">Before</h3>
<p align="center">
<img
src="https://github.com/user-attachments/assets/fcb68fac-9c63-445d-8d2b-afc28c685053 "
alt="RenderFlex overflowed"
width="523px"
/>
</p>
<h3 align="center">After</h3>
<p align="center">
<img
src="https://github.com/user-attachments/assets/82091c6a-b3c5-4994-978e-5e76cbb7edfd "
alt="RenderFlex overflowed"
width="523px"
/>
</p>
<br><br>
- fixes https://github.com/flutter/flutter/issues/159340
2024-12-09 19:54:08 +00:00
Anis Alibegić
e2ada1c939
Fixed typos ( #159331 )
...
Here's another one of my PRs where I hunt for typos across `flutter`
repo.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-12-05 16:54:09 +00:00
Neutrino2711
4b818b56c2
Updated document to clarify Clip Behaviour ( #157719 )
...
Revised comments to clarify that clipping of child depends on clipBehavior of the parent widget, typically scrollable widgets that default to Clips.hard.
Noted that decoration features such as shadows , which render outside the widget boundary, may lead to undesirable effects.
Recommended using Clips.none in scenarios where shadow effects are used to avoid clipping issues.
Fixing Issue #156819
2024-11-14 20:21:09 +00:00
Nate Wilson
1eaf1f9525
Add SafeArea
DartPad sample ( #158019 )
...
Follow-up from #157228
2024-11-11 01:00:21 +00:00
Valentin Vignal
0c97067f80
Add test for image.frame_builder.0.dart
( #158247 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/image/image.frame_builder.0.dart`
2024-11-06 16:40:14 +00:00
Valentin Vignal
73546b3b71
Add test for image.loading_builder.0.dart
( #158248 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/image/image.loading_builder.0.dart`
2024-11-06 14:26:28 +00:00
Bruno Leroux
22a7afd99a
Fix RawScrollbar examples and desktop test ( #158237 )
...
## Description
Fix the formatting of some `RawScrollbar` examples.
Fix and rename one test file (name without `_test` suffix).
2024-11-06 08:34:36 +00:00
Valentin Vignal
ffe81f0354
Add test for raw_scrollbar.2.dart
( #158161 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart`
2024-11-05 23:07:57 +00:00
Valentin Vignal
86fc1fd479
Add test for raw_scrollbar.shape.0.dart
( #158094 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart`
2024-11-05 08:21:20 +00:00
Valentin Vignal
ed91ba1ba5
Add test for raw_scrollbar.1.dart
( #158069 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart`
2024-11-04 07:33:22 +00:00
Valentin Vignal
a1fbc839e2
Add test for interactive_viewer.constrained.0.dart
( #158044 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart`
2024-11-04 01:47:30 +00:00
Valentin Vignal
574b7e765d
Add test for raw_scrollbar.0.dart
( #157989 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart`
2024-11-02 03:57:29 +00:00
Valentin Vignal
fd259714d4
Add test for interactive_viewer.transformation_controller.0.dart
( #157986 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart`
2024-11-01 10:37:59 +00:00
Valentin Vignal
43bb6186d2
Add test for notification.0.dart
( #157909 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/notification_listener/notification.0.dart`
2024-11-01 06:41:13 +00:00
Valentin Vignal
16622e67a0
Add test for media_query_data.system_gesture_insets.0.dart
( #157854 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart`
2024-10-31 10:47:14 +00:00
miechoo
2d2ebbe263
Fix GlowingOverscrollIndicator
examples ( #155203 )
...
Part of https://github.com/flutter/flutter/issues/130459
This pull request adds tests for the example files shown in the [GlowingOverscrollIndicator](https://api.flutter.dev/flutter/widgets/GlowingOverscrollIndicator-class.html ) Flutter API reference documentation.
2024-10-30 20:50:00 +00:00
Valentin Vignal
f9c130abf0
Add test for interactive_viewer.0.dart
( #157773 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart`
2024-10-30 05:46:24 +00:00
Valentin Vignal
1ec1c59d47
Add test for scroll_metrics_notification.0.dart
( #157768 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart`
2024-10-30 05:46:21 +00:00
yim
c051b69e2a
Add boundary feature to the drag gesture. ( #147521 )
...
Inspired by the review on #146182 .
This PR adds boundary feature to the drag gestures, including `MultiDragGestureRecognizer` and `DragGestureRecognizer`. The `GestureDetector` widget will also benefit from this.
2024-10-30 03:01:18 +00:00
Valentin Vignal
2de487308a
Add test for focus_scope.0.dart
( #157772 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/focus_scope/focus_scope.0.dart`
2024-10-29 09:02:01 +00:00
Valentin Vignal
55fa5ae07f
Add test for page_storage.0.dart
( #157770 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/page_storage/page_storage.0.dart`
2024-10-29 09:01:59 +00:00
Valentin Vignal
88d992042c
Add test for nested_scroll_view_state.0.dart
( #157714 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart`
2024-10-29 02:40:41 +00:00
Valentin Vignal
ab256e5caf
Add test for restorable_route_future.0.dart
( #157708 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/restorable_route_future.0.dart`
2024-10-28 17:02:07 +00:00
Valentin Vignal
e6e820d776
Add test for restoration_mixin.0.dart
( #157709 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/restoration/restoration_mixin.0.dart`
2024-10-28 11:37:15 +00:00
Valentin Vignal
b9f62f6f9f
Add test for navigator.restorable_push_replacement.0.dart
( #157704 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart`
2024-10-28 11:23:30 +00:00
Valentin Vignal
d9cb4b8c17
Add test for focus_node.unfocus.0.dart
( #157673 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart`
2024-10-28 10:47:23 +00:00
Valentin Vignal
8f5d032d78
Add tests for navigator_state.restorable_push.0.dart
( #157667 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart`
2024-10-28 08:10:19 +00:00
Valentin Vignal
eef9f7129e
Add test for navigator_state.restorable_push_replacement.0.dart
( #157668 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart`
2024-10-28 06:56:39 +00:00
Valentin Vignal
2d09837ed0
Add test for navigator_state.restorable_push_and_remove_until.0.dart
( #157595 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart`
2024-10-26 10:21:26 +00:00
Valentin Vignal
4e52defed4
Add tests for navigator.restorable_push.0.dart
( #157492 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart`
2024-10-26 02:39:13 +00:00
Valentin Vignal
086c07cc05
Add test for build_owner.0.dart
( #157499 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/framework/build_owner.0.dart`
2024-10-25 07:13:22 +00:00
Valentin Vignal
ffb1239801
Add tests for focusable_action_detector.0.dart
( #157575 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/actions/focusable_action_detector.0.dart`
2024-10-25 07:05:26 +00:00
Valentin Vignal
29eee6ac16
Add test for navigator.restorable_push_and_remove_until.0.dart
( #157487 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart`
2024-10-25 06:39:33 +00:00
Bruno Leroux
e08ad36dd9
Remove LogicalKeySet usage in one Shortcuts example ( #156941 )
...
## Description
This PR replaces `LogicalKeySet` by `SingleActivator` in one of the Shortcuts example.
According to [LogicalKeySet documentation](https://api.flutter.dev/flutter/widgets/LogicalKeySet-class.html ) :
"prefer [SingleActivator](https://api.flutter.dev/flutter/widgets/SingleActivator-class.html ) when possible, whose behavior more closely resembles that of typical platforms".
## Related Issue
Related to [LogicalKeySet Not Working on Linux Environment](https://github.com/flutter/flutter/issues/156806 ).
## Tests
Adds 1 test.
2024-10-16 17:15:06 +00:00
Ildeberto Vasconcelos
ba778dea6d
Add test for AutofillGroup api example ( #156439 )
...
Write Tests for API Examples of `autoffil_group` as part of https://github.com/flutter/flutter/issues/130459
This are tests of snippets used in [AutofillGroup class](https://api.flutter.dev/flutter/widgets/AutofillGroup-class.html )
2024-10-12 13:54:31 +00:00
RamonFarizel
51aa2f5809
Add code sample to the CupertinoMagnifier/CupertinoTextMagnifier ( #156028 )
...
This PR adds code samples regarding the CupertinoMagnifier and CupertinoTextMagnifier
Fixes #154439
2024-10-11 20:53:18 +00:00
Valentin Vignal
96c761c1a6
Add test for animated list example ( #156452 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/animated_list/animated_list.0.dart`
2024-10-10 15:48:17 +00:00
Mitchell Goodwin
d877d2875e
Allow mixing route transitions in one app. ( #150031 )
...
Fixes #33799
Allows for a route to inform the route below it in the navigation stack how to animate when the topmost route enters are leaves the stack.
It does this by making a `DelegatedTransition` available for the previous route to look up and use. If available, the route lower in the stack will wrap it's transition builders with that delegated transition and use it instead of it's default secondary transition.
This is what the sample code in this PR shows an app that is able to use both a Material zoom transition and a Cupertino slide transition in one app. It also includes a custom vertical transition. Every page animates off the screen in a way to match up with the incoming page's transition. When popped, the correct transitions play in reverse.
https://github.com/user-attachments/assets/1fc910fa-8cde-4e05-898e-daad8ff4a697
The below video shows this logic making a pseudo iOS styled sheet transition.
https://github.com/flutter/flutter/assets/58190796/207163d8-d87f-48b1-aad9-7e770d1d96c5
All existing page transitions in Flutter will be overwritten by the incoming route if a `delegatedTransition` is provided. This can be opted out of through `canTransitionTo` for a new route widget. Of Flutter's existing page transitions, this PR only adds a `DelegatedTransition` for the Zoom and Cupertino transitions. The other transitions possible in Material will get delegated transitions in a later PR.
2024-10-02 20:08:11 +00:00
Kostia Sokolovskyi
591cc39c2d
Add WidgetStateMouseCursor example and tests for it. ( #155552 )
...
Fixes https://github.com/flutter/flutter/issues/155551
### Description
- Adds example for `WidgetStateMouseCursor`
- Adds tests for `examples/api/lib/widgets/widget_state/widget_state_mouse_cursor.0.dart`
2024-10-01 23:15:53 +00:00
Taha Tesser
9f88de930b
Optimize Overlay
sample to avoid overflow ( #155861 )
...
Fixes [Optimize official `Overlay` sample to avoid overflowing.](https://github.com/flutter/flutter/issues/155860 )
When checking https://main-api.flutter.dev/flutter/widgets/Overlay-class.html on a laptop screen it overflows as the layout uses Row instead of more robust widget for spacing `Wrap`
Quick Friday night fix. :)
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/user-attachments/assets/eea6f1d9-e860-4ebd-8d16-2d8f4141e1ec " /> | <img src="https://github.com/user-attachments/assets/9f8426ba-d541-44a6-8ea6-2e34636b7e82 " /> |
2024-09-28 09:20:32 +00:00
Kostia Sokolovskyi
ce24dd6a76
Add WidgetStateBorderSide example and tests for it. ( #155559 )
...
Fixes https://github.com/flutter/flutter/issues/155557
### Description
- Adds example for `WidgetStateBorderSide`
- Adds tests for `examples/api/lib/widgets/widget_state/widget_state_border_side.0.dart`
2024-09-25 15:53:28 +00:00
Kostia Sokolovskyi
96ba3c555a
Add WidgetStateProperty
example and tests for it. ( #155315 )
...
This PR contributes to https://github.com/flutter/flutter/issues/155313
### Description
- Adds example for `WidgetStateProperty`
- Adds tests for `examples/api/lib/widgets/widget_state/widget_state_property.0.dart`
2024-09-24 00:31:07 +00:00
Bruno Leroux
dce20c97dd
Fix duplicate MaterialApp in api example test ( #154550 )
...
This PR fixes two tests that created a nested `MaterialApp` (and it simplifies another test).
2024-09-04 06:38:33 +00:00
Mansour Alhaddad
a43c401c67
Add test for error_widget.0_test.dart ( #153103 )
...
Add test for error_widget.0_test.dart which is listed in this issue
related to this issue https://github.com/flutter/flutter/issues/130459
2024-08-26 18:11:02 +00:00
miechoo
b6c14d783a
Test of CustomScrollViewExampleApp ( #152431 )
...
CustomScrollViewExampleApp
Part of https://github.com/flutter/flutter/issues/130459
The test is checking:
- if all crucial Widgets are initially visible
- if IconButton click will expand existing SliverList
- if IconButton click and mouse scroll will reveal additional SliverList
2024-08-23 06:57:28 +00:00
Justin McCandless
420755dcfa
Nested Navigator state restoration predictive back examples ( #153723 )
...
I've updated these two examples to support state restoration of the navigation stack and verified that they work with predictive back in the tests. This was motivated by a worry that users are not properly setting up their navigation and that our examples are misleading them in the name of simplicity.
2024-08-22 03:40:09 +00:00
Valentin Vignal
36a391f689
Add tests for SingleChildScrollView
examples ( #153548 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart`
- `examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart`
I also fixed a mistake in the documentation
2024-08-21 09:45:32 +00:00
Valentin Vignal
ff3ad8290e
Add tests for ordered_traversal_group.0.dart ( #152849 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart`
2024-08-06 02:28:25 +00:00
Valentin Vignal
43da705701
Add test for focus_traversal_group.0.dart ( #151591 )
...
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart`
2024-07-23 07:01:09 +00:00