mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
104 lines
2.5 KiB
Dart
104 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/utils/context_extension.dart';
|
|
|
|
import 'font_manager.dart';
|
|
|
|
TextStyle _getTextStyle({
|
|
required double fontSize,
|
|
required Color color,
|
|
required FontWeight fontWeight,
|
|
}) =>
|
|
TextStyle(
|
|
fontFamily: FontsManager.fontFamily,
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// regular style
|
|
TextStyle getTextStyleRegular({
|
|
required Color color,
|
|
double fontSize = FontSize.s14,
|
|
fontWeight = FontsManager.regular,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// light style
|
|
TextStyle getTextStyleLight({
|
|
required Color color,
|
|
double fontSize = FontSize.s12,
|
|
fontWeight = FontsManager.light,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// medium style
|
|
TextStyle getTextStyleMedium({
|
|
required Color color,
|
|
double fontSize = FontSize.s16,
|
|
fontWeight = FontsManager.medium,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// semi bold style
|
|
TextStyle getTextStyleSemiBold({
|
|
required Color color,
|
|
double fontSize = FontSize.s18,
|
|
fontWeight = FontsManager.semiBold,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// bold style
|
|
TextStyle getTextStyleBold({
|
|
required Color color,
|
|
double fontSize = FontSize.s20,
|
|
fontWeight = FontsManager.bold,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
/// extra bold style
|
|
TextStyle getTextStyleExtraBold({
|
|
required Color color,
|
|
double fontSize = FontSize.s22,
|
|
fontWeight = FontsManager.extraBold,
|
|
}) =>
|
|
_getTextStyle(
|
|
fontSize: fontSize,
|
|
color: color,
|
|
fontWeight: fontWeight,
|
|
);
|
|
|
|
///inputDecoration
|
|
|
|
InputDecoration defaultInputDecoration(BuildContext context, {String? hint}) =>
|
|
InputDecoration(
|
|
enabledBorder: context.inputDecoration.enabledBorder,
|
|
focusedBorder: context.inputDecoration.enabledBorder,
|
|
errorBorder: context.inputDecoration.errorBorder,
|
|
focusedErrorBorder: context.inputDecoration.enabledBorder,
|
|
hintText: hint,
|
|
hintStyle: context.inputDecoration.hintStyle,
|
|
filled: context.inputDecoration.filled,
|
|
fillColor: context.inputDecoration.fillColor,
|
|
contentPadding: context.inputDecoration.contentPadding,
|
|
);
|