FDialogStyle.inherit constructor

FDialogStyle.inherit({
  1. required FStyle style,
  2. required FColors colors,
  3. required FTypography typography,
})

Creates a FDialogStyle that inherits its properties.

Implementation

factory FDialogStyle.inherit({required FStyle style, required FColors colors, required FTypography typography}) {
  final title = typography.lg.copyWith(fontWeight: .w600, color: colors.foreground);
  final body = typography.sm.copyWith(color: colors.mutedForeground);
  return .new(
    decoration: BoxDecoration(
      border: .all(color: colors.border),
      borderRadius: style.borderRadius,
      color: colors.card,
    ),
    contentStyle: FVariants(
      FDialogContentStyle(
        titleTextStyle: title,
        bodyTextStyle: body,
        padding: const .only(left: 16, right: 16, top: 8, bottom: 14),
        titleSpacing: 8,
        bodySpacing: 8,
        actionSpacing: 10,
      ),
      variants: {
        [.vertical]: FDialogContentStyle(
          titleTextStyle: title,
          bodyTextStyle: body,
          padding: const .only(left: 16, right: 16, top: 8, bottom: 14),
          titleSpacing: 6,
          bodySpacing: 6,
          actionSpacing: 8,
        ),
      },
    ),
  );
}