Skip to content

Commit e9eac69

Browse files
committed
upgrade to flutter 3.37
1 parent cbfe3c0 commit e9eac69

34 files changed

Lines changed: 415 additions & 113 deletions

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
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+
145
## [1.4.0]
246

347
- add BartMenuRoute.bottomBarBuilder isActive property to builder

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,26 @@
4949
### Install the package
5050

5151
```sh
52-
flutter pub add bart
52+
flutter pub add bart material_ui
5353
```
5454

55+
Since **2.0.0**, bart builds on the [`material_ui`](https://pub.dev/packages/material_ui)
56+
and [`cupertino_ui`](https://pub.dev/packages/cupertino_ui) packages rather than
57+
`package:flutter/material.dart`, following the Flutter 3.44+ split of Material out
58+
of the framework. Requires Dart 3.12 / Flutter 3.44 or newer.
59+
60+
> **Upgrading from 1.x?** Your app must import `package:material_ui/material_ui.dart`
61+
> instead of `package:flutter/material.dart`. The SDK still ships its own Material
62+
> library, and the two `Material` types are *not* interchangeable — mixing them
63+
> yields a confusing `No Material widget found.` on widgets that plainly sit under a
64+
> `Scaffold`. See the [CHANGELOG](CHANGELOG.md) for the full rationale.
65+
> `enum Theme` is also renamed to `enum BartBottomBarStyle`.
66+
5567
### Import the package
5668

5769
```dart
5870
import 'package:bart/bart.dart';
71+
import 'package:material_ui/material_ui.dart';
5972
```
6073

6174
## 🚀&nbsp; Get started

analysis_options.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77

88
# The following line activates a set of recommended lints for Flutter apps,
99
# packages, and plugins designed to encourage good coding practices.
10+
analyzer:
11+
exclude:
12+
- build/**
13+
- android/**
14+
- ios/**
15+
- web/**
16+
- windows/**
17+
- macos/**
18+
- linux/**
1019
include: package:flutter_lints/flutter.yaml
1120

1221
linter:

example/analysis_options.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77

88
# The following line activates a set of recommended lints for Flutter apps,
99
# packages, and plugins designed to encourage good coding practices.
10+
analyzer:
11+
exclude:
12+
- build/**
13+
- android/**
14+
- ios/**
15+
- web/**
16+
- windows/**
17+
- macos/**
18+
- linux/**
1019
include: package:flutter_lints/flutter.yaml
1120

1221
linter:

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:flutter/material.dart';
1+
import 'package:material_ui/material_ui.dart';
22

33
import 'navigation.dart';
44

example/lib/navigation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:bart/bart.dart';
22
import 'package:example/routes.dart';
33
import 'package:example/widgets/simple_bottom_bar.dart';
4-
import 'package:flutter/material.dart';
4+
import 'package:material_ui/material_ui.dart';
55

66
class MainPageMenu extends StatelessWidget {
77
const MainPageMenu({Key? key}) : super(key: key);

example/lib/routes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:animations/animations.dart';
22
import 'package:bart/bart.dart';
33
import 'package:example/tabs/fake_list.dart';
44
import 'package:example/tabs/page_counter.dart';
5-
import 'package:flutter/material.dart';
5+
import 'package:material_ui/material_ui.dart';
66

77
import 'tabs/home_page.dart';
88

example/lib/tabs/fake_list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:flutter/material.dart';
1+
import 'package:material_ui/material_ui.dart';
22

33
class FakeListPage extends StatelessWidget {
44
const FakeListPage({Key? key}) : super(key: key);

example/lib/tabs/home_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:bart/bart/bart_bottombar_actions.dart';
2-
import 'package:flutter/material.dart';
2+
import 'package:material_ui/material_ui.dart';
33

44
import 'package:bart/bart.dart';
55

example/lib/tabs/page_counter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:bart/bart/bart_appbar.dart';
2-
import 'package:flutter/material.dart';
2+
import 'package:material_ui/material_ui.dart';
33

44
class PageFakeCounter extends StatefulWidget {
55
final bool showAppBar;

0 commit comments

Comments
 (0)