import 'package:flutter/material.dart'; import 'package:flyinsonolite/infrastructure/scale.dart'; import 'package:flyinsonolite/infrastructure/storage.dart'; class DefaultInputDecoration extends InputDecoration { DefaultInputDecoration( {String? placeHolder, Widget? suffixIcon, EdgeInsetsGeometry? contentPadding, String errorText = '', Color? fillColor, Color? borderColor, Color? enabledBorderColor, BoxConstraints? constraints}) : super( fillColor: fillColor ?? Colors.white, filled: true, hintText: placeHolder, hintStyle: TextStyle( color: const Color.fromARGB(255, 194, 198, 205), fontSize: Storage.currentTheme.normalTextStyle.fontSize!.s), contentPadding: contentPadding ?? EdgeInsets.fromLTRB(12.s, 4.s, 12.s, 4.s), border: OutlineInputBorder( borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide( color: borderColor ?? const Color.fromARGB(255, 233, 234, 239), width: 0)), enabledBorder: OutlineInputBorder( //未选中时候的颜色 borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide( color: borderColor ?? const Color.fromARGB(255, 225, 227, 233), width: 0)), focusedBorder: OutlineInputBorder( //选中时外边框颜色 borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide( color: Storage.currentTheme.loginContainStyle.borderColor, width: 0)), errorText: errorText == '' ? null : errorText, suffixIcon: suffixIcon, suffixIconConstraints: BoxConstraints( minWidth: 48.s, minHeight: 48.s, maxHeight: 48.s, maxWidth: 48.s), constraints: constraints ?? BoxConstraints(minHeight: 48.s, maxHeight: 48.s), ); } class DefaultInputDecoration2 extends InputDecoration { DefaultInputDecoration2({ EdgeInsetsGeometry? contentPadding, }) : super( contentPadding: contentPadding ?? const EdgeInsets.all(0), border: OutlineInputBorder( borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide(color: Colors.grey, width: 1.s)), enabledBorder: OutlineInputBorder( //未选中时候的颜色 borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide(color: Colors.grey, width: 1.s)), focusedBorder: OutlineInputBorder( //选中时外边框颜色 borderRadius: BorderRadius.circular(4.s), gapPadding: 4.s, borderSide: BorderSide(color: Colors.blue, width: 1.s)), ); }