Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blackmann/overlapping_panels
Discord inspired navigation for Flutter apps
https://github.com/blackmann/overlapping_panels
Last synced: 2 months ago
JSON representation
Discord inspired navigation for Flutter apps
- Host: GitHub
- URL: https://github.com/blackmann/overlapping_panels
- Owner: blackmann
- License: bsd-3-clause
- Created: 2022-01-11T10:10:43.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-13T10:47:43.000Z (about 1 year ago)
- Last Synced: 2024-10-15T03:05:23.132Z (3 months ago)
- Language: Dart
- Size: 7.81 KB
- Stars: 55
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Overlapping Panels [![Pub](https://img.shields.io/pub/v/overlapping_panels.svg)](https://pub.dev/packages/overlapping_panels)
Add Discord-like navigation to your app. Demo project here: [overlapping_panels_demo](https://github.com/blackmann/overlapping_panels_demo)
### TODO
This widget does not support navigation events yet. So pressing the back button, does not slide the `main` panel back into view. This feature will be implemented in the nearest future.
### Usage
Simple and straight to the point. Just provide usual widgets for all panels:
```dart
class _MyHomePageState extends StatelessWidget {@override
Widget build(BuildContext context) {
return Stack(
children: [
OverlappingPanels(
// Using the Builder widget is not required. You can pass your widget directly.
// But to use `OverlappingPanels.of(context)` you need to wrap your widget in a Builder
left: Builder(builder: (context) {
return const LeftPage();
}),
right: Builder(
builder: (context) => const RightPage(),
),
main: Builder(
builder: (context) {
return const MainPage();
},
),
onSideChange: (side) {
setState(() {
if (side == RevealSide.main) {
// hide something
} else if (side == RevealSide.left) {
// show something
}
});
},
),
],
);
}
}
```To be able to reveal a panel with the tap of a button, for example, do:
```dart
IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
// This is the main point
OverlappingPanels.of(context)?.reveal(RevealSide.left);
},
)
```