Skip to content

Migrate the Flutter samples to material_ui - #26

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
UdeshAthukorala:migrate-flutter-material-ui
Nov 12, 2026
Merged

brionmario merged 1 commit into
thunder-id:mainfrom
UdeshAthukorala:migrate-flutter-material-ui

Conversation

@UdeshAthukorala

@UdeshAthukorala UdeshAthukorala commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Flutter 3.50.0 deprecates package:flutter/material.dart in favor of the standalone material_ui package. flutter analyze reports each import as an issue, so the 🦋 Analyze & Build jobs for quickstarts/flutter and integrations/flutter-app-auth fail on every pull request. Flutter 3.50.0 also requires Gradle 9.3.1, Android Gradle Plugin 9.1.1 and Kotlin Gradle Plugin 2.4.10 or later, so the Android builds fail too. This migrates both samples to material_ui and to the Flutter 3.50 Android toolchain.

Approach

  • Replaced package:flutter/material.dart with package:material_ui/material_ui.dart in both samples, the same change dart fix --apply --code=migrate_design_widgets makes, and kept the package imports sorted.
  • Added material_ui: ^1.11.0 to both pubspecs. It requires Flutter 3.47 and Dart 3.13, so the environment constraints and the README prerequisites now say Flutter 3.47 or later.
  • quickstarts/flutter renders thunderid_flutter widgets (SignIn, SignUp, UserProfile, UserAvatar, ChangeCredential, BaseSignOutButton), which still build on package:flutter/material.dart. Wrapped the app in MaterialUiCompatibilityBridge through MaterialApp.builder, as the material_ui migration guide describes, so those widgets resolve the app's theme and localizations. material_ui marks the bridge itself as deprecated, as a temporary migration utility, so that line carries an ignore: deprecated_member_use until thunderid_flutter moves to material_ui. integrations/flutter-app-auth renders only its own widgets and does not need the bridge.
  • The bridge maps only the theme and localizations. The thunderid_flutter text fields and ink effects also need a Material ancestor from package:flutter/material.dart, and the material_ui bottom sheet now provides a material_ui Material instead, so the sign-in sheet failed with No Material widget found. Added a small LegacyMaterial wrapper (a transparent legacy Material) around the surfaces that host those widgets: the sign-in and sign-up sheet, the Manage Account sections and ProfileScreen.
  • Moved both Android projects to the versions in the Flutter 3.50.0 app template: Gradle 9.5.0, Android Gradle Plugin 9.3.1 and Kotlin Gradle Plugin 2.4.20. Added the template's android.newDsl=false and android.builtInKotlin=false flags to gradle.properties, and replaced the kotlinOptions block with kotlin { compilerOptions }.
  • Android Gradle Plugin 9 merges the Flutter assets through its own asset pipeline, whose default ignore pattern drops every dotfile, so the quickstart's bundled .env was left out of the APK and the app failed at startup. Set androidResources.ignoreAssetsPattern to that default without .*.
  • Dependency Review rejects material_ui because the dependency graph reports its BSD-3-Clause license with the non-SPDX lowercase id bsd-3-clause. Added pkg:pub/material_ui to allow-dependencies-licenses in pr-builder.yml, next to thunderid_flutter, which is allowed for the same reason.
  • integrations/flutter-app-auth/pubspec.lock is not regenerated in this change. flutter pub get adds material_ui to it on the next run.

Verification: all PR Builder checks pass, including flutter analyze and flutter build apk --debug for both Flutter samples and Dependency Review. Ran quickstarts/flutter with Flutter 3.50.0 on an Android emulator against a local ThunderID server: the sign-in sheet renders, sign-in completes to the home screen, and Manage Account > Security > Change Password renders its form, with no Material errors in the log.

Screenshots

Sign-in sheet, home screen after sign-in, and Change Password on an Android emulator:

Related Issues

  • N/A

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@UdeshAthukorala
UdeshAthukorala force-pushed the migrate-flutter-material-ui branch from 65aa9fe to 75cff47 Compare November 12, 2026 06:18
Signed-off-by: UdeshAthukorala <udeshathukorala@gmail.com>
@UdeshAthukorala
UdeshAthukorala force-pushed the migrate-flutter-material-ui branch from a9ae6f8 to 54320ea Compare November 12, 2026 09:12
@UdeshAthukorala
UdeshAthukorala marked this pull request as ready for review November 12, 2026 09:37
@brionmario
brionmario merged commit 464a18d into thunder-id:main Nov 12, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants