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

When used under the coupertino app, the login box cannot be displayed. #485

Open
welkang opened this issue Mar 2, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@welkang
Copy link

welkang commented Mar 2, 2024

Describe the bug
When used under the coupertino app, the login box cannot be displayed.

To Reproduce
CupertinoApp(
navigatorKey: navigatorKey,
...
)

Expected behavior
I hope it will have the same effect as using it in the material app.

Screenshots
image

Information (please complete the following information):

  • Device: [iPhone15]
  • Platform [mobile]
    Flutter 3.16.5 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 78666c8dc5 (2 months ago) • 2023-12-19 16:14:14 -0800
    Engine • revision 3f3e560236
    Tools • Dart 3.2.3 • DevTools 2.28.4
  • Package version [5.0.0]

Additional context
Add any other context about the problem here.

@welkang welkang added the bug Something isn't working label Mar 2, 2024
@welkang
Copy link
Author

welkang commented Mar 2, 2024

That seems to be the problem:
image

There are two ways to solve this problem,either through an ancestor MaterialApp (that automatically provides Localizations), or by creating your own Localizations widget.

In a situation like mine, we can solve it by method two.

  @override
  Widget build(BuildContext context) {
    return Localizations(
      locale: const Locale('en', 'US'),
      delegates: const <LocalizationsDelegate<dynamic>>[
        DefaultWidgetsLocalizations.delegate,
        DefaultMaterialLocalizations.delegate,
      ],
      child: FlutterLogin(
        ... 
      ),
    );
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant