quick_dashboard_shortcut 0.0.1
quick_dashboard_shortcut: ^0.0.1 copied to clipboard
A customizable dashboard shortcut grid widget for Flutter (icons/images + optional badge).
quick_dashboard_shortcut #
A Flutter widget to quickly build a dashboard "shortcut" section with a title and a grid of actions (icon or asset image), with optional alert badges.

Features #
- Section title + actions grid
- Control items per row (
crossAxisCount) - Control spacing (
spacing) and tile aspect ratio (childAspectRatio) - Per-item icon or asset image (
icon/imagePath) - Optional alert badge (
alertMessage) with custom color + position + offset - Theme-friendly defaults (uses
colorScheme.onSurfaceas fallback)
Usage #
QuickDashboardShortcut(
title: 'Recommended',
crossAxisCount: 4,
spacing: 8,
childAspectRatio: 1,
iconSize: 36,
actions: const [
QuickShortcutItems(title: 'Mission', icon: Icons.flag_outlined),
QuickShortcutItems(
title: 'Settings',
icon: Icons.settings_outlined,
alertMessage: 'New!',
alertColor: Colors.red,
alertPosition: BadgePosition.topRight,
alertOffset: Offset(0, 2),
),
],
)
Using images #
If you use imagePath, the asset must be declared in your app's pubspec.yaml under flutter/assets and the path must match exactly.
QuickShortcutItems(
title: 'Savings',
imagePath: 'assets/icons/savings.png',
onTap: () {},
)
If the image lives in a package (not your app), pass imagePackage: 'package_name' and make sure that package includes the asset in its own pubspec.yaml.
QuickShortcutItems(
title: 'Shopping',
imagePath: 'assets/icons/cart.png',
imagePackage: 'some_dependency',
)
If an asset fails to load, the widget falls back to a placeholder icon (and prints a debug message in debug builds).
Notes #
- This widget renders a non-scrollable
GridView(shrinkWrap: true,NeverScrollableScrollPhysics). If you have many actions, place the whole page inside aSingleChildScrollVieworCustomScrollView. - If you provide both
imagePathandicon,imagePathtakes precedence.
Contributing #
PRs and issues are welcome (add repository in pubspec.yaml so pub.flutter-io.cn can link to it).