Repository navigation
Profile: let the language picker sheet grow and scroll instead of ove… #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abdulsaheel
merged 2 commits into
OpenStrap:main
from
Riedel-David:fix/language-sheet-overflow
Oct 30, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // The language picker used to overflow its bottom sheet (capped at 9/16 of the | ||
| // screen) once the list grew past what fits. It must lay out without an | ||
| // overflow on a short screen, and every language must stay reachable. | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:provider/provider.dart'; | ||
| import 'package:shared_preferences/shared_preferences.dart'; | ||
|
|
||
| import 'package:openstrap_edge/l10n/app_localizations.dart'; | ||
| import 'package:openstrap_edge/state/locale_controller.dart'; | ||
| import 'package:openstrap_edge/ui2/profile/profile.dart'; | ||
| import 'package:openstrap_edge/ui2/ui2.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('language sheet scrolls on a short screen and selects the last language', | ||
| (tester) async { | ||
| SharedPreferences.setMockInitialValues({}); | ||
| tester.view.physicalSize = const Size(360, 560); | ||
| tester.view.devicePixelRatio = 1; | ||
| addTearDown(tester.view.reset); | ||
|
|
||
| final ctrl = LocaleController.seed(null); | ||
| await tester.pumpWidget(ChangeNotifierProvider<LocaleController>.value( | ||
| value: ctrl, | ||
| child: MaterialApp( | ||
| theme: buildTheme(Brightness.dark), | ||
| localizationsDelegates: AppLocalizations.localizationsDelegates, | ||
| supportedLocales: AppLocalizations.supportedLocales, | ||
| home: const ProfileHomeView(stats: ProfileStats(name: 'Sahil')), | ||
| ), | ||
| )); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| await tester.tap(find.text('System default').first); | ||
| await tester.pumpAndSettle(); | ||
| expect(tester.takeException(), isNull, reason: 'sheet must not overflow'); | ||
|
|
||
| final last = find.text('中文'); | ||
| await tester.ensureVisible(last); | ||
| await tester.pumpAndSettle(); | ||
| await tester.tap(last); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| expect(ctrl.code, 'zh'); | ||
| expect(find.text('Deutsch'), findsNothing, reason: 'sheet should be dismissed'); | ||
| }); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.