/*
*@Author: XianKaiQun
*@Date: 2020-04-20 17:34:38
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-09-28 16:13:57
*@Descripttion: 主题
*/
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

const _primaryColor = Color(0XFF0F67F8);

const _backgroundColor = Color(0XFFF7F9FB);

const _dividerColor = Color(0XFFE5E5E5);

const _disabledColor = Color(0xffE0E2E3);
ThemeData appThemeData = ThemeData(
  ///主题色
  primaryColor: _primaryColor,

  ///页面背景
  scaffoldBackgroundColor: _backgroundColor,

  ///指示器颜色
  indicatorColor: _primaryColor,

  ///分割线、边框
  dividerColor: _dividerColor,

  ///禁用色
  disabledColor: Color(0xffE0E2E3),

  ///图标
  iconTheme: IconThemeData(
    color: Color(0xff666666),
    size: 20.pt,
  ),

  /// ```
  /// NAME         SIZE  WEIGHT  SPACING
  /// headline1    96.0  light   -1.5
  /// headline2    60.0  light   -0.5
  /// headline3    48.0  regular  0.0
  /// headline4    34.0  regular  0.25
  /// headline5    24.0  regular  0.0
  /// headline6    20.0  medium   0.15
  /// subtitle1    16.0  regular  0.15
  /// subtitle2    14.0  medium   0.1
  /// body1        16.0  regular  0.5   (bodyText1)
  /// body2        14.0  regular  0.25  (bodyText2)
  /// button       14.0  medium   1.25
  /// caption      12.0  regular  0.4
  /// overline     10.0  regular  1.5
  /// ```
  textTheme: TextTheme(
    ///输入框、
    ///ListTile
    titleMedium: TextStyle(
      fontSize: 15.pt,
    ),
    titleSmall: TextStyle(
      fontSize: 14.pt,
    ),
  ),
  primaryTextTheme: TextTheme(),

  ///标题栏
  appBarTheme: AppBarTheme(
    iconTheme: IconThemeData(
      color: Color(0xff2D3051),
      size: 19.pt,
    ),
    elevation: 0,
    systemOverlayStyle: SystemUiOverlayStyle.dark,
    toolbarTextStyle: TextTheme(
      titleLarge: TextStyle(
        color: Colors.white,
        fontSize: 18.pt,
        fontWeight: FontWeight.w600,
      ),
    ).bodyMedium,
    titleTextStyle: TextTheme(
      titleLarge: TextStyle(
        color: Colors.white,
        fontSize: 18.pt,
        fontWeight: FontWeight.w600,
      ),
    ).titleLarge,
  ),

  ///卡片主题
  cardTheme: CardTheme(
    margin: EdgeInsets.zero,
    elevation: 8.pt,
    clipBehavior: Clip.hardEdge,
  ),

  ///按钮主题
  buttonTheme: ButtonThemeData(
    textTheme: ButtonTextTheme.primary,
    buttonColor: _primaryColor,
    disabledColor: _disabledColor,
    highlightColor: Colors.transparent,
    height: 44.pt,
    minWidth: 88.pt,
  ),

  ///分割线
  dividerTheme: DividerThemeData(
    space: 1.pt,
    color: Color(0xffD7D7D7),
  ),

  ///输入框
  inputDecorationTheme: InputDecorationTheme(
    hintStyle: TextStyle(
      color: Color(0xff959595),
      fontSize: 15.pt,
      fontWeight: FontWeight.normal,
    ),
    errorStyle: TextStyle(
      height: 1,
      fontSize: 12.pt,
    ),
    suffixStyle: TextStyle(
      color: Colors.black,
    ),
    filled: true,
    fillColor: Color(0xfff8f8f8),
    isDense: true,
    errorMaxLines: 1,
    border: InputBorder.none,
    disabledBorder: InputBorder.none,
    enabledBorder: InputBorder.none,
    errorBorder: InputBorder.none,
    focusedBorder: InputBorder.none,
    focusedErrorBorder: InputBorder.none,
    contentPadding: EdgeInsets.all(10.pt),
  ),

  ///弹出层
  dialogTheme: DialogTheme(
    elevation: 0,
    backgroundColor: Colors.white,
    titleTextStyle: TextStyle(
      fontSize: 20.pt,
      color: Colors.black,
      fontWeight: FontWeight.bold,
    ),
    contentTextStyle: TextStyle(
      fontSize: 14.pt,
      color: Color(0xff333333),
    ),
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(4.pt),
    ),
  ),
  // colorScheme: ColorScheme(
  //   surface: _backgroundColor,
  //   brightness: Brightness.light,
  //   primary: Color(0xff0F67F8),
  //   onPrimary: Color(0xff0F67F8),
  //   secondary: Color(0XFF616178),
  //   onSecondary: Color(0XFF616178),
  //   error: Color(0xffFF495E),
  //   onError: Color(0xffFF495E),
  //   onSurface:  Color(0xff2D3051),
  // ),
);
