pub repository
mirror.p-hatan.irmaterial_ui
1.7.0The official Flutter Material UI Library, implementing Google's Material Design design system.
Readme
material_ui
The official Flutter Material Design library, implementing Google's Material Design design system for Flutter applications.
material_ui provides a complete, modern suite of visual components, motion,
typography, color system, and theming tools to build beautiful and accessible
user interfaces on all screen sizes.
See also the
cupertino_ui
package, which is Flutter's official iOS- and macOS-style design library.
New to the package?
Install the package with the following command:
flutter add material_ui
See Flutter's main getting started
guide for information about using Flutter
and material_ui.
Migrating existing code to this package
The standalone material_ui package was previously built directly into the core
Flutter framework as package:flutter/material.dart. It has been decoupled from
the flutter/flutter repository into its
new home here in flutter/packages.
Follow the steps below to migrate:
Step 1: Migrate imports
We've included a data driven Dart fix to help users migrate. Simply run the following command:
dart fix --apply --code=migrate_design_widgets
This performs the equivalent of adding material_ui to your project and
changing imports of package:flutter/material.dart to
package:material_ui/material_ui.dart.
Step 2: Migrate localizations (if needed)
If you are not currently using the GlobalMaterialLocalizations or
GlobalCupertinoLocalizations classes from flutter/flutter's
flutter_localizations package, then you are already good to go. For those that
do need to migrate off of these classes, simply use the new versions of these
classes from material_ui and cupertino_ui, respectively.
A typical app can use the following localization delegate from material_ui to
cover all of the localization strings in Flutter, Material, and Cupertino:
localizationsDelegates: GlobalMaterialLocalizations.delegates,
Step 3: Bridge legacy dependencies (if needed)
If your app uses third-party packages or subtrees that still import and rely on
package:flutter/material.dart, use MaterialUiCompatibilityBridge to bridge
ThemeData and MaterialLocalizations so legacy widgets resolve correctly
within modern widget trees.
Wrap your app using MaterialApp.builder:
import 'package:material_ui/material_ui.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: (BuildContext context, Widget? child) {
return MaterialUiCompatibilityBridge(child: child!);
},
home: const HomeScreen(),
);
}
}
You can also wrap individual subtrees that contain legacy package widgets:
Scaffold(
appBar: AppBar(title: const Text('Modern Screen')),
body: MaterialUiCompatibilityBridge(
child: LegacyPackageWidget(),
),
)
Features
The material_ui package contains everything you need to create a
fully-featured Material app, such as:
- App Structure & Navigation:
MaterialApp,Scaffold,AppBar,NavigationBar,BottomSheet,TabBar,SearchAnchor,SearchBar,Dialog - Buttons & Interaction:
ElevatedButton,TextButton,IconButton,FloatingActionButton,SegmentedButton,InkWell,MenuBar - Inputs & Selection:
TextField,Checkbox,Radio,Switch,Slider,DropdownMenu,DatePicker,TimePicker - Display & Feedback:
Card,Chip,ListTile,Badge,Divider,ProgressIndicator,SnackBar,Tooltip,CarouselView,VerticalDivider - Theming & Color:
ThemeData,ColorScheme,TextTheme, dynamic color generation, Material 3 design tokens, typography, and motion easing curves - Internationalization:
MaterialLocalizationsandGlobalMaterialLocalizationsfor multi-locale support
Changelog
See the Changelog for a list of new features and breaking changes.
Documentation & Resources
Changelog
1.7.0
- Accounts for
MediaQuery'sTextScalerwhen calculatingSnackBaraction overflow and removes unnecessary blank right spacing in multi-line layout. - Allows
TabBar.indicatorWeightof 0 when the indicator is supplied byTabBarThemeData. - Fixes showTimePicker input mode rejecting or misreading hours in locales that use a 24-hour format.
- Adds the
scrollPaddingproperty toDropdownMenuFormField, forwarding it to the underlyingDropdownMenu. - Fixes an Android semantics assertion when an
ExpansionTileis embedded in aWidgetSpan.
1.6.0
- Documents that
TextField.decorationis merged with the ambientInputDecorationThemerather than replacing it. - Fixes unresolved doc comment references.
- Fixes
NavigationIndicatornot repainting when the selected destination changes without pointer interaction. - Removes the unconditional
dart:ioimport fromAboutDialog, so thatmaterial_uiis correctly detected as supporting the web platform andshowAboutDialogno longer throws on the web when no application name is available. - Fix DropdownButtonFormField underline alignment at bottom.
- Fixes floating-point rounding errors when calculating values for discrete
SliderandRangeSlider. - Added
fontFeaturesandfontVariationsparameters toTextTheme.apply().
1.5.0
- Adds Material 3 Expressive support for IconButton.
- Exposes
selectedstate onAutocompleteoption semantics. - Wraps
DrawerHeaderinSemantics(header: true). - Adds
ignorePointertoTooltipThemeDatafor WCAG 1.4.13 Hoverable support. - Fixes decorations on
MenuItemButton.leadingIcon, such asBadge, being clipped to the icon's bounds in vertically expanding menus. - Introduces labelTextDirection property to InputDecoration.
- Adds support for standard, medium, and high contrast Material 3 color scheme baselines.
- Fixes LocalHistoryEntry leak when double tapping Drawer scrim
1.4.0
- Updates minimum supported SDK version to Flutter 3.47/Dart 3.13.
- Adds sortIconBuilder parameter to DataTable, PaginatedDataTable, and DataTableThemeData for custom sorting indicators.
- Fix
PopupMenuButtonnot announcing button semantics (enabled state, expanded state) when built with achildinstead of the default icon. - Fixes
DatePickerThemeData.todayBordercolor being overridden bytodayForegroundColorin the year selector. - Adds an alternative keyboard input method for RangeSlider in NavigationMode.directional.
1.3.0
- Adds
@awaitNotRequiredannotations to asynchronous functions that do not need to be awaited. - Adds an option for
MaterialPageRouteandMaterialPageto opt out of introducing a semantics route scope. - Fixes SliverGeometry maxPaintExtent assertion in CarouselView.weighted
- Corrects the Material 3 default style documentation for FilledButton to match its implementation.
- Adds support for customizing date input formatters via
CalendarDelegate.keyboardInputFormatters, allowing custom date input behavior in the Material date picker. - Adds a semanticLabel to MenuAnchor for the expanded menu overlay.
1.2.0
- Adds the
StyleVariantenum defining the Material 3 and Material 3 Expressive style variants.
1.1.1
- Constrains Slider and RangeSlider value indicator labels to the screen width, truncating with an ellipsis instead of clipping.
- Prevents stale asynchronous suggestions from replacing newer
SearchAnchorresults. - Fix RangeSlider thumb overlay remaining visible after touch interaction
1.1.0
- Add missing Widget of the Week videos to widget API docs.
- Exposes ink_sparkle shader asset in pubspec.yaml and removes stretch_effect shader.
- Fix Typo in Readme
- Fixes typos in library code and tests.
- SearchAnchor overlay expands to full-screen on viewport size change (e.g., on device rotation).
- Fixes https://github.com/flutter/flutter/issues/186154.
1.0.1
- Updates cupertino_ui dependency constraint to ^1.0.0.
1.0.0
- README updated for the full release of material_ui.
- Promotes the pre-release to 1.0.0.
0.0.3+1
- Replace unresolvable doc imports
- Added a main.dart example for the Pub "Example" tab that reference a curated list of existing examples.
0.0.3
- Fix API doc by clearing unsupported directives introduced by macros.
- Fix API doc references.
- Adds MaterialUiCompatibilityBridge for legacy flutter/material.dart compatibility.
0.0.2
- Copies over all Material code from flutter/flutter.
- Copies over Material localizations from flutter/flutter's flutter_localizations package.
- Unpins material_color_utilities.
- Migrates API doc samples and formatting.
- Updates minimum supported SDK version to Flutter 3.44/Dart 3.12.
0.0.1
- Initial setup of the
material_uipackage, preparing for decoupling Material widgets from the Flutter framework.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add material_uipubspec.yaml
name: material_ui
description: The official Flutter Material UI Library, implementing Google's Material Design design system.
version: 1.7.0
repository: https://github.com/flutter/packages/tree/main/packages/material_ui
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A%20material_ui%22
environment:
sdk: ^3.13.0
flutter: ">=3.47.0"
dependencies:
collection: ^1.19.1
cupertino_ui: ^1.0.0
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.20.2
material_color_utilities: ^0.13.0
vector_math: ^2.2.0
dev_dependencies:
args: ^2.7.0
file: ^7.0.1
flutter_goldens:
path: ../../script/flutter_goldens
flutter_test:
sdk: flutter
# To track memory leaks.
leak_tracker_flutter_testing: ^3.0.10
meta: ^1.18.0
path: ^1.9.1
platform: ^3.1.6
flutter:
shaders:
- packages/material_ui/shaders/ink_sparkle.frag
topics:
- ui
- widgets
- material
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | 2026-02-18T16:39:19.221111Z | Download | 47b4acbb50683230000996cedd2a5ea511c2106c818db8ee28155ba0f0e26063 |
| 0.0.2 | 2026-07-22T04:45:51.817280Z | Download | e1fa67393d807bd1841e5ece1ec260ed84f440ae7351e40b6406f733e4fe31cf |
| 0.0.3 | 2026-08-03T17:15:25.447524Z | Download | 849f45c20f47b0e432c603b1f3468e20feb5598e34f9cd3eb0656bbea965ce17 |
| 0.0.3+1 | 2026-08-11T23:33:56.246271Z | Download | ba53669b1fac77c3481ffba90833e2d847f2510faba8781a1bbe11e8f2c71a94 |
| 1.0.0 | 2026-08-12T18:18:43.427045Z | Download | d9b4f6c69b80bc83d0a14357c86e4c14c8076e807ae73cf2960c8560f623995f |
| 1.0.1 | 2026-08-19T19:31:23.403843Z | Download | 4f3f38b9953df0a87d6bf5f21880029f77c47048487d5339410c39936be4683b |
| 1.1.0 | 2026-08-24T16:11:46.867041Z | Download | 7ba1ca315d50a004791dbab290417c52a61466d56db2822fe3c5c2994903110c |
| 1.1.1 | 2026-09-02T16:22:09.095351Z | Download | 9c0156b0cf8b3f56d365c8ffe051a720be3cae9eec55119f01e01b986ffb7101 |
| 1.2.0 | 2026-09-08T17:10:27.285441Z | Download | fbfb53cab6c4629438feeade5f3d305f72944bc9d9f25786b19106d32b80ec45 |
| 1.3.0 | 2026-09-15T16:44:42.351288Z | Download | 6d056d60ce745335fcf1c726a4fc46a481a62229f202b65dbc2db5edbbabc7e2 |
| 1.4.0 | 2026-09-22T00:21:44.380251Z | Download | 134ab2f0843545c4e661e4ba2753fe1bcf0753cb690d5a9ee4870638a40411e9 |
| 1.5.0 | 2026-09-28T16:34:00.787845Z | Download | 32d98f11cf5942a095a8c3e01b03e4de3b17941437713dcf36b1088fb62e23d2 |
| 1.6.0 | 2026-10-06T21:33:04.660303Z | Download | 98ab9eda579ecae623e4b376c603035c5def78ce706f735f30bd632af5814695 |
| 1.7.0 | 2026-10-14T18:39:35.882895Z | Download | 27ea1af251a79728ee63068417f2ab469d294931a9bb8366ba8b85b0ef839060 |
| 1.8.0 | 2026-10-20T15:49:36.208152Z | Download | e4031746f96c8316864d9b92bce375f1320a36ed56e166307e1e1bda9d90b4ab |
| 1.9.0 | 2026-10-29T16:00:37.170057Z | Download | feb289df1e5f9ed9522f9fe3d909432a7f7bc76943f16abad09f80a16cd25196 |
Dependencies
collection "^1.19.1"
cupertino_ui "^1.0.0"
flutter {
"sdk": "flutter"
}
flutter_localizations {
"sdk": "flutter"
}
intl "^0.20.2"
material_color_utilities "^0.13.0"
vector_math "^2.2.0"