flutter/examples/api/test
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
..
animation Add tests for curve2_d.0.dart (#150984) 2024-07-16 10:44:22 +00:00
cupertino Update CupertinoNavigationBar to support large layout (#157133) 2024-10-25 19:08:12 +00:00
gestures Add test for pointer_signal_resolver.0.dart (#157330) 2024-10-23 02:20:40 +00:00
material Create new page transition for M3 (#158881) 2024-12-07 00:56:57 +00:00
painting Add test for star_border.0.dart (#157401) 2024-10-24 05:14:19 +00:00
rendering Add tests for sliver grid delegate with fixed cross axis count examples (#153500) 2024-08-29 21:41:21 +00:00
sample_templates Re-Land "Actually add example templates (#111531)" (#111666) 2022-09-15 16:17:06 +00:00
services Rename Sample classes (#124080) 2023-04-04 20:34:29 +00:00
ui/text Animate TextStyle.fontVariations (#138881) 2023-12-08 09:08:26 +00:00
widgets Test SliverMainAxisGroup offstage child (#159406) 2024-12-11 00:58:59 +00:00
flutter_test_config.dart flutter test --wasm support (#145347) 2024-03-21 20:08:07 +00:00
goldens_io.dart Revert "Allow Flutter golden file tests to be flaky (#114450)" (#114902) 2022-11-08 09:26:55 -08:00
goldens_web.dart Revert "Allow Flutter golden file tests to be flaky (#114450)" (#114902) 2022-11-08 09:26:55 -08:00