Skip to content

Support Flutter 3.47 standalone material_ui package in SintMaterialApp#12

Description

@ProZhar

ATTENTION: This space is strictly for proposing architectural evolutions or new capabilities for the Open Neom ecosystem.

馃幆 Pillar Alignment

Which pillar(s) does this feature affect?

  • S (State): Reactive enhancements or state management logic.
  • I (Injection): Dependency registry or lifecycle management.
  • N (Navigation): Routing, middleware, or overlay improvements.
  • T (Translation): Localization engine and dictionary resolution.

Is your feature request related to a problem?

Flutter 3.47 introduced the official standalone material_ui package and
an opt-in migration from:

import 'package:flutter/material.dart';

to:

import 'package:material_ui/material_ui.dart';

SINT 1.6.1 still imports package:flutter/material.dart internally,
including in SintMaterialApp and other public Material-facing APIs.

After running:

dart fix --apply --code=migrate_design_widgets

an application cannot pass the new standalone Material types to
SintMaterialApp, because the old and new classes have the same names
but are different Dart types.

Minimal reproduction

dependencies:
  flutter:
    sdk: flutter
  sint: ^1.6.1
  material_ui: ^1.1.1
import 'package:flutter/widgets.dart';
import 'package:material_ui/material_ui.dart';
import 'package:sint/sint.dart';

void main() {
  runApp(
    SintMaterialApp(
      theme: ThemeData(),
      darkTheme: ThemeData.dark(),
      themeMode: ThemeMode.system,
      initialRoute: '/',
      sintPages: [
        SintPage(
          name: '/',
          page: () => const Scaffold(),
        ),
      ],
    ),
  );
}

This produces type errors similar to:

The argument type 'ThemeData (material_ui)' can't be assigned to
the parameter type 'ThemeData? (flutter/material.dart)'.

The argument type 'ThemeMode (material_ui)' can't be assigned to
the parameter type 'ThemeMode (flutter/material.dart)'.

The same split affects other public SINT APIs that expose legacy
Material types, including theme context extensions and
Sint.changeTheme() / Sint.changeThemeMode().

Expected behavior

SINT should provide a documented way for applications migrated to the
standalone material_ui package to use:

  • SintMaterialApp;
  • material_ui.ThemeData;
  • material_ui.ThemeMode;
  • context theme extensions;
  • theme-changing APIs;
  • Material-related navigation and overlay APIs.

Compatibility consideration

SINT currently supports Flutter >=3.22.0, while standalone
material_ui requires Flutter >=3.44.0.

Migrating SINT's public Material types directly may therefore require:

  1. raising the minimum Flutter version in a breaking release;
  2. providing a separate compatibility package or entry point, such as
    sint_material_ui;
  3. supporting standalone Material in SINT 2.0 while maintaining the
    current branch for older Flutter versions.

A coordinated plan for cupertino_ui may also be needed because SINT
currently exposes legacy Cupertino types as well.

Why MaterialUiCompatibilityBridge is insufficient

MaterialUiCompatibilityBridge can bridge inherited theme and
localization data for legacy widget subtrees, but it cannot solve
compile-time type mismatches in the SintMaterialApp constructor and
other public APIs.

Environment

  • Flutter 3.47
  • Dart 3.13
  • SINT 1.6.1
  • material_ui 1.1.1

References

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions