Skip to content

Commit 7a8ed02

Browse files
committed
Prepare Forui for review
1 parent 1333e1f commit 7a8ed02

4 files changed

Lines changed: 129 additions & 110 deletions

File tree

forui/bin/commands/style/style.dart

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

forui/lib/src/widgets/popover_menu/popover_menu.dart

Lines changed: 63 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -515,68 +515,76 @@ class FPopoverMenuStyle extends FPopoverStyle with _$FPopoverMenuStyleFunctions
515515
required FTypography typography,
516516
required FHapticFeedback hapticFeedback,
517517
required bool touch,
518-
}) : itemGroupStyle = .inherit(colors: colors, style: style, typography: typography, hapticFeedback: hapticFeedback, touch: touch).copyWith(
519-
decoration: .value(
520-
ShapeDecoration(
521-
color: colors.card,
522-
shape: RoundedSuperellipseBorder(
523-
side: BorderSide(color: colors.border, width: style.borderWidth),
524-
borderRadius: style.borderRadius.md,
525-
),
526-
),
527-
),
528-
itemStyles: .delta([
529-
.all(
530-
.delta(
531-
backgroundColor: FVariants.all(colors.card),
532-
contentDecoration: .delta([.base(.shapeDelta(color: colors.card))]),
533-
),
534-
),
535-
.base(
536-
.delta(
537-
contentStyle: FItemContentStyle.inherit(
538-
colors: colors,
539-
typography: typography,
540-
prefix: colors.foreground,
541-
foreground: colors.foreground,
542-
mutedForeground: colors.mutedForeground,
543-
touch: touch,
544-
),
545-
rawContentStyle: FRawItemContentStyle.inherit(
546-
colors: colors,
547-
typography: typography,
548-
prefix: colors.foreground,
549-
color: colors.foreground,
550-
touch: touch,
518+
}) : itemGroupStyle =
519+
.inherit(
520+
colors: colors,
521+
style: style,
522+
typography: typography,
523+
hapticFeedback: hapticFeedback,
524+
touch: touch,
525+
).copyWith(
526+
decoration: .value(
527+
ShapeDecoration(
528+
color: colors.card,
529+
shape: RoundedSuperellipseBorder(
530+
side: BorderSide(color: colors.border, width: style.borderWidth),
531+
borderRadius: style.borderRadius.md,
532+
),
551533
),
552534
),
553-
),
554-
]),
555-
),
556-
tileGroupStyle = .inherit(colors: colors, style: style, typography: typography, hapticFeedback: hapticFeedback).copyWith(
557-
tileStyles: .delta([
558-
.base(
559-
.delta(
560-
contentStyle: .delta(
561-
prefixIconStyle: FVariants.from(
562-
IconThemeData(color: colors.foreground, size: typography.md.fontSize),
563-
variants: {
564-
[.disabled]: .delta(color: colors.disable(colors.foreground)),
565-
},
535+
itemStyles: .delta([
536+
.all(
537+
.delta(
538+
backgroundColor: FVariants.all(colors.card),
539+
contentDecoration: .delta([.base(.shapeDelta(color: colors.card))]),
566540
),
567541
),
568-
rawContentStyle: .delta(
569-
prefixIconStyle: FVariants.from(
570-
IconThemeData(color: colors.foreground, size: typography.md.fontSize),
571-
variants: {
572-
[.disabled]: .delta(color: colors.disable(colors.foreground)),
573-
},
542+
.base(
543+
.delta(
544+
contentStyle: FItemContentStyle.inherit(
545+
colors: colors,
546+
typography: typography,
547+
prefix: colors.foreground,
548+
foreground: colors.foreground,
549+
mutedForeground: colors.mutedForeground,
550+
touch: touch,
551+
),
552+
rawContentStyle: FRawItemContentStyle.inherit(
553+
colors: colors,
554+
typography: typography,
555+
prefix: colors.foreground,
556+
color: colors.foreground,
557+
touch: touch,
558+
),
574559
),
575560
),
576-
),
561+
]),
562+
),
563+
tileGroupStyle = .inherit(colors: colors, style: style, typography: typography, hapticFeedback: hapticFeedback)
564+
.copyWith(
565+
tileStyles: .delta([
566+
.base(
567+
.delta(
568+
contentStyle: .delta(
569+
prefixIconStyle: FVariants.from(
570+
IconThemeData(color: colors.foreground, size: typography.md.fontSize),
571+
variants: {
572+
[.disabled]: .delta(color: colors.disable(colors.foreground)),
573+
},
574+
),
575+
),
576+
rawContentStyle: .delta(
577+
prefixIconStyle: FVariants.from(
578+
IconThemeData(color: colors.foreground, size: typography.md.fontSize),
579+
variants: {
580+
[.disabled]: .delta(color: colors.disable(colors.foreground)),
581+
},
582+
),
583+
),
584+
),
585+
),
586+
]),
577587
),
578-
]),
579-
),
580588
minWidth = 150,
581589
maxWidth = 250,
582590
hoverEnterDuration = const Duration(milliseconds: 150),

forui/lib/src/widgets/select_menu_tile.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,20 @@ class FSelectMenuTileStyle extends FLabelStyle with _$FSelectMenuTileStyleFuncti
774774
required FHapticFeedback hapticFeedback,
775775
required bool touch,
776776
}) {
777-
final groupStyle = FTileGroupStyle.inherit(colors: colors, style: style, typography: typography, hapticFeedback: hapticFeedback);
777+
final groupStyle = FTileGroupStyle.inherit(
778+
colors: colors,
779+
style: style,
780+
typography: typography,
781+
hapticFeedback: hapticFeedback,
782+
);
778783
return .new(
779-
menuStyle: .inherit(colors: colors, style: style, typography: typography, hapticFeedback: hapticFeedback, touch: touch),
784+
menuStyle: .inherit(
785+
colors: colors,
786+
style: style,
787+
typography: typography,
788+
hapticFeedback: hapticFeedback,
789+
touch: touch,
790+
),
780791
tileStyle: .inherit(colors: colors, typography: typography, style: style),
781792
labelTextStyle: groupStyle.labelTextStyle,
782793
descriptionTextStyle: groupStyle.descriptionTextStyle,

forui/lib/src/widgets/tile/tile_group.dart

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -454,57 +454,57 @@ class FTileGroupStyle extends FLabelStyle with _$FTileGroupStyleFunctions {
454454
required FStyle style,
455455
required FHapticFeedback hapticFeedback,
456456
}) => .new(
457-
decoration: ShapeDecoration(
458-
shape: RoundedSuperellipseBorder(
459-
side: BorderSide(color: colors.border, width: style.borderWidth),
460-
borderRadius: style.borderRadius.md,
461-
),
462-
),
463-
dividerColor: .all(colors.border),
464-
dividerWidth: style.borderWidth,
465-
slideableTiles: const .all(true),
466-
slidePressHapticFeedback: hapticFeedback.selectionClick,
467-
labelTextStyle: FVariants.from(
468-
typography.sm.copyWith(
469-
color: style.formFieldStyle.labelTextStyle.base.color ?? colors.foreground,
470-
fontWeight: .w600,
471-
),
472-
variants: {
473-
[.disabled]: .delta(color: colors.disable(colors.foreground)),
474-
},
475-
),
476-
tileStyles: FTileStyles(
477-
FVariants.from(
478-
FTileStyle.inherit(
457+
decoration: ShapeDecoration(
458+
shape: RoundedSuperellipseBorder(
459+
side: BorderSide(color: colors.border, width: style.borderWidth),
460+
borderRadius: style.borderRadius.md,
461+
),
462+
),
463+
dividerColor: .all(colors.border),
464+
dividerWidth: style.borderWidth,
465+
slideableTiles: const .all(true),
466+
slidePressHapticFeedback: hapticFeedback.selectionClick,
467+
labelTextStyle: FVariants.from(
468+
typography.sm.copyWith(
469+
color: style.formFieldStyle.labelTextStyle.base.color ?? colors.foreground,
470+
fontWeight: .w600,
471+
),
472+
variants: {
473+
[.disabled]: .delta(color: colors.disable(colors.foreground)),
474+
},
475+
),
476+
tileStyles: FTileStyles(
477+
FVariants.from(
478+
FTileStyle.inherit(
479+
colors: colors,
480+
typography: typography,
481+
style: style,
482+
).copyWith(contentDecoration: .delta([.all(const .shapeDelta(shape: RoundedSuperellipseBorder()))])),
483+
variants: {
484+
[.primary]: const .delta(),
485+
[.destructive]: .delta(
486+
contentStyle: FTileContentStyle.inherit(
479487
colors: colors,
480488
typography: typography,
481-
style: style,
482-
).copyWith(contentDecoration: .delta([.all(const .shapeDelta(shape: RoundedSuperellipseBorder()))])),
483-
variants: {
484-
[.primary]: const .delta(),
485-
[.destructive]: .delta(
486-
contentStyle: FTileContentStyle.inherit(
487-
colors: colors,
488-
typography: typography,
489-
prefix: colors.destructive,
490-
foreground: colors.destructive,
491-
mutedForeground: colors.destructive,
492-
),
493-
rawContentStyle: FRawTileContentStyle.inherit(
494-
colors: colors,
495-
typography: typography,
496-
prefix: colors.destructive,
497-
color: colors.destructive,
498-
),
499-
),
500-
},
489+
prefix: colors.destructive,
490+
foreground: colors.destructive,
491+
mutedForeground: colors.destructive,
492+
),
493+
rawContentStyle: FRawTileContentStyle.inherit(
494+
colors: colors,
495+
typography: typography,
496+
prefix: colors.destructive,
497+
color: colors.destructive,
498+
),
501499
),
502-
),
503-
descriptionTextStyle: style.formFieldStyle.descriptionTextStyle.apply([
504-
.all(.delta(fontSize: typography.xs2.fontSize, height: typography.xs2.height)),
505-
]),
506-
errorTextStyle: style.formFieldStyle.errorTextStyle.apply([
507-
.all(.delta(fontSize: typography.xs2.fontSize, height: typography.xs2.height)),
508-
]),
509-
);
500+
},
501+
),
502+
),
503+
descriptionTextStyle: style.formFieldStyle.descriptionTextStyle.apply([
504+
.all(.delta(fontSize: typography.xs2.fontSize, height: typography.xs2.height)),
505+
]),
506+
errorTextStyle: style.formFieldStyle.errorTextStyle.apply([
507+
.all(.delta(fontSize: typography.xs2.fontSize, height: typography.xs2.height)),
508+
]),
509+
);
510510
}

0 commit comments

Comments
 (0)