CodeMeltedUI class

Provides a set of utility methods to build a Graphical User Interface (GUI) for a Single Page Application (SPA). This design paradigm does not preclude you from utilize Flutter's vast array of widgets. It simple provides the SPA construct, dialog utility, and a wrapper for the most common of widgets. Theming is also provides to allow for creating different themes for your SPA.

Constructors

CodeMeltedUI()
Sets up the internal instance for this object.
factory

Properties

app Widget
Accesses a Single Page Application (SPA) for the overall module. This is called after being configured via the appXXX functions in the runApp of the main().
no setter
appDarkTheme ThemeData?
Sets the CodeMeltedUI.app dark theme.
no getter
appTheme ThemeData?
Sets the CodeMeltedUI.app light theme.
no getter
appThemeMode ThemeMode
Sets the CodeMeltedUI.app theme mode.
no getter
appTitle String?
Sets / removes the CodeMeltedUI.app title.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

appCloseDrawer() → void
Closes the CodeMeltedUI.app drawer or end drawer.
appContent({required Widget? body, bool extendBody = false, bool extendBodyBehindAppBar = false}) → void
Sets / removes the CodeMeltedUI.app content area.
appDrawer({Widget? header, List<Widget>? items}) → void
Sets / removes the CodeMeltedUI.app drawer.
appEndDrawer({Widget? header, List<Widget>? items}) → void
Sets / removes the CodeMeltedUI.app end drawer.
appFloatingActionButton({Widget? button, FloatingActionButtonLocation? location}) → void
Sets / removes the CodeMeltedUI.app floating action button.
appFooter({List<Widget>? actions, bool automaticallyImplyLeading = true, bool forceMaterialTransparency = false, Widget? leading, AppBarTheme? style, Widget? title}) → void
Sets / removes the CodeMeltedUI.app footer area.
appHeader({List<Widget>? actions, bool automaticallyImplyLeading = true, bool forceMaterialTransparency = false, Widget? leading, AppBarTheme? style, Widget? title}) → void
Sets / removes the CodeMeltedUI.app header area.
appOpenDrawer({bool isEndDrawer = false}) → void
Opens the CodeMeltedUI.app drawer or end drawer.
dlgAbout({Widget? appIcon, String? appName, String? appVersion, String? appLegalese}) Future<void>
Will display information about your flutter app.
dlgAlert({required String message, double? height, String? title, double? width}) Future<void>
Provides a simple way to display a message to the user that must be dismissed.
dlgBrowser({required String url, double? height, String? title, bool useNativeBrowser = false, double? width}) Future<void>
Shows a browser popup window when running within a mobile or web target environment.
dlgChoose({required String title, required List<String> options}) Future<int>
Shows a popup dialog with a list of options returning the index selected or -1 if canceled.
dlgClose<T>([T? answer]) → void
Closes an open dialog and returns an answer depending on the type of dialog shown.
dlgConfirm({required String message, double? height, String? title, double? width}) Future<bool>
Provides a Yes/No confirmation dialog with the displayed message as the question. True is returned for Yes and False for a No or cancel.
dlgCustom<T>({required Widget content, required String title, List<Widget>? actions, double? height, double? width}) Future<T?>
Shows a custom dialog for a more complex form where at the end you can apply changes as a returned value if necessary. You will make use of CodeMeltedUI.dlgClose for returning values via your actions array.
dlgLoading<T>({required String message, required Future<void> task(), double? height, String? title, double? width}) Future<T?>
Provides the ability to run an async task and present a wait dialog. It is important you call CodeMeltedUI.dlgClose to properly clear the dialog and return any value expected.
dlgPrompt({required String title}) Future<String>
Provides the ability to show an input prompt to retrieve an answer to a question. The value is returned back as a string. If a user cancels the action an empty string is returned.
dlgSnackbar({required Widget content, SnackBarAction? action, Clip clipBehavior = Clip.hardEdge, int? seconds}) → void
Shows a snackbar at the bottom of the content area to display information.
getAppState<T>({required String key}) → T
Provides the ability to get items from the global app state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAppState<T>({required String key, required T value}) → void
Provides the ability to set items on the global app state.
themeCreate({ActionIconThemeData? actionIconTheme, AppBarTheme? appBarTheme, BadgeThemeData? badgeTheme, MaterialBannerThemeData? bannerTheme, BottomAppBarTheme? bottomAppBarTheme, BottomNavigationBarThemeData? bottomNavigationBarTheme, BottomSheetThemeData? bottomSheetTheme, Brightness? brightness, ButtonThemeData? buttonTheme, CardTheme? cardTheme, CheckboxThemeData? checkboxTheme, ChipThemeData? chipTheme, ColorScheme? colorScheme, DataTableThemeData? dataTableTheme, DatePickerThemeData? datePickerTheme, DividerThemeData? dividerTheme, DialogTheme? dialogTheme, DrawerThemeData? drawerTheme, DropdownMenuThemeData? dropdownMenuTheme, ElevatedButtonThemeData? elevatedButtonTheme, ExpansionTileThemeData? expansionTileTheme, FilledButtonThemeData? filledButtonTheme, FloatingActionButtonThemeData? floatingActionButtonTheme, IconButtonThemeData? iconButtonTheme, IconThemeData? iconTheme, InputDecorationTheme? inputDecorationTheme, ListTileThemeData? listTileTheme, MaterialTapTargetSize? materialTapTargetSize, MenuBarThemeData? menuBarTheme, MenuButtonThemeData? menuButtonTheme, MenuThemeData? menuTheme, NavigationBarThemeData? navigationBarTheme, NavigationDrawerThemeData? navigationDrawerTheme, NavigationRailThemeData? navigationRailTheme, OutlinedButtonThemeData? outlinedButtonTheme, PageTransitionsTheme? pageTransitionsTheme, PopupMenuThemeData? popupMenuTheme, IconThemeData? primaryIconTheme, ProgressIndicatorThemeData? progressIndicatorTheme, TextTheme? primaryTextTheme, RadioThemeData? radioTheme, ScrollbarThemeData? scrollbarTheme, SearchBarThemeData? searchBarTheme, SearchViewThemeData? searchViewTheme, SegmentedButtonThemeData? segmentedButtonTheme, SnackBarThemeData? snackBarTheme, SliderThemeData? sliderTheme, InteractiveInkFeatureFactory? splashFactory, SwitchThemeData? switchTheme, TabBarTheme? tabBarTheme, TextButtonThemeData? textButtonTheme, TextSelectionThemeData? textSelectionTheme, TextTheme? textTheme, TimePickerThemeData? timePickerTheme, ToggleButtonsThemeData? toggleButtonsTheme, TooltipThemeData? tooltipTheme, Typography? typography, VisualDensity? visualDensity}) ThemeData
Utility method to create ThemeData objects but it only exposes the material3 themes so that any application theming is done with the future in mind.
toString() String
A string representation of this object.
inherited
uiButton({required void onPressed(), required String title, required CButtonType type, Key? key, bool enabled = true, dynamic icon, ButtonStyle? style}) Widget
Will construct a stateless button to handle press events of said button. The button is determined via the CButtonType enumeration which will provide the look and feel of the button. The style is handled by that particular buttons theme data object but to set the button individually, utilize the style override. These are stateless buttons so any changing of them is up to the parent.
uiCenter({Key? key, Widget? child, double? heightFactor, double? widthFactor}) Widget
Provides the ability to center a widget with the ability to specify the visibility of the child tree of widgets wrapped by this.
uiColumn({required List<Widget> children, Key? key, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, MainAxisSize mainAxisSize = MainAxisSize.max}) Widget
Layout to put widgets vertically.
uiComboBox<T>({required List<DropdownMenuEntry<T>> dropdownMenuEntries, Key? key, bool enabled = true, bool enableFilter = false, bool enableSearch = true, String? errorText, double? menuHeight, String? helperText, String? hintText, T? initialSelection, Widget? label, dynamic leadingIcon, void onSelected(T?)?, int? searchCallback(List<DropdownMenuEntry<T>>, String)?, DropdownMenuThemeData? style, dynamic trailingIcon, double? width}) Widget
Creates a customizable combo box drop down with the ability to implement a search box to filter the combo box.
uiContainer({Key? key, AlignmentGeometry? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none, Widget? child}) Widget
The most basic component for setting up a UI. This widget can be utilized to setup padding, margins, or build custom stylized widgets combining said widget or layouts to build a more complex widget.
uiDivider({Key? key, double? height, double? width, Color color = Colors.transparent}) Widget
Creates a vertical or horizontal spacer between widgets that can be hidden if necessary.
uiExpandedTile({required List<Widget> children, required Widget title, Key? key, bool enabled = true, bool initiallyExpanded = false, dynamic leading, ExpansionTileThemeData? style, Widget? subtitle, dynamic trailing}) Widget
Provides the ability to have an expansion list of widgets.
uiFutureBuilder<T>({required Widget builder(BuildContext, AsyncSnapshot<T>), required Future<T>? future, Key? key, T? initialData}) Widget
Provides a wrapper for an asynchronous widget to load data and then present it when completed.
uiGridView({required int crossAxisCount, required List<Widget> children, Key? key, Clip clipBehavior = Clip.hardEdge, double childAspectRatio = 1.0, double crossAxisSpacing = 0.0, double mainAxisSpacing = 0.0, EdgeInsetsGeometry? padding, bool? primary, bool reverse = false, Axis scrollDirection = Axis.vertical, bool shrinkWrap = false}) Widget
Creates a scrollable grid layout of widgets that based on the crossAxisCount.
uiHeight(BuildContext context) double
Retrieves the total height of the specified context.
uiImage({required CImageType type, required dynamic src, Alignment alignment = Alignment.center, BoxFit? fit, double? height, ImageRepeat repeat = ImageRepeat.noRepeat, double? width}) Image
Will create an image widget based on the specified CImageType enumerated value and display it when available based on the characteristics specified with the widget. No theme controls this widget type so the characteristics are unique to each widget created.
uiLabel({required String data, Key? key, int? maxLines, bool? softWrap, TextStyle? style}) Widget
Provides a basic text label with the ability to make it multi-line, clip it if to long, and if necessary, make it a hyperlink.
uiListTile({required void onTap(), Key? key, bool enabled = true, dynamic leading, Widget? title, Widget? subtitle, dynamic trailing, ListTileThemeData? style}) Widget
Creates a selectable widget to be part of a view of selectable items.
uiListView({required List<Widget> children, Key? key, Clip clipBehavior = Clip.hardEdge, EdgeInsetsGeometry? padding, bool? primary, bool reverse = false, Axis scrollDirection = Axis.vertical, bool shrinkWrap = false}) Widget
Provides a list view of widgets with automatic scrolling that can be set for vertical (default) or horizontal.
uiRow({required List<Widget> children, Key? key, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, MainAxisSize mainAxisSize = MainAxisSize.max}) Widget
Layout to put widgets horizontally.
uiStack({required List<Widget> children, Key? key, AlignmentGeometry alignment = AlignmentDirectional.topStart, Clip clipBehavior = Clip.hardEdge, StackFit fit = StackFit.loose, TextDirection? textDirection}) Widget
Creates a stacked widget based on the children allowing for a custom look and feel for "special" widgets that stack bottom to top and overlap.
uiTabView({required List<CTabItem> tabItems, Key? key, bool automaticIndicatorColorAdjustment = true, Color? backgroundColor, Clip clipBehavior = Clip.hardEdge, double? height, EdgeInsetsGeometry? iconMargin, double indicatorWeight = 2.0, bool isScrollable = false, void onTap(int)?, TabBarTheme? style, double viewportFraction = 1.0}) Widget
Constructs a tab view of content to allow for users to switch between widgets of data.
uiTextField({bool autocorrect = true, bool enableSuggestions = true, TextEditingController? controller, String? initialValue, bool enabled = true, bool readOnly = false, bool obscureText = false, String obscuringCharacter = '•', TextInputAction? textInputAction, TextInputType? keyboardType, void onChanged(String)?, void onEditingComplete()?, void onFieldSubmitted(String)?, void onSaved(String?)?, String? validator(String?)?, List<TextInputFormatter>? inputFormatters, String? errorText, String? helperText, String? hintText, String? labelText, Widget? leadingWidget, Widget? trailingWidget, CInputDecorationTheme? style, Key? key}) Widget
Provides for a generalized widget to allow for the collection of data and providing feedback to a user. It exposes the most common text field options to allow for building custom text fields (i.e. spin controls, number only, etc.).
uiVisibility({required Widget child, Key? key, bool maintainState = false, bool maintainAnimation = false, bool maintainSize = false, bool maintainSemantics = false, bool maintainInteractivity = false, bool visible = true}) Widget
Provides the ability to show / hide a widget and setup how to treat other aspects of the widget.
uiWebView({required CWebViewController controller}) Widget
Provides an embedded web view via an iFrame to load other HTML documents.
uiWidth(BuildContext context) double
Retrieves the available width of the specified context.

Operators

operator ==(Object other) bool
The equality operator.
inherited