FLUTTER ECOSYSTEM

blackmann/overlapping_panels

Discord-inspirierte Navigation für Flutter-Apps

Projektcover von überlappende Panels
Stars
57
Forks
7
Letzter Push (UTC)
13.10.2023
Projektstatus
Aktiv
Degreat GitHub avatar
GITHUB User

Degreat ↗

I can draw. I can't code. 😕

SprachenDart

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 3 Einträge
  • flutter{"sdk":"flutter"}
  • flutter_testEntwicklung{"sdk":"flutter"}
  • flutter_lintsEntwicklung^1.0.0

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

Overlapping Panels Pub

Add Discord-like navigation to your app. Demo project here: overlapping_panels_demo

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:

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:

IconButton(
  icon: const Icon(Icons.menu),
  onPressed: () {
    // This is the main point
    OverlappingPanels.of(context)?.reveal(RevealSide.left);
  },
)