generateTextStylesFile static method

String generateTextStylesFile({
  1. required String requiredConstructor,
  2. required String classDeclaration,
  3. required String copyWithArguments,
  4. required String copyWithReturn,
  5. required String lerpReturn,
})

Implementation

static String generateTextStylesFile({
  required String requiredConstructor,
  required String classDeclaration,
  required String copyWithArguments,
  required String copyWithReturn,
  required String lerpReturn,
}) =>
    '''import '../base_imports.dart';

final class AppTextThemeExtension
  extends ThemeExtension<AppTextThemeExtension> {
const AppTextThemeExtension({
$requiredConstructor
});

$classDeclaration

@override
ThemeExtension<AppTextThemeExtension> copyWith({
$copyWithArguments
}) {
  return AppTextThemeExtension(
$copyWithReturn
  );
}

@override
ThemeExtension<AppTextThemeExtension> lerp(
  covariant ThemeExtension<AppTextThemeExtension>? other,
  double t,
) {
  if (other is! AppTextThemeExtension) {
    return this;
  }

  return AppTextThemeExtension(
$lerpReturn
  );
}
}
''';