Repository navigation
Description
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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsPlanned 🔭
Activity
marcelomendoncasoares commentedon Sep 10, 2026
Hi @jamesncl! Unfortunately this can't be fixed on
3.4.xbecausematerial_uiis only available from Dart>=3.12and3.4.xstill supports Dart>=3.10. This is fixed, however, on the latest4.0.0pre-release (currently RC.2), so you won't need the workaround after4.0.0is officially released next week! If you're starting a project right now, it is worth starting from the RC.2 since the official release is only a couple days away.vchrisb commentedon Sep 29, 2026
@marcelomendoncasoares in serverpod
4.0.3all widgets still useimport 'package:flutter/material.dart';and hence not the standalone material_ui package.Do I maybe misread your comment?
marcelomendoncasoares commentedon Sep 29, 2026
@vchrisb Sorry, it was my confusion closing the issue. What was fixed then was the possibility of using
material_uion the template because we bumped Dart to ^3.12 on Serverpod 4.0.0-rc.2 precisely to allow this. However, the change to the widgets was still to be done, and ended up not landing. I'll reopen the issue for us to find a non-breaking way of fixing it.