Kontextuelles Popup-Menü mit verschiedenen Formen und mehreren Möglichkeiten zur Feinabstimmung von Animation und Position. Die Menüeinträge können fast beliebige Widgets sein.
Aus öffentlichen Paketdaten erstellte Orientierung.
Star Menu ist ein Flutter-Paket, das einen anpassbaren Kontextmenü-Dialog mit Unterstützung für verschiedene Formen, präzise Animationssteuerung und flexible Positionierung bietet. Es ermöglicht Entwicklern, nahezu jedes Widget als Menüeintrag zu verwenden, wodurch reichhaltige interaktive Designs möglich werden. Ideal zur Erstellung intuitiver, visuell ansprechender Menüs in Apps auf mehreren Plattformen, verbessert es die Benutzererfahrung durch flüssige Übergänge und dynamische Layouts. Das Paket ist gut dokumentiert und aktiv gepflegt, was die Integration in bestehende Projekte erleichtert.
Anwendungsfälle
Benutzerdefinierte Kontextmenüs in mobilen Apps
Interaktive Benutzeroberflächenelemente mit animierten Einträgen
A simple way to attach a popup menu to any widget with any widget as menu entries.
Menu entry widgets can bind a sub-menu with different shapes.
Multiple ways to fine-tune animation and position.
Every widgets can be tapped to display a popup menu!
There are currently 3 shapes to choose:
linear: items are lined by a given angle with a given space between them and with a 3-way alignment.
circle: items are lined up in a circle shape with a given radius and a star-end angle.
grid: items are aligned in a grid shape with N columns and a given horizontal and vertical space.
install the package with flutter pub add star_menu
feed the items parameter with the menu entry widgets list
set the params with StarMenuParameters
set the child with a widget you wish to press to open the menu
StarMenu(
params: StarMenuParameters(),
onStateChanged: (state) => print('State changed: $state'),
onItemTapped: (index, controller) {
// here you can programmatically close the menuif (index == 7)
controller.closeMenu();
print('Menu item $index tapped');
}),
items: entries,
child: FloatingActionButton(
onPressed: () {print('FloatingActionButton tapped');},
child: Icon(Icons.looks_one),
),
)
onStateChanged triggers menu state canges:
enumMenuState {
closed,
closing,
opening,
open,
}
items parameter is used when entries are known.
If you want to build items in runtime use lazyItems,
ie when StarMenu is already builded in the widget tree, but the menu items changed: