flutter_artist_commons_ui
A core package within the FlutterArtist ecosystem that provides standardized UI widgets, specialized components, and design-system-compliant modal interactions.
This package aims to deliver consistent user interface blocks across enterprise applications, ensuring unified experiences for message notifications, multi-action workflow confirmations, and system alerts.
Purpose & Overview
flutter_artist_commons_ui serves as the shared visual layer for the FlutterArtist ecosystem. By integrating deeply with the framework's core tokens and styling engine, it offers highly reusable layout primitives and dialog management.
Currently, the primary focus of this package revolves around Standardized Dialog Frameworks, providing robust modal wrappers and specialized pre-built variants. Other structural utilities and components are undergoing continuous optimization and will be fully documented as they are stabilized.
Specialized Dialog System
The package defines a powerful foundation through FaDialog alongside structured global helpers to trigger standard multi-platform compliant dialogues.
1. Base Structure: FaDialog
A customizable, responsive wrapper built over standard dialog sheets. It supports integrated support/help hooks, automatic size bounds via content layout optimization, and standardized clear button metrics.
// Standard implementation example
FaDialog(
titleText: "Custom Action Sheet",
iconData: Icons.settings,
preferredContentWidth: 400,
preferredContentHeight: null, // Natural scaling
content: Text("Custom architectural parameters go here..."),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text("Dismiss"),
),
],
);
2. Information Alerts: FaMessageDialog
Handles global notifications with contextual visual identifiers for Info, Success, Warning, and Error categories.
// Display an information alert box
await showMessageDialog(
context: context,
title: "Operation Status",
message: "The background synchronization batch has executed successfully.",
type: FaMessageType.success,
);
3. Workflow Commit Checkers: FaConfirmDialog
Provides fast programmatic APIs to capture double-confirmation workflows, especially critical for destructive mutations.
// General Confirmation check
bool confirmed = await showConfirmDialog(
context: context,
message: "Do you wish to commit these local registry adjustments?",
details: "This operation will apply across current active sessions.",
);
// Targeted Destructive Confirmation
bool deleted = await showConfirmDeleteDialog(
context: context,
details: "This action permanently removes the selected entity from storage.",
);
4. Triple-State Branches: FaYesNoCancelDialog
Complies with international design standards to resolve triple-state choice branching efficiently (Yes / No / Cancel).
YesNoCancel choice = await showYesNoCancelDialog(
context: context,
message: "Do you want to save modifications before exiting the editor?",
details: "Unsaved modifications will be permanently discarded.",
defaultOption: YesNoCancel.yes,
);
switch (choice) {
case YesNoCancel.yes:
// Process persist operations
break;
case YesNoCancel.no:
// Discard and transition
break;
case YesNoCancel.cancel:
// Terminate pipeline lifecycle
break;
}