Skip to content
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

Add support for Cupertino widgets and all the adaptive widgets #946

Merged
merged 10 commits into from
Oct 21, 2023
Prev Previous commit
Next Next commit
Update documentation code
  • Loading branch information
EchoEllet committed Oct 19, 2023
commit de13169c81ab0e24fdf8ff4ba5f15c3816c41c00
28 changes: 20 additions & 8 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -384,19 +384,28 @@ class _FluentAppState extends State<FluentApp> {
_heroController = HeroController();
}

// Combine the Localizations for Material with the ones contributed
// by the localizationsDelegates parameter, if any. Only the first delegate
// of a particular LocalizationsDelegate.type is loaded so the
// localizationsDelegate parameter can be used to override
// _FluentLocalizationsDelegate.
/// Combine the Localizations for Material, Cupertino with the ones contributed
/// by the localizationsDelegates parameter, if any. Only the first delegate
/// of a particular LocalizationsDelegate.type is loaded so the
/// localizationsDelegate parameter can be used to override
/// _FluentLocalizationsDelegate.
///
/// The default value for the localizationsDelegates
/// ```
/// FluentLocalizations.delegate,
/// DefaultMaterialLocalizations.delegate,
/// DefaultCupertinoLocalizations.delegate,
/// DefaultWidgetsLocalizations.delegate
/// ```
Iterable<LocalizationsDelegate<dynamic>> get _localizationsDelegates sync* {
if (widget.localizationsDelegates != null) {
yield* widget.localizationsDelegates!;
final localizationsDelegates = widget.localizationsDelegates;
if (localizationsDelegates != null) {
yield* localizationsDelegates;
}
yield FluentLocalizations.delegate;
yield GlobalMaterialLocalizations.delegate;
yield GlobalWidgetsLocalizations.delegate;
yield GlobalCupertinoLocalizations.delegate;
yield GlobalWidgetsLocalizations.delegate;
}

bool get _usesRouter =>
Expand Down Expand Up @@ -564,6 +573,9 @@ class _FluentAppState extends State<FluentApp> {
/// See also:
///
/// * [ScrollBehavior], the default scrolling behavior extended by this class.
/// By default we will use [CupertinoScrollbar] for iOS and macOS platforms
/// for windows and Linux [Scrollbar]
/// for Android and Fuchsia we will return the child
class FluentScrollBehavior extends ScrollBehavior {
/// Creates a FluentScrollBehavior that decorates [Scrollable]s with
/// [Scrollbar]s based on the current platform and provided [ScrollableDetails].
Expand Down