Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Oct 13, 2024
1 parent 84e2661 commit e085c1e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 19 deletions.
3 changes: 2 additions & 1 deletion example/lib/src/widget/base/base_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class BaseScreen extends StatelessWidget {
children: [
ImpaktfullUiCmsHeader(
title: title,
onBackTapped: canGoBack ? () => Navigator.of(context).pop() : null,
onBackTapped:
canGoBack ? () => Navigator.of(context).pop() : null,
actions: actions,
bottom: headerBottom,
),
Expand Down
11 changes: 8 additions & 3 deletions lib/src/components/card/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ class _ImpaktfullUiCardState extends State<ImpaktfullUiCard> {
child: ImpaktfullUiTouchFeedback(
canRequestFocus: false,
useFocusColor: false,
cursor: widget.onTap != null && widget.cursor == MouseCursor.defer ? SystemMouseCursors.click : widget.cursor,
cursor: widget.onTap != null && widget.cursor == MouseCursor.defer
? SystemMouseCursors.click
: widget.cursor,
onTap: widget.onTap,
onFocus: widget.onFocus,
borderRadius: widget.borderRadius ?? componentTheme.dimens.borderRadius,
borderRadius:
widget.borderRadius ?? componentTheme.dimens.borderRadius,
child: ClipRRect(
borderRadius: componentTheme.dimens.borderRadius,
child: Padding(
Expand All @@ -84,7 +87,9 @@ class _ImpaktfullUiCardState extends State<ImpaktfullUiCard> {
}
if (componentTheme.colors.border != null) {
return Border.all(
color: widget.error ? componentTheme.colors.borderError! : componentTheme.colors.border!,
color: widget.error
? componentTheme.colors.borderError!
: componentTheme.colors.border!,
strokeAlign: BorderSide.strokeAlignOutside,
width: 1,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class ImpaktfullUiFocusFeedback extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: borderRadius,
border: Border.all(
color: hasFocus ? theme.colors.accent.withOpacity(0.66) : Colors.transparent,
color: hasFocus
? theme.colors.accent.withOpacity(0.66)
: Colors.transparent,
width: 2,
strokeAlign: BorderSide.strokeAlignOutside,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class _PlatformTouchFeedbackState extends State<_PlatformTouchFeedback> {
),
);
}
final isAndroidTarget = Theme.of(context).platform == TargetPlatform.android;
final isAndroidTarget =
Theme.of(context).platform == TargetPlatform.android;
return ImpaktfullUiFocusFeedback(
hasFocus: _focusNode.hasFocus,
borderRadius: widget.borderRadius,
Expand All @@ -150,8 +151,11 @@ class _PlatformTouchFeedbackState extends State<_PlatformTouchFeedback> {
onFocusChange: _onFocusChanged,
canRequestFocus: widget.canRequestFocus,
autofocus: widget.autofocus,
focusColor: widget.useFocusColor ? Theme.of(context).hoverColor : Colors.transparent,
splashFactory: isAndroidTarget ? InkSparkle.splashFactory : NoSplash.splashFactory,
focusColor: widget.useFocusColor
? Theme.of(context).hoverColor
: Colors.transparent,
splashFactory:
isAndroidTarget ? InkSparkle.splashFactory : NoSplash.splashFactory,
child: ColoredBox(
color: Colors.transparent,
child: widget.child,
Expand Down
6 changes: 4 additions & 2 deletions lib/src/components/tab_bar_item/tab_bar_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export 'tab_bar_item_style.dart';

part 'tab_bar_item.describe.dart';

class ImpaktfullUiTabBarItem extends StatefulWidget with ComponentDescriptorMixin {
class ImpaktfullUiTabBarItem extends StatefulWidget
with ComponentDescriptorMixin {
final String label;
final int index;
final TabController controller;
Expand Down Expand Up @@ -74,7 +75,8 @@ class _ImpaktfullUiTabBarItemState extends State<ImpaktfullUiTabBarItem> {
width: 4,
decoration: BoxDecoration(
color: componentTheme.textStyles.label.color,
borderRadius: componentTheme.dimens.selectedMarkerBorderRadius,
borderRadius:
componentTheme.dimens.selectedMarkerBorderRadius,
),
),
),
Expand Down
27 changes: 18 additions & 9 deletions lib/src/components/wysiwyg/widget/wysiwyg_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ class ImpaktfullUiWysiwygInputField extends StatefulWidget {
});

@override
State<ImpaktfullUiWysiwygInputField> createState() => _ImpaktfullUiWysiwygInputFieldState();
State<ImpaktfullUiWysiwygInputField> createState() =>
_ImpaktfullUiWysiwygInputFieldState();
}

class _ImpaktfullUiWysiwygInputFieldState extends State<ImpaktfullUiWysiwygInputField> {
class _ImpaktfullUiWysiwygInputFieldState
extends State<ImpaktfullUiWysiwygInputField> {
late final TextEditingController _controller;
late final FocusNode _focusNode;
TextSelection? _textSelection;

@override
void initState() {
super.initState();
_controller = widget.controller ?? TextEditingController(text: widget.value);
_controller =
widget.controller ?? TextEditingController(text: widget.value);
_focusNode = widget.focusNode ?? FocusNode();
_focusNode.addListener(_onFocusChanged);
_controller.addListener(_onTextChanged);
Expand Down Expand Up @@ -95,7 +98,8 @@ class _ImpaktfullUiWysiwygInputFieldState extends State<ImpaktfullUiWysiwygInput
@override
Widget build(BuildContext context) {
return ImpaktfullUiComponentThemeBuidler<ImpaktfullUiInputFieldTheme>(
builder: (context, inputFieldTheme) => ImpaktfullUiComponentThemeBuidler<ImpaktfullUiWysiwygTheme>(
builder: (context, inputFieldTheme) =>
ImpaktfullUiComponentThemeBuidler<ImpaktfullUiWysiwygTheme>(
overrideComponentTheme: widget.theme,
builder: (context, componentTheme) => ImpaktfullUiAutoLayout.vertical(
mainAxisSize: MainAxisSize.min,
Expand Down Expand Up @@ -124,7 +128,8 @@ class _ImpaktfullUiWysiwygInputFieldState extends State<ImpaktfullUiWysiwygInput
textSelectionTheme: TextSelectionThemeData(
cursorColor: inputFieldTheme.colors.cursor,
selectionColor: inputFieldTheme.colors.selection,
selectionHandleColor: inputFieldTheme.colors.selectionHandle,
selectionHandleColor:
inputFieldTheme.colors.selectionHandle,
),
),
child: TextField(
Expand All @@ -144,7 +149,8 @@ class _ImpaktfullUiWysiwygInputFieldState extends State<ImpaktfullUiWysiwygInput
focusColor: Colors.transparent,
hintStyle: inputFieldTheme.textStyles.placeholder,
border: OutlineInputBorder(
borderRadius: inputFieldTheme.dimens.borderRadius.value,
borderRadius:
inputFieldTheme.dimens.borderRadius.value,
),
errorBorder: InputBorder.none,
enabledBorder: InputBorder.none,
Expand All @@ -154,12 +160,15 @@ class _ImpaktfullUiWysiwygInputFieldState extends State<ImpaktfullUiWysiwygInput
contentPadding: EdgeInsets.zero,
),
inputFormatters: [
TextInputFormatter.withFunction((oldValue, newValue) {
TextInputFormatter.withFunction(
(oldValue, newValue) {
if (newValue.text.endsWith('\t')) {
final newText = newValue.text.replaceAll('\t', ' ');
final newText =
newValue.text.replaceAll('\t', ' ');
return TextEditingValue(
text: newText,
selection: TextSelection.collapsed(offset: newText.length),
selection: TextSelection.collapsed(
offset: newText.length),
);
}
return newValue;
Expand Down

0 comments on commit e085c1e

Please sign in to comment.