Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

SignInWidget no longer renders using new standalone material_ui: "No Material widget found", "No MaterialLocalizations found"

Aperta
#5,695 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
mobile

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

area: authentication bug
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
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
Image
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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di serverpod/serverpod

Tutte le issue di serverpod/serverpod

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.