Aus öffentlichen Paketdaten erstellte Orientierung.
kf_drawer ist ein Flutter-Paket, das für Anwendungen auf mehreren Plattformen einen anpassbaren Seitenmenü (Drawer) bereitstellt. Es bietet eine saubere, leichte Implementierung für die Navigation mit Unterstützung für verschiedene Anpassungsoptionen wie Breite, Animation und Elementgestaltung. Durch seine einfache Handhabung lässt es sich nahtlos in Flutter-Apps für Android, iOS, Web, macOS, Windows und Linux integrieren. Das Paket ist ideal für Apps, die eine konsistente und reaktionsfähige Navigations-Drawer-Erfahrung benötigen.
Anwendungsfälle
Mobile App-Navigation
Web-Dashboard-Seitenleiste
Menüs für Desktop-Anwendungen
Plattformübergreifende Navigation
Anpassbare Schubladenlayouts
Hauptmerkmale
Plattformübergreifende Kompatibilität
Anpassbare Schubladenbreite
Glatte Animationen
Einfache Integration
Unterstützung für benutzerdefinierte Widgets
Geeignet für
Entwickler, die Multiplattform-Apps erstellen
Teams, die eine konsistente Navigation benötigen
Apps mit komplexen Seitenleistenanforderungen
UI-orientierte Projekte
Schnellprototypen
Hinweise
Eingeschränkte integrierte Themen
Benötigt manuelle Styling für anspruchsvolle Designs
Keine integrierte Dunkelmodus-Unterstützung
Abhängig von der Flutter-Drawer-API
Könnte zusätzliche Zustandsverwaltung benötigen
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
KFDrawer
A dependency-free animated side drawer for Flutter. KFDrawer supports controller
and context-based control, gestures, pinned or centered menus, page history,
right-side drawers, and RTL layouts on every Flutter platform.
Install
dependencies:kf_drawer:^2.1.0
KFDrawer 2.1 supports Dart 3 and Flutter 3.10 or newer. The package is tested
against both its compatibility floor and the current Flutter stable release.
Quick start
Create a controller, give each page item a widget, and place KFDrawer in your
Scaffold body:
footerPinned keeps the footer outside the scrolling item list.
centerScrollableItems centers a shrink-wrapped item list between a fixed
header and footer.
scrollable: false retains the non-scrolling centered column layout.
Right-side and RTL drawers
KFDrawerDirection is logical, so start automatically follows the ambient
text direction:
// Left in LTR, right in RTL (default).KFDrawer(direction: KFDrawerDirection.start)
// Right in LTR, left in RTL.KFDrawer(direction: KFDrawerDirection.end)
Translation, edge dragging, content tap regions, shadow offset, icon padding,
and menu alignment all follow the resolved side.
Dynamic items
Controller changes rebuild the drawer automatically:
drawerController.items = <KFDrawerItem>[...newItems];
drawerController.addItem(newItem);
drawerController.removeItem(oldItem);
drawerController.clearItems();
// If you mutate drawerController.items directly:
drawerController.items.add(newItem);
drawerController.refreshItems();
drawerController.selectItem('settings');
Optional page history and Back handling
KFDrawer swaps page widgets; it does not push Navigator routes. Enable the
lightweight controller history only if this is the behavior your app needs:
Use replacePage to change the current page without adding a history entry and
clearHistory after a navigation reset.
Page item callbacks
When an item has both page and onPressed, KFDrawer now performs both actions:
it selects the page, optionally closes the drawer, and invokes the callback.