SignInWidget no longer renders using new standalone material_ui: "No Material widget found", "No MaterialLocalizations found"
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by reproducing the issue with Flutter 3.47 and the standalone material_ui package, then inspect serverpod_auth_idp_flutter's lib/src/common/widgets/text_field.dart, named in the error. Check how SignInWidget provides the Material widget and localization dependencies. Done means SignInWidget renders without the compatibility bridge or the reported exceptions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When using Flutter 3.47's new material_ui package structure, SignInWidget from serverpod_auth_idp_flutter no longer renders, with the following error:
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building TextField(controller:
TextEditingController#81f05(TextEditingValue(text: ┤├, selection: TextSelection.invalid, composing:
TextRange(start: -1, end: -1))), enabled: true, decoration: InputDecoration(labelText: "Email",
contentPadding: EdgeInsets(12.0, 14.0, 12.0, 14.0), border: OutlineInputBorder()), keyboardType:
TextInputType(name: TextInputType.emailAddress, signed: null, decimal: null), dirty, dependencies:
[MediaQuery, UnmanagedRestorationScope], state: _TextFieldState#f7467):
No Material widget found.
TextField widgets require a Material widget ancestor within the closest LookupBoundary.
In Material Design, most widgets are conceptually "printed" on a sheet of material. In Flutter's
material library, that material is represented by the Material widget. It is the Material widget
that renders ink splashes, for instance. Because of this, many material library widgets require that
there be a Material widget in the tree above them.
To introduce a Material widget, you can either directly include one, or use a widget that contains
Material itself, such as a Card, Dialog, Drawer, or Scaffold.
The specific widget that could not find a Material ancestor was:
TextField
The ancestors of this widget were:
...
CustomTextField
EmailTextField
Column
Expanded
Column
...The relevant error-causing widget was:
TextField
TextField:file:///Users/me/.pub-cache/hosted/pub.dev/serverpod_auth_idp_flutter-3.4.13/lib/src/common/widgets/text_field.dart:44:12
You can work around this by importing package:flutter/material.dart instead of package:material_ui/material_ui.dart in the dart file where SignInWidget is used. However you then encounter a futher error:
No MaterialLocalizations found.
TextField widgets require MaterialLocalizations to be provided by a Localizations widget ancestor.
You can work around this by using the temporary MaterialUiCompatibilityBridge workaround documented in material_ui, however this is already deprecated and will be removed at some point in the future:
MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF6750A4)),
),
builder: (BuildContext context, Widget? child) {
return MaterialUiCompatibilityBridge(child: child!);
},
home: const HomeScreen(),
)
To reproduce
- Upgrade to Flutter 3.47
- New minimal Flutter app project with serverpod including latest serverpod_auth_idp_flutter
- migrate to the new standalone material_ui package structure
- Add SignInWidget to any page
Expected behavior
I would expect to be able to use SignInWidget with the latest version of flutter without resorting to workarounds
Library version
3.4.13
Platform information
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.47.3, on macOS 26.6 25G72 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.6)
[✓] Chrome - develop for the web
[✓] Connected device (2 available)
! Error: Browsing on the local area network for Test user’s iPhone. Ensure the device is unlocked and attached with a cable or
associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources• No issues found!
Additional context
How experienced are you with this library?
Intermediate - Familiar with the basics or have used it in a few projects
Are you interested in working on a PR for this?
- I want to work on this
- Lingua principale
- Dart
- Stelle
- 3.3k
- Fork
- 382
- Merge medio
- 2g 4h
- PR unite (30g)
- 62
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di serverpod/serverpod
-
area: templates bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
create-repair-migration should print the server address it connects toForse già presa @mackings l’ha presa 14 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
serverpod/serverpod#5849 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
FallbackMiddleware condition can't inspect the requestForse di nuovo libera @mackings l’ha presa 15 giorni fa e non c’è nessuna pull request aperta. Apertaarea: web server enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
serverpod/serverpod#5829 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: configuration area: runtime
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
serverpod/serverpod#3749 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
area: cli enhancement stake: onboarding
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di serverpod/serverpod
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
fossasia/badgemagic-app#2016 ·
I maintainer di solito rispondono entro 1 giorno
-
bug P3 ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
QueryaHub/Querya-Desktop#1837 ·
I maintainer di solito rispondono entro 1 giorno
-
direct-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aaronified/fluenough#849 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PATILYASHH/XPENC#179 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno