|
| 1 | +## [2.0.0] |
| 2 | + |
| 3 | +**Breaking** — bart now builds on the `material_ui` / `cupertino_ui` packages |
| 4 | +instead of `package:flutter/material.dart` and `package:flutter/cupertino.dart`, |
| 5 | +following the Flutter 3.44+ split of Material and Cupertino out of the framework. |
| 6 | + |
| 7 | +### Why this is breaking |
| 8 | + |
| 9 | +The Flutter SDK still ships its own complete Material library, so |
| 10 | +`flutter/src/material/material.dart#Material` and |
| 11 | +`material_ui/src/material.dart#Material` are two *distinct* Dart types that both |
| 12 | +print as `Material`. Material lookups match on the exact runtime type |
| 13 | +(`debugCheckHasMaterial` uses `findAncestorWidgetOfExactType<Material>`), so a |
| 14 | +`Scaffold` from one library can never satisfy an `InkWell` from the other. |
| 15 | + |
| 16 | +Apps on `material_ui` that mounted a `BartScaffold` therefore hit |
| 17 | +`No Material widget found.` on every `InkWell`, `Ink`, `ListTile`, `TextField`, |
| 18 | +`IconButton`, `Chip`, `TabBar` (and friends) inside a tab — in debug via the |
| 19 | +assertion, and in release too for `Ink`, which resolves `Material.of` during |
| 20 | +build. The same applied one layer down to `CupertinoTabBar`, which needs the |
| 21 | +`CupertinoLocalizations` of whichever cupertino library declares it. |
| 22 | + |
| 23 | +### Migrating |
| 24 | + |
| 25 | +- Your app must now depend on `material_ui` and import |
| 26 | + `package:material_ui/material_ui.dart` rather than |
| 27 | + `package:flutter/material.dart`. Mixing the two in one widget tree reproduces |
| 28 | + the bug in the opposite direction. |
| 29 | +- `enum Theme` is renamed to `enum BartBottomBarStyle`. The old name collided |
| 30 | + with material_ui's `Theme` widget whenever `package:bart/bart.dart` was |
| 31 | + imported without a prefix. The `BartBottomBar.material()` / `.material3()` / |
| 32 | + `.cupertino()` / `.adaptive()` / `.custom()` factories are unchanged, so most |
| 33 | + apps need no edit here. |
| 34 | +- Minimum constraints raised to Dart 3.12 / Flutter 3.44. |
| 35 | + |
| 36 | +### Also in this release |
| 37 | + |
| 38 | +- Files that never needed Material now import `package:flutter/widgets.dart` |
| 39 | + directly, so bart no longer leaks a Material dependency into parts of its API |
| 40 | + that do not use one. |
| 41 | +- Added `test/material_ancestor_test.dart`, which mounts material_ui `InkWell`, |
| 42 | + `Ink` and `ListTile` inside a bart tab and asserts no Material assertion is |
| 43 | + raised, plus a Cupertino localizations case. These fail on 1.x and pass on 2.0.0. |
| 44 | + |
1 | 45 | ## [1.4.0] |
2 | 46 |
|
3 | 47 | - add BartMenuRoute.bottomBarBuilder isActive property to builder |
|
0 commit comments