diff --git a/lib/src/components/button/impaktfull_button.dart b/lib/src/components/button/impaktfull_button.dart index f385b83..43d22fc 100644 --- a/lib/src/components/button/impaktfull_button.dart +++ b/lib/src/components/button/impaktfull_button.dart @@ -77,9 +77,12 @@ class _ImpaktfullButtonState extends State { onTap: hasOnTap ? _onTap : null, color: background, shadow: [ - if (theme.shadows.button != null && widget._type != _ButtonType.secondary) theme.shadows.button!, + if (theme.shadows.button != null && + widget._type != _ButtonType.secondary) + theme.shadows.button!, ], - borderRadius: BorderRadius.circular(theme.dimens.generalBorderRadius), + borderRadius: + BorderRadius.circular(theme.dimens.generalBorderRadius), child: Container( constraints: const BoxConstraints( minWidth: 48, diff --git a/lib/src/components/dialog/impaktfull_dialog.dart b/lib/src/components/dialog/impaktfull_dialog.dart index 4b828be..a47a4fe 100644 --- a/lib/src/components/dialog/impaktfull_dialog.dart +++ b/lib/src/components/dialog/impaktfull_dialog.dart @@ -40,7 +40,8 @@ class ImpaktfullDialog extends StatelessWidget { padding: padding, decoration: BoxDecoration( color: theme.colors.card, - borderRadius: BorderRadius.circular(theme.dimens.generalBorderRadius), + borderRadius: + BorderRadius.circular(theme.dimens.generalBorderRadius), ), child: Column( mainAxisSize: MainAxisSize.min, @@ -67,35 +68,61 @@ class ImpaktfullDialog extends StatelessWidget { if (onSecondaryTapped != null) ...[ Expanded( child: ImpaktfullButton.secondary( - label: secondaryLabel ?? theme.localizations.current.generalLabelCancel, - onTap: onSecondaryTapped is AsyncCallback ? null : onSecondaryTapped as VoidCallback, - onAsyncTap: onSecondaryTapped is AsyncCallback ? onSecondaryTapped as AsyncCallback : null, + label: secondaryLabel ?? + theme.localizations.current.generalLabelCancel, + onTap: onSecondaryTapped is AsyncCallback + ? null + : onSecondaryTapped as VoidCallback, + onAsyncTap: onSecondaryTapped is AsyncCallback + ? onSecondaryTapped as AsyncCallback + : null, ), ), ], if (onPrimaryTapped != null) ...[ - if (primaryButtonType == ImpaktfullDialogPrimaryButtonType.primary) ...[ + if (primaryButtonType == + ImpaktfullDialogPrimaryButtonType.primary) ...[ Expanded( child: ImpaktfullButton.primary( - label: primaryLabel ?? theme.localizations.current.generalLabelAccept, - onTap: onPrimaryTapped is AsyncCallback ? null : onPrimaryTapped as VoidCallback, - onAsyncTap: onPrimaryTapped is AsyncCallback ? onPrimaryTapped as AsyncCallback : null, + label: primaryLabel ?? + theme + .localizations.current.generalLabelAccept, + onTap: onPrimaryTapped is AsyncCallback + ? null + : onPrimaryTapped as VoidCallback, + onAsyncTap: onPrimaryTapped is AsyncCallback + ? onPrimaryTapped as AsyncCallback + : null, ), ), - ] else if (primaryButtonType == ImpaktfullDialogPrimaryButtonType.accent) ...[ + ] else if (primaryButtonType == + ImpaktfullDialogPrimaryButtonType.accent) ...[ Expanded( child: ImpaktfullButton.accent( - label: primaryLabel ?? theme.localizations.current.generalLabelAccept, - onTap: onPrimaryTapped is AsyncCallback ? null : onPrimaryTapped as VoidCallback, - onAsyncTap: onPrimaryTapped is AsyncCallback ? onPrimaryTapped as AsyncCallback : null, + label: primaryLabel ?? + theme + .localizations.current.generalLabelAccept, + onTap: onPrimaryTapped is AsyncCallback + ? null + : onPrimaryTapped as VoidCallback, + onAsyncTap: onPrimaryTapped is AsyncCallback + ? onPrimaryTapped as AsyncCallback + : null, ), ), - ] else if (primaryButtonType == ImpaktfullDialogPrimaryButtonType.danger) ...[ + ] else if (primaryButtonType == + ImpaktfullDialogPrimaryButtonType.danger) ...[ Expanded( child: ImpaktfullButton.danger( - label: primaryLabel ?? theme.localizations.current.generalLabelAccept, - onTap: onPrimaryTapped is AsyncCallback ? null : onPrimaryTapped as VoidCallback, - onAsyncTap: onPrimaryTapped is AsyncCallback ? onPrimaryTapped as AsyncCallback : null, + label: primaryLabel ?? + theme + .localizations.current.generalLabelAccept, + onTap: onPrimaryTapped is AsyncCallback + ? null + : onPrimaryTapped as VoidCallback, + onAsyncTap: onPrimaryTapped is AsyncCallback + ? onPrimaryTapped as AsyncCallback + : null, ), ), ], diff --git a/lib/src/components/input_field/impaktfull_input_field.dart b/lib/src/components/input_field/impaktfull_input_field.dart index cad91a4..e0cdf01 100644 --- a/lib/src/components/input_field/impaktfull_input_field.dart +++ b/lib/src/components/input_field/impaktfull_input_field.dart @@ -36,20 +36,23 @@ class ImpaktfullInputField extends StatefulWidget { class _ImpaktfullInputFieldState extends State { TextEditingController? _internalTextEditingController; - TextEditingController get _textEditingController => _internalTextEditingController ?? widget.controller!; + TextEditingController get _textEditingController => + _internalTextEditingController ?? widget.controller!; @override void initState() { super.initState(); if (widget.controller == null) { - _internalTextEditingController = TextEditingController(text: widget.value); + _internalTextEditingController = + TextEditingController(text: widget.value); } } @override void didUpdateWidget(covariant ImpaktfullInputField oldWidget) { super.didUpdateWidget(oldWidget); - if (widget.value != oldWidget.value && widget.value != _textEditingController.text) { + if (widget.value != oldWidget.value && + widget.value != _textEditingController.text) { _textEditingController.text = widget.value; setState(() {}); } @@ -73,7 +76,8 @@ class _ImpaktfullInputFieldState extends State { Container( decoration: BoxDecoration( color: theme.colors.card, - borderRadius: BorderRadius.circular(theme.dimens.generalBorderRadius), + borderRadius: + BorderRadius.circular(theme.dimens.generalBorderRadius), ), padding: const EdgeInsets.symmetric( horizontal: 16, diff --git a/lib/src/components/screen/impaktfull_screen.dart b/lib/src/components/screen/impaktfull_screen.dart index fb9940f..07a2841 100644 --- a/lib/src/components/screen/impaktfull_screen.dart +++ b/lib/src/components/screen/impaktfull_screen.dart @@ -34,7 +34,11 @@ class ImpaktfullScreen extends StatelessWidget { @override Widget build(BuildContext context) { final theme = ImpaktfullTheme.of(context); - final hasNavBar = title != null || subtitle != null || actions.isNotEmpty || onBackTapped != null || bottomNavBarChild != null; + final hasNavBar = title != null || + subtitle != null || + actions.isNotEmpty || + onBackTapped != null || + bottomNavBarChild != null; return ImpaktfullStatusBar.custom( isDark: theme.useDarkStatusBar( context,