Skip to content

material_ui TextTheme conflict after Flutter/package update - previously working [google_fonts] #191067

Closed
flutter/packages
#13006

Description

@piedcipher

Steps to reproduce

  1. Try to run the following code
  2. Compilation error

Expected results

Expected result: ThemeData.textTheme should accept GoogleFonts.pangolinTextTheme() without a type mismatch, as it did previously.

Actual results

The argument type 'TextTheme' can't be assigned to the parameter type 'TextTheme?'.

Code sample

Code sample
import 'package:material_ui/material_ui.dart';
import 'package:google_fonts/google_fonts.dart';

void main() {
  runApp(
    MaterialApp(
      theme: ThemeData(
        textTheme: GoogleFonts.pangolinTextTheme(),
      ),
      home: const Scaffold(
        body: Center(
          child: Text('Hello'),
        ),
      ),
    ),
  );
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs
The argument type 'TextTheme' can't be assigned to the parameter type 'TextTheme?'. 

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.48.0-1.0.pre-178, on macOS 26.6.1 25G76 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.6)
[✓] Chrome - develop for the web
[✓] Connected device (2 available)
[✓] Network resources                

• No issues found!

Activity

  1. changed the title [-]material_ui TextTheme conflict after Flutter/package update - previously working[/-] [+]material_ui TextTheme conflict after Flutter/package update - previously working [google_fonts][/+] on Aug 13, 2026
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    team-designOwned by Design Languages team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    packageflutter/packages repository. See also p: labels.
    p: google_fontsPackage to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.
    on Aug 13, 2026
  3. mbcorona commented on Aug 13, 2026

    @mbcorona
    Member

    Thanks for the detailed report. Routing to the design team for evaluation.

  4. piedcipher commented on Aug 13, 2026

    @piedcipher
    MemberAuthor

    Thanks for the fast triage!

  5. Piinks commented on Aug 13, 2026

    @Piinks
    Contributor

    The compatibility bridge should be able to help with this, it will map over ThemeData properties to cover the gap for dependencies that have not migrated yet.

    google_fonts needs to be migrated to use the new design packages, we should be able to do that soon.

  6. suhail-121 commented on Aug 15, 2026

    @suhail-121

    But compatibility bridge won't help because it takes modern Theme and converts it to legacy Theme, so maybe we have to do what compatibility bridge does. something like:

    MaterialApp(
          title: AppConfig.appName,
          builder: (context, child) =>
              legacy.Theme(data: AppTheme.lightTheme, child: child!),
        )
    

    hope this works.

  7. Jerome-Jumah commented on Aug 17, 2026

    @Jerome-Jumah

    @Piinks Hey, is this issue currently being worked on? It's my first time here, and I'd be happy to try and help out if it's not a WIP!

  8. removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  9. Segatti commented on Aug 18, 2026

    @Segatti

    I opened the PR, but I’m not sure when it will be approved. If you want to use it, you can add it like this for now:

    google_fonts:
    git:
    url: https://github.com/Segatti/flutter_packages.git
    path: packages/google_fonts

  10. added a commit that references this issue on Aug 19, 2026
  11. 4 remaining items

  12. added
    team-designOwned by Design Languages team
    triaged-designTriaged by Design Languages team
    and removed on Aug 26, 2026
  13. github-actions commented on Oct 12, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Oct 12, 2026
  15. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: google_fontsPackage to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions