Skip to content

Commit 230e2c7

Browse files
Merge pull request #23 from codenameakshay/t3code/audit-next-release-improvements
Prepare flutter_floating_bottom_bar 2.1.0 for release
2 parents 574c1d2 + ba0c065 commit 230e2c7

45 files changed

Lines changed: 3609 additions & 824 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fvmrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "stable"
3-
}
2+
"flutter": "3.44.4"
3+
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
verify:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Flutter 3.44.4
18+
uses: subosito/flutter-action@v2
19+
with:
20+
flutter-version: 3.44.4
21+
channel: stable
22+
cache: true
23+
24+
- name: Install package dependencies
25+
run: flutter pub get
26+
27+
- name: Install example dependencies
28+
working-directory: example
29+
run: flutter pub get
30+
31+
- name: Run quality checks
32+
run: make check FLUTTER=flutter DART=dart
33+
34+
- name: Validate pub publish archive
35+
run: flutter pub publish --dry-run

.pubignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ build/
33

44
# Internal planning / spec docs — not part of the published package
55
docs/
6+
.omx/
7+
.claude/
68

79
# IDE settings
810
.vscode/
911

1012
# Development tooling
1113
Makefile
14+
tool/
15+
.github/
16+
AGENTS.md
17+
screenshots/
1218

1319
# FVM (Flutter Version Management) — local toolchain, not needed by consumers
1420
.fvm/

CHANGELOG.md

Lines changed: 132 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,184 @@
1+
## 2.1.0
2+
3+
### Added
4+
5+
- `BottomBarLayout.maxWidth` and `BottomBarLayout.adaptive(maxWidth: ...)` for
6+
width-capped adaptive layouts, plus `copyWith(clearMaxWidth: true)` for
7+
returning a derived layout to an uncapped width.
8+
- `BottomBarBodyPadding` as the built-in way to reserve the live floating-bar
9+
footprint inside `BottomBar.body`.
10+
- `BottomBarScrollBehavior.showAtStart` and
11+
`BottomBarScrollBehavior.showOnScrollEnd` for settling-based visibility
12+
restoration.
13+
14+
### Changed
15+
16+
- `BottomBarScope.barHeight` now reflects the full rendered footprint reserved
17+
by the bar, including configured offset and bottom safe-area when enabled.
18+
- `BottomBarItem` accessible naming is now deterministic:
19+
`semanticLabel` wins, otherwise `tooltip`, otherwise descendant semantics.
20+
Explicit names exclude descendant semantics to avoid duplicate announcements;
21+
items also expose selected/enabled button state, keep a 48x48 minimum target,
22+
and place badges at the directional top-end in both LTR and RTL layouts.
23+
- Custom `BottomBarMotion.transitionBuilder` usage is documented as a
24+
paint-only contract that must preserve layout footprint.
25+
- The hidden action is direction-aware by default: glyph, tooltip, and
26+
semantics flip with `scrollOpposite`, the touch target stays at least 48x48
27+
when active, and the default glyph color follows `ColorScheme.onPrimary`.
28+
- Hidden bar actions are non-interactive and excluded from semantics when the
29+
bar is visible.
30+
- Reduced-motion environments snap directly to the target shown/hidden state
31+
instead of animating.
32+
- `BottomBarController` ownership is strict: double-attach fails in debug and
33+
release, and visibility updates are accepted only from the owning bar.
34+
- `BottomBarController` boundary scrolling now documents and uses explicit
35+
start/end semantics independent of `scrollOpposite`.
36+
37+
### Fixed
38+
39+
- `BottomBarController.scrollToStart()` always targets
40+
`ScrollPosition.minScrollExtent`, and `scrollToEnd()` always targets
41+
`ScrollPosition.maxScrollExtent`.
42+
- `NestedScrollView` boundary scrolling now targets the correct coordinated
43+
controller so start/end actions reset both header and body as expected.
44+
- Large `iconOffset` values keep the hidden action tappable because hit testing
45+
now follows the translated visual position.
46+
- The hidden action's full 48x48 minimum target now accepts taps at its corners;
47+
circular clipping applies only to the animated visual.
48+
- The example web app now uses Flutter's current generated bootstrap and
49+
package-specific, orientation-neutral PWA metadata.
50+
151
## 2.0.2
252

