generateStyleByMaterial static method

UpStyle generateStyleByMaterial({
  1. required MaterialColor inputColor,
  2. required MaterialColor contrastColor,
  3. required MaterialColor baseColor,
})

Implementation

static UpStyle generateStyleByMaterial({
  required MaterialColor inputColor,
  required MaterialColor contrastColor,
  required MaterialColor baseColor,
}) {
  return UpStyle(
    // code
    codeBackgroundColor: baseColor.shade50,
    codeBorderColor: baseColor.shade100,
    codeTextColor: baseColor.shade900,
    appBackgroundColor: baseColor,

    // appbar
    appBarColor: inputColor[500]!,
    appBarTitleSize: 20,
    appBarTitleColor: contrastColor[500]!,

    // cusotm
    foregroundColor: inputColor[500]!,
    backgroundColor: baseColor.shade50,
    borderColor: inputColor[100],
    hoverBackgroundColor: inputColor[500]!,
    hoveredForegroundColor: contrastColor[500]!,
    hoveredBorderColor: inputColor[700]!,
    borderRadius: 8,
    borderWidth: 2,
    errorBorderColor: Colors.red,
    focusedBorderColor: inputColor[700]!,
    isRounded: true,
    iconColor: baseColor.shade900,
    iconSize: 16,
    toastBackgroundColor: inputColor[500],
    toastTextColor: contrastColor[500],

    //button
    buttonBackgroundColor: inputColor[500]!,
    buttonHoverBackgroundColor: inputColor[700]!,
    buttonTextColor: contrastColor,
    buttonHoverTextColor: contrastColor,
    buttonBorderColor: inputColor[500],
    buttonHoverBorderColor: inputColor[700]!,
    buttonBorderRadius: 8,
    buttonWidth: 130,
    buttonBorderWidth: 2,
    buttonTextSize: 16,
    buttonDisabledBorderColor: Colors.grey[300],
    buttonDisabledTextColor: Colors.grey,
    buttonDisbaledBackgroundColor: Colors.grey[300],
    buttonBorderStyle: BorderStyle.solid,
    buttonTextFit: BoxFit.none,
    buttonTextWeight: FontWeight.normal,
    //textfield
    textfieldTextColor: baseColor.shade900,
    textfieldBorderRadius: 8,
    textfieldFocusedLabelSize: 16,
    textfieldFilledColor: baseColor.shade100,
    textfieldFocusedFilledColor: Colors.transparent,
    textfieldLabelFocusedColor: inputColor[700]!,
    textfieldLabelColor: baseColor.shade600,
    textfieldBorderWidth: 2,
    textfieldHintColor: baseColor.shade400,
    textfieldBorderColor: Colors.transparent,
    textfieldLabelSize: 16,
    textfieldErrorBorderColor: Colors.red,
    textfieldFocusedBorderColor: inputColor,
    textfieldCursorColor: inputColor[700],

    //dropdown
    dropdownMenuColor: baseColor.shade50,
    dropdownMenuTextColor: baseColor.shade900,
    dropdownBorderRadius: 8,
    dropdownBorderWidth: 2,
    dropdownBorderColor: Colors.transparent,
    dropdownFilledColor: baseColor.shade100,
    dropdownFocusedFilledColor: Colors.transparent,
    dropdownLabelFocusedColor: inputColor[700]!,
    dropdownLabelColor: baseColor.shade600,
    dropdownLabelSize: 12,
    dropdownErrorBorderColor: Colors.red,
    dropdownFocusedBorderColor: inputColor[700]!,
    dropdownTextColor: baseColor.shade900,

    // alertdialog
    alertDialogBackgroundColor: baseColor.shade50,
    alertDialogActionsPadding: const EdgeInsets.fromLTRB(0, 0, 32, 16),
    alertDialogTitlePadding: const EdgeInsets.fromLTRB(24, 16, 16, 0),
    alertDialogContentPadding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
    alertDialogSurfaceTintColor: baseColor.shade100,
    alertDialogIconColor: inputColor,
    alertDialogShapeBorder: const RoundedRectangleBorder(
      borderRadius: BorderRadius.zero,
    ),

    //check box
    checkboxCheckedColor: contrastColor,
    checkboxBorderColor: baseColor.shade600,
    checkboxBorderRadius: 8,
    checkboxLabelColor: baseColor.shade900,
    checkboxLabelSize: 12,
    checkboxBorderWidth: 2,
    checkboxBackgroundColor: inputColor[500],
    checkboxCheckedDisabledColor: contrastColor,
    checkboxDisabledLabelColor: baseColor.shade200,
    checkboxDisabledBackgroundColor: baseColor.shade200,
    checkboxHoverBorderColor: baseColor.shade900,
    checkboxRippleColor: baseColor.shade50,

    //radio button
    radioButtonFilledColor: inputColor[500]!,
    radioButtonBorderColor: baseColor.shade600,
    radioButtonBorderRadius: 100,
    radioButtonLabelColor: baseColor.shade900,
    radioButtonLabelSize: 12,
    radioButtonBorderWidth: 2,
    radioButtonDisabledFilledColor: baseColor.shade200,
    radioButtonDisabledLabelColor: baseColor.shade200,
    radioButtonDisabledBorderColor: baseColor.shade200,
    radioButtonHoverBorderColor: baseColor.shade900,
    radioButtonRippleColor: baseColor.shade50,

    //table
    tableHeaderColor: baseColor.shade100,
    tableRowColor: baseColor.shade50,
    tableRowHoverColor: baseColor.shade100,
    tableRowFocusedColor: inputColor[200]!,
    tableRowPressedColor: inputColor[400]!,
    tableBorderColor: baseColor.shade200,
    tableHeaderTextColor: baseColor.shade900,
    tableHeaderTextSize: 12,
    tableHeaderTextWeight: FontWeight.bold,
    tableHeight: null, tableWidth: null,
    tableFooterColor: baseColor.shade100,

    //datepicker
    datePickerDialogBackgroundColor: baseColor.shade100,
    datePickerOnPrimaryColor: inputColor[900],
    datePickerOnSurfaceColor: baseColor.shade900,
    datePickerPrimaryColor: inputColor[500],
    datePickerSurfaceColor: baseColor.shade50,

    //timepicker
    timePickerDialogBackgroundColor: baseColor,
    timePickerOnPrimaryColor: contrastColor[500],
    timePickerOnSurfaceColor: baseColor.shade900,
    timePickerPrimaryColor: inputColor[700],
    timePickerSurfaceColor: baseColor.shade50,

    //text
    textStrokeColor: Colors.transparent,
    textFontStyle: FontStyle.normal,
    textStrokeWidth: 0,
    textBackgroundColor: Colors.transparent,
    textColor: baseColor[900],
    textSize: 14,
    textWeight: FontWeight.normal,
    circularProgressBarColor: inputColor[700],
    heading1Size: 96.0,
    heading2Size: 60.0,
    heading3Size: 48.0,
    heading4Size: 34.0,
    heading5Size: 24.0,
    heading6Size: 20.0,
    paragraphSize: 16.0,
    heading1Weight: FontWeight.bold,
    heading2Weight: FontWeight.w700,
    heading3Weight: FontWeight.w600,
    heading4Weight: FontWeight.w400,
    heading5Weight: FontWeight.w300,
    heading6Weight: FontWeight.w200,
    paragraphWeight: FontWeight.normal,

    // expansion tile
    expansionTileBackgroundColor: baseColor.shade50,
    expansionTileDividerColor: baseColor.shade100,
    expansionTileCollapsedBackgroundColor: baseColor.shade50,
    expansionTileCollapsedIconColor: baseColor.shade800,
    expansionTileCollapsedTextColor: baseColor.shade800,
    expansionTileIconColor: baseColor.shade900,
    expansionTileTextColor: baseColor.shade900,

    // list tile
    listTileColor: baseColor.shade50,
    listTileFocusedColor: baseColor.shade200,
    listTileHoveredColor: baseColor.shade100,
    listTileIconColor: baseColor.shade900,
    listTileSelectedColor: inputColor[300],
    listTileSelectedTileColor: inputColor[100],
    listTileTextColor: baseColor.shade900,

    // card
    cardHeaderColor: baseColor.shade200,
    cardRadius: 3,
    cardBodyColor: baseColor.shade50,

    // drawer
    drawerColor: baseColor.shade50,
    drawerHeaderColor: Colors.transparent,
    drawerShadowColor: Colors.transparent,
    drawerShapeBorder: const RoundedRectangleBorder(
      side: BorderSide(
        color: Colors.transparent,
      ),
      borderRadius: BorderRadius.all(
        Radius.circular(0),
      ),
    ),
  );
}