Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
g-apparence committed Apr 3, 2023
1 parent bb5890a commit 2464309
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Bart include 4 ways to display a bottom bar:
BartBottomBar.cupertino() // iOS look.
BartBottomBar.material3() // Android look.
BartBottomBar.adaptive() // automatically select between cupertino & material depending on the device.
BartBottomBar.custom() // your how design
BartBottomBar.custom() // your own design
```

To custom the bottom bar, simply extends `BartBottomBarCustom` and create your own bottom bar like `SimpleBottomBar`(in example project). <br/>
Expand Down Expand Up @@ -210,6 +210,33 @@ Actions.invoke(context,AppBarAnimationIntent.show());
Actions.invoke(context,AppBarAnimationIntent.hide());
```

## 🫥&nbsp; Show/hide bottom bar
Sometimes you wants to hide the bottom menu bar.
As this is possible for the appbar you can use a mixin for that.
It just require to be called from a sub context of the BartScaffold.

```dart
Actions.invoke(context, BottomBarIntent.show());
Actions.invoke(context, BottomBarIntent.hide());
```

Or use the mixin
```dart
class MyPage extends StatelessWidget with BartNotifier {
const MyPage({ Key? key }) : super(key: key);
@override
Widget build(BuildContext context) {
// directly show the bottom bar
showBottomBar(context);
// directly hide the bottom bar
hideBottomBar(context);
return Container();
}
}
```


## 💫&nbsp; Transitions between items

You can use the official [**animation plugin**](https://pub.dev/packages/animations) to create better transition or create your owns.
Expand Down
2 changes: 1 addition & 1 deletion example/lib/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class _MainPageMenuState extends State<MainPageMenu> {
Widget build(BuildContext context) {
return BartScaffold(
routesBuilder: widget.routesBuilder,
showBottomBar: true,
showBottomBarOnStart: true,
bottomBar: BartBottomBar.material(),
// bottomBar: BartBottomBar.custom(
// bottomBarFactory: SimpleBottomBar(),
Expand Down
4 changes: 2 additions & 2 deletions lib/bart/bart_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class BartScaffold extends StatefulWidget {
required this.routesBuilder,
this.initialRoute,
this.scaffoldOptions,
bool showBottomBar = true,
bool showBottomBarOnStart = true,
}) : appBarNotifier = ValueNotifier(null),
showAppBarNotifier = ValueNotifier(false),
showBottomBarNotifier = ValueNotifier(showBottomBar),
showBottomBarNotifier = ValueNotifier(showBottomBarOnStart),
super(key: key);

@override
Expand Down

0 comments on commit 2464309

Please sign in to comment.