3-
- Fix: `BottomBarController.scrollToStart()` (and the back-to-top icon) did not fully reset a `NestedScrollView` — the collapsed `SliverAppBar`/`FlexibleSpaceBar` stayed collapsed and the list landed below its true top. A `NestedScrollView` scrolls on two coordinated positions (an outer header and an inner body), but the bar only animated the most-recently-active one. The controller now detects an enclosing `NestedScrollView` and drives its shared scroll coordinator with a single call — animating the outer controller to the top (which pulls the inner body up with it) for `scrollToStart`, and the inner controller to the bottom (which collapses the header) for `scrollToEnd`. ([#21](https://github.com/codenameakshay/flutter-floating-bottom-bar/issues/21))
53+
- Fix: `BottomBarController.scrollToStart()` (and the back-to-top icon) did not
54+
fully reset a `NestedScrollView` — the collapsed
55+
`SliverAppBar`/`FlexibleSpaceBar` stayed collapsed and the list landed below
56+
its true top. A `NestedScrollView` scrolls on two coordinated positions (an
57+
outer header and an inner body), but the bar only animated the
58+
most-recently-active one. The controller now detects an enclosing
59+
`NestedScrollView` and drives its shared scroll coordinator with a single
60+
call — animating the outer controller to the top (which pulls the inner body
61+
up with it) for `scrollToStart`, and the inner controller to the bottom
62+
(which collapses the header) for `scrollToEnd`.
63+
([#21](https://github.com/codenameakshay/flutter-floating-bottom-bar/issues/21))
464

565
## 2.0.1
666

7-
- Fix: the back-to-top icon became unclickable when a large `iconOffset` was set. The icon was painted at the offset position but its `SafeArea` ancestor still hit-tested against the original (untranslated) rect, so a large offset moved the visible icon outside its tappable area. The offset now wraps the icon's `SafeArea` so hit-testing follows the painted position. ([#19](https://github.com/codenameakshay/flutter-floating-bottom-bar/issues/19))
67+
- Fix: the back-to-top icon became unclickable when a large `iconOffset` was
68+
set. The icon was painted at the offset position but its `SafeArea` ancestor
69+
still hit-tested against the original (untranslated) rect, so a large offset
70+
moved the visible icon outside its tappable area. The offset now wraps the
71+
icon's `SafeArea` so hit-testing follows the painted position.
72+
([#19](https://github.com/codenameakshay/flutter-floating-bottom-bar/issues/19))
873

974
## 2.0.0
1075

11-
Major release. Breaking changes — see the migration table in README.md and EXAMPLES.md.
76+
Major release. Breaking changes — see the migration table in `README.md`.
1277

1378
Breaking:
14-
- Dart SDK minimum is now `>=3.5.0` because the package uses Motor-backed motion.
15-
- `BottomBar.body` is now `Widget` instead of `Widget Function(BuildContext, ScrollController)`. The bar listens to `ScrollNotification` from any descendant scrollable; you no longer wire a controller through the builder.
16-
- The `barColor`, `width`, `offset`, `borderRadius`, `barAlignment`, `fit`, `clip`, `respectSafeArea` parameters have moved into `BottomBarLayout`.
17-
- The `duration`, `curve`, `start`, `end` parameters have moved into `BottomBarMotion`. `BottomBarMotion()` now defaults to Cupertino spring motion; existing `BottomBarMotion(duration: ..., curve: ...)` calls remain curve-based. `start`/`end` (doubles) are now `slideStart`/`slideEnd` (`Offset`s).
18-
- The `hideOnScroll`, `reverse`, `scrollOpposite`, `scrollDeltaThreshold` parameters have moved into `BottomBarScrollBehavior`. `scrollDeltaThreshold` is now `deltaThreshold`.
19-
- The `iconWidth`, `iconHeight`, `iconDecoration`, `barDecoration` parameters move to `BottomBarThemeData` (per-instance overrides remain via the `theme:` argument).
20-
- `BottomBarScrollControllerProvider` is replaced by `BottomBarScope`. The `scrollController` field is gone; new fields are `barHeight` and `isVisible`.
21-
- The hardcoded `Colors.black` default is replaced with Material 3 `colorScheme.surfaceContainer` for the bar and `colorScheme.primary` for the icon.
79+
80+
- Dart SDK minimum is now `>=3.5.0` because the package uses Motor-backed
81+
motion.
82+
- `BottomBar.body` is now `Widget` instead of
83+
`Widget Function(BuildContext, ScrollController)`. The bar listens to
84+
`ScrollNotification` from any descendant scrollable; you no longer wire a
85+
controller through the builder.
86+
- The `barColor`, `width`, `offset`, `borderRadius`, `barAlignment`, `fit`,
87+
`clip`, and `respectSafeArea` parameters moved into `BottomBarLayout`.
88+
- The `duration`, `curve`, `start`, and `end` parameters moved into
89+
`BottomBarMotion`. `BottomBarMotion()` now defaults to Cupertino spring
90+
motion; existing `BottomBarMotion(duration: ..., curve: ...)` calls remain
91+
curve-based. `start`/`end` (doubles) are now `slideStart`/`slideEnd`
92+
(`Offset`s).
93+
- The `hideOnScroll`, `reverse`, `scrollOpposite`, and
94+
`scrollDeltaThreshold` parameters moved into `BottomBarScrollBehavior`.
95+
`scrollDeltaThreshold` is now `deltaThreshold`.
96+
- The `iconWidth`, `iconHeight`, `iconDecoration`, and `barDecoration`
97+
parameters moved to `BottomBarThemeData` (per-instance overrides remain via
98+
the `theme:` argument).
99+
- `BottomBarScrollControllerProvider` is replaced by `BottomBarScope`. The
100+
`scrollController` field is gone; new fields are `barHeight` and `isVisible`.
101+
- The hardcoded `Colors.black` default is replaced with Material 3
102+
`colorScheme.surfaceContainer` for the bar and `colorScheme.primary` for the
103+
icon.
22104

23105
New:
24-
- Motor-backed Cupertino motion is the default show/hide engine, with velocity-preserving redirection when scroll direction changes mid-animation.
25-
- `BottomBarMotion.cupertino(...)`, `BottomBarMotion.curved(...)`, and `BottomBarMotion.motor(...)` constructors.
106+
107+
- Motor-backed Cupertino motion is the default show/hide engine, with
108+
velocity-preserving redirection when scroll direction changes mid-animation.
109+
- `BottomBarMotion.cupertino(...)`, `BottomBarMotion.curved(...)`, and
110+
`BottomBarMotion.motor(...)` constructors.
26111
- `BottomBarThemeData` `ThemeExtension` for app-wide defaults.
27-
- `BottomBarTransition` enum (`slide`, `fade`, `scale`, `slideAndFade`) plus `BottomBarMotion.transitionBuilder` escape hatch.
112+
- `BottomBarTransition` enum (`slide`, `fade`, `scale`, `slideAndFade`) plus
113+
`BottomBarMotion.transitionBuilder`.
28114
- `BottomBarItem` and `BottomBarItems` helpers for the common nav-item case.
29-
- `BottomBarScope.barHeight` exposes the live rendered bar height to descendants for content-padding purposes.
30-
- `BottomBarScope.isVisible` exposes live visibility without owning a controller.
31-
- Notification-based scroll detection works with `NestedScrollView`, `CustomScrollView`, multiple `TabBarView` children, and any user-supplied `ScrollController` with no wiring.
115+
- `BottomBarScope.barHeight` exposes the live rendered bar height to
116+
descendants for content-padding purposes.
117+
- `BottomBarScope.isVisible` exposes live visibility without owning a
118+
controller.
119+
- Notification-based scroll detection works with `NestedScrollView`,
120+
`CustomScrollView`, multiple `TabBarView` children, and any user-supplied
121+
`ScrollController` with no wiring.
32122
- `BottomBarScrollBehavior.predicate` for filtering unwanted notifications.
33123
- `BottomBarController` now asserts on double-attach in debug.
34124

35125
Repository:
36-
- Package source moved from `packages/flutter_floating_bottom_bar/` to repo root. The example app moved to `example/`. The `packages/` directory is removed.
126+
127+
- Package source moved from `packages/flutter_floating_bottom_bar/` to repo
128+
root. The example app moved to `example/`. The `packages/` directory is
129+
removed.
37130

38131
## 1.4.0
39132

40133
- Upgrade project/tooling for Flutter `3.41.4` development via FVM.
41134
- Update SDK constraints and refresh dependencies.
42-
- Add `BottomBarController` for programmatic `show`, `hide`, `toggle`, `scrollToStart`, and `scrollToEnd`.
135+
- Add `BottomBarController` for programmatic `show`, `hide`, `toggle`,
136+
`scrollToStart`, and `scrollToEnd`.
43137
- Add `onVisibilityChanged` callback for visibility state transitions.
44138
- Add `scrollDeltaThreshold` to reduce flicker from minor scroll movement.
45139
- Add `iconSemanticLabel` and `iconTooltip` for better accessibility.
46140
- Improve internal scroll/visibility handling and test coverage.
47141

48142
## 1.3.0
49143

50-
- Added `respectSafeArea` property to control whether the BottomBar should respect the SafeArea
51-
- Removed deprecated `alignment` property (use `barAlignment` instead)
52-
- Fixed ScrollController issues with multiple attachments
53-
- Improved scroll listener management for better performance
144+
- Added `respectSafeArea` property to control whether the `BottomBar` should
145+
respect the safe area.
146+
- Removed deprecated `alignment` property (use `barAlignment` instead).
147+
- Fixed `ScrollController` issues with multiple attachments.
148+
- Improved scroll listener management for better performance.
54149

55150
## 1.2.1+1
56151

57-
- Fix code formatting
152+
- Fix code formatting.
58153

59154
## 1.2.1
60155

61-
- Update to Flutter v3.22.1
62-
- Fix divider error in example
63-
- Update dependencies
156+
- Update to Flutter `3.22.1`.
157+
- Fix divider error in example.
158+
- Update dependencies.
64159

65160
## 1.2.0
66161

67-
- Add `offset`, `barAlignment`, `barDecoration`, `iconDecoration` properties.
162+
- Add `offset`, `barAlignment`, `barDecoration`, and `iconDecoration`
163+
properties.
68164
- Remove `bottom` property.
69-
- Deperecated `alignment` property, use `barAlignment` instead. `alignment` will be removed in a future release.
70-
- Update all code examples, and fix errors.
165+
- Deprecate `alignment` in favor of `barAlignment`.
166+
- Update all code examples and fix errors.
71167

72168
## 1.1.0
73169

74-
- Add clip property to support clip behavior.
75-
- Add an example for bar with a FAB.
170+
- Add `clip` property to support clip behavior.
171+
- Add an example for a bar with a FAB.
76172

77173
## 1.0.1
78174

79-
- Support for Flutter 3.10.5
80-
- Update dependencies
175+
- Support Flutter `3.10.5`.
176+
- Update dependencies.
81177

82178
## 1.0.0+1
83179

84-
- Add documentation
180+
- Add documentation.
85181

86182
## 1.0.0
87183

88-
- Initial release with basic functionality
184+
- Initial release with basic functionality.

CONTRIBUTING.md

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,60 @@
11
Contributing to Flutter Floating Bottom Bar
2-
==========================
3-
Thanks for your time.
4-
If you'd like to report a bug or join in the development
5-
of Flutter Floating Bottom Bar, then here are some notes on how to do that.
2+
===========================================
63

7-
Please **note** we have a [code of conduct](https://github.com/codenameakshay/flutter-floating-bottom-bar/blob/master/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
4+
Thanks for contributing.
85

9-
## Contents
10-
* [Reporting bugs and opening issues](#reporting-bugs-and-opening-issues)
11-
* [Coding Guidelines](#coding-guidelines)
12-
* [Pull Requests](#pull-requests)
13-
* [MVP architecture](#mvp-architecture)
14-
* [Style Check](#style-check)
15-
* [Git Commit Messages](#git-commit-messages)
16-
* [Security](#security)
17-
18-
## Reporting bugs and opening issues
6+
Please follow the
7+
[code of conduct](https://github.com/codenameakshay/flutter-floating-bottom-bar/blob/main/CODE_OF_CONDUCT.md)
8+
in all project interactions.
199

20-
If you'd like a report a bug or open an issue then please:
10+
## Report bugs and issues
2111

22-
**Check if there is an existing issue.** If there is then please add
23-
any more information that you have, or give it a 👍.
12+
Before opening a new issue:
2413

25-
When submitting an issue please describe the issue as clearly as possible, including how to
26-
reproduce the bug, which situations it appears in, what you expected to happen, and what actually happens.
27-
If you can include a screenshot for front end issues that is very helpful.
14+
- Check whether an existing issue already covers the problem.
15+
- Include clear reproduction steps.
16+
- Include expected behavior, actual behavior, and environment details.
17+
- Add screenshots or screen recordings for UI issues when possible.
2818

29-
## Coding Guidelines
19+
## Local setup
3020

31-
### Pull Requests
32-
We love pull requests, so be bold with them! Don't be afraid of going ahead
33-
and changing something, or adding a new feature. We're very happy to work with you
34-
to get your changes merged into Flutter Floating Bottom Bar
21+
This repo is pinned to Flutter `3.44.4` through FVM.
3522

36-
If you've got an idea for a change then please discuss it in the open first,
37-
either by opening an issue, or email me at [akshaymaurya3006@gmail.com](mailto:akshaymaurya3006@gmail.com).
23+
```bash
24+
fvm install 3.44.4
25+
fvm use 3.44.4
26+
make setup
27+
```
3828

39-
If you're looking for something to work on, have a look at the open issues in the repository [here](https://github.com/codenameakshay/flutter-floating-bottom-bar/issues).
29+
Useful commands:
4030

41-
> We don't have a set format for Pull requests, but we expect you to list changes, bugs generated and other relevant things in PR message.
31+
- `make format` to rewrite Dart formatting.
32+
- `make analyze` to run static analysis for the package and example app.
33+
- `make test` to run tests for the package and example app.
34+
- `make check` to run format check, analyze, and tests together.
35+
- `make publish-dry-run` to validate the package for pub.dev without
36+
publishing.
4237

43-
Refer this pull request [template](https://github.com/codenameakshay/flutter-floating-bottom-bar/blob/master/PULL_REQUEST_TEMPLATE.md).
38+
## Pull requests
4439

45-
### MVP architecture
46-
Flutter Floating Bottom Bar is built keeping [MVP (model-view-presenter)](https://en.wikipedia.org/wiki/Model–view–presenter) architecture in mind, so any changes that are proposed to Flutter Floating Bottom Bar should follow MVP architecture.
40+
- Keep changes small and reviewable.
41+
- Update docs and examples when public behavior changes.
42+
- Add or update tests when behavior changes.
43+
- Run `make check` before opening the PR.
44+
- Run `make publish-dry-run` for release-oriented changes.
45+
- Explain user-visible behavior changes clearly in the PR description.
4746

48-
### Style Check
49-
Flutter Floating Bottom Bar uses `dartfmt` for performing style checks on the codebase, which helps us in maintaining the quality of the code. Please check that the code is properly formatted according to `dartfmt` and also resolve all the issues, if any, shown by `dart analyze` before making a pull request. **Pull Requests will only be merged once all the violations are resolved**.
47+
If you want to propose a larger change, open an issue first so the approach can
48+
be discussed in the open.
5049

51-
### Git Commit Messages
52-
* Use the present tense ("Add feature" not "Added feature")
53-
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
54-
* Limit the first line to 72 characters or less
55-
* Reference issues and pull requests liberally
56-
* When only changing documentation, include `[ci skip]` in the commit description
57-
* Please start your commits with the following prefixes for better understanding among collaborators, based on the type of commit:
58-
```
59-
feat: (addition of a new feature)
60-
rfac: (refactoring the code: optimization/ different logic of existing code - output doesn't change, just the way of execution changes)
61-
docs: (documenting the code, be it readme, or extra comments)
62-
bfix: (bug fixing)
63-
chor: (chore - beautifying code, indents, spaces, camelcasing, changing variable names to have an appropriate meaning)
64-
ptch: (patches - small changes in code, mainly UI, for example color of a button, incrasing size of tet, etc etc)
65-
conf: (configurational settings - changing directory structure, updating gitignore, add libraries, changing manifest etc)
66-
```
50+
## Style and scope
51+
52+
- Prefer the simplest implementation that fully solves the current problem.
53+
- Reuse existing patterns and utilities before adding new ones.
54+
- Remove obsolete paths instead of adding compatibility layers.
55+
- Keep public API docs accurate when contracts change.
56+
57+
## Commit messages
58+
59+
Use clear, imperative commit messages that explain why the change was needed.
60+
Reference relevant issues or PRs when helpful.

0 commit comments

Comments
 (0)