theme fixes and new fields: messageSelectionColor, portraitOnlineAwayColor, portraitOnlineBusyColor, textfieldSelectionColor, menuBackgroundColor
continuous-integration/drone/pr Build was killed
Details
continuous-integration/drone/pr Build was killed
Details
This commit is contained in:
parent
74a9656216
commit
7dc25b92c7
|
@ -43,6 +43,7 @@ themes:
|
|||
messageFromMeTextColor: font # whiteishPurple
|
||||
messageFromOtherBackgroundColor: peerBubble # deepPurple
|
||||
messageFromOtherTextColor: font # whiteishPurple
|
||||
messageSelectionColor: accent
|
||||
portraitBackgroundColor: deepPurple
|
||||
portraitBlockedBorderColor: lightGrey
|
||||
portraitBlockedTextColor: lightGrey
|
||||
|
@ -50,6 +51,8 @@ themes:
|
|||
portraitContactBadgeTextColor: whiteishPurple
|
||||
portraitOfflineBorderColor: purple
|
||||
portraitOnlineBorderColor: whiteishPurple
|
||||
portraitOnlineAwayColor: 0xFFFFF59D
|
||||
portraitOnlineBusyColor: 0xFFEF9A9A
|
||||
portraitProfileBadgeColor: hotPink
|
||||
portraitProfileBadgeTextColor: whiteishPurple
|
||||
scrollbarDefaultColor: purple
|
||||
|
@ -59,8 +62,10 @@ themes:
|
|||
textfieldBorderColor: deepPurple
|
||||
textfieldErrorColor: hotPink
|
||||
textfieldHintColor: mainTextColor
|
||||
textfieldSelectionColor: accent
|
||||
toolbarIconColor: settings # whiteishPurple
|
||||
topbarColor: header # darkGreyPurple
|
||||
menuBackgroundColor: accent;
|
||||
snackbarBackgroundColor: accent
|
||||
snackbarTextColor: whiteishPurple
|
||||
chatImageColor: purple
|
||||
|
@ -87,6 +92,7 @@ themes:
|
|||
messageFromMeTextColor: font # mainTextColor
|
||||
messageFromOtherBackgroundColor: peerBubble # purple
|
||||
messageFromOtherTextColor: font # darkPurple
|
||||
messageSelectionColor: 0x80FF80
|
||||
portraitBackgroundColor: softPurple
|
||||
portraitBlockedBorderColor: softGrey
|
||||
portraitBlockedTextColor: softGrey
|
||||
|
@ -94,6 +100,8 @@ themes:
|
|||
portraitContactBadgeTextColor: whitePurple
|
||||
portraitOfflineBorderColor: greyPurple
|
||||
portraitOnlineBorderColor: greyPurple
|
||||
portraitOnlineAwayColor: 0xFFFFF59D
|
||||
portraitOnlineBusyColor: 0xFFEF9A9A
|
||||
portraitProfileBadgeColor: accent
|
||||
portraitProfileBadgeTextColor: whitePurple
|
||||
scrollbarDefaultColor: accent
|
||||
|
@ -103,6 +111,10 @@ themes:
|
|||
textfieldBorderColor: purple
|
||||
textfieldErrorColor: hotPink
|
||||
textfieldHintColor: font
|
||||
textfieldSelectionColor: accent
|
||||
toolbarIconColor: settings # darkPurple
|
||||
topbarColor: header # softPurple
|
||||
menuBackgroundColor: accent;
|
||||
snackbarBackgroundColor: accent
|
||||
snackbarTextColor: whitePurple
|
||||
chatImageColor: purple
|
||||
|
|
|
@ -63,6 +63,7 @@ class CwtchDark extends OpaqueThemeType {
|
|||
get messageFromMeTextColor => font; //whiteishPurple;
|
||||
get messageFromOtherBackgroundColor => peerBubble; //deepPurple;
|
||||
get messageFromOtherTextColor => font; //whiteishPurple;
|
||||
get messageSelectionColor => accent;
|
||||
get portraitBackgroundColor => deepPurple;
|
||||
get portraitBlockedBorderColor => lightGrey;
|
||||
get portraitBlockedTextColor => lightGrey;
|
||||
|
@ -70,6 +71,8 @@ class CwtchDark extends OpaqueThemeType {
|
|||
get portraitContactBadgeTextColor => whiteishPurple;
|
||||
get portraitOfflineBorderColor => purple;
|
||||
get portraitOnlineBorderColor => whiteishPurple;
|
||||
get portraitOnlineAwayColor => Color(0xFFFFF59D);
|
||||
get portraitOnlineBusyColor => Color(0xFFEF9A9A);
|
||||
get portraitProfileBadgeColor => hotPink;
|
||||
get portraitProfileBadgeTextColor => whiteishPurple;
|
||||
get scrollbarDefaultColor => purple;
|
||||
|
@ -79,8 +82,11 @@ class CwtchDark extends OpaqueThemeType {
|
|||
get textfieldBorderColor => deepPurple;
|
||||
get textfieldErrorColor => hotPink;
|
||||
get textfieldHintColor => mainTextColor;
|
||||
get textfieldSelectionColor => accent;
|
||||
get toolbarIconColor => settings; //whiteishPurple;
|
||||
get topbarColor => header; //darkGreyPurple;
|
||||
get menuBackgroundColor => accent;
|
||||
get menuTextColor => darkGreyPurple;
|
||||
get snackbarBackgroundColor => accent;
|
||||
get snackbarTextColor => whitePurple;
|
||||
get chatImageColor => purple;
|
||||
|
@ -111,6 +117,7 @@ class CwtchLight extends OpaqueThemeType {
|
|||
get messageFromMeTextColor => font; //mainTextColor;
|
||||
get messageFromOtherBackgroundColor => peerBubble; //purple;
|
||||
get messageFromOtherTextColor => font; //darkPurple;
|
||||
get messageSelectionColor => accent;
|
||||
get portraitBackgroundColor => softPurple;
|
||||
get portraitBlockedBorderColor => softGrey;
|
||||
get portraitBlockedTextColor => softGrey;
|
||||
|
@ -118,6 +125,8 @@ class CwtchLight extends OpaqueThemeType {
|
|||
get portraitContactBadgeTextColor => whitePurple;
|
||||
get portraitOfflineBorderColor => greyPurple;
|
||||
get portraitOnlineBorderColor => greyPurple;
|
||||
get portraitOnlineAwayColor => Color(0xFFFFF59D);
|
||||
get portraitOnlineBusyColor => Color(0xFFEF9A9A);
|
||||
get portraitProfileBadgeColor => accent;
|
||||
get portraitProfileBadgeTextColor => whitePurple;
|
||||
get scrollbarDefaultColor => accent;
|
||||
|
@ -127,8 +136,11 @@ class CwtchLight extends OpaqueThemeType {
|
|||
get textfieldBorderColor => purple;
|
||||
get textfieldErrorColor => hotPink;
|
||||
get textfieldHintColor => font;
|
||||
get textfieldSelectionColor => accent;
|
||||
get toolbarIconColor => settings; //darkPurple;
|
||||
get topbarColor => header; //softPurple;
|
||||
get menuBackgroundColor => accent;
|
||||
get menuTextColor => whitePurple;
|
||||
get snackbarBackgroundColor => accent;
|
||||
get snackbarTextColor => whitePurple;
|
||||
get chatImageColor => purple;
|
||||
|
|
|
@ -99,6 +99,7 @@ abstract class OpaqueThemeType {
|
|||
get textfieldBorderColor => red;
|
||||
get textfieldHintColor => red;
|
||||
get textfieldErrorColor => red;
|
||||
get textfieldSelectionColor => red;
|
||||
get scrollbarDefaultColor => red;
|
||||
get portraitBackgroundColor => red;
|
||||
get portraitOnlineBorderColor => red;
|
||||
|
@ -123,6 +124,9 @@ abstract class OpaqueThemeType {
|
|||
get messageFromMeTextColor => red;
|
||||
get messageFromOtherBackgroundColor => red;
|
||||
get messageFromOtherTextColor => red;
|
||||
get messageSelectionColor => red;
|
||||
|
||||
get menuBackgroundColor => red;
|
||||
|
||||
get snackbarBackgroundColor => red;
|
||||
get snackbarTextColor => red;
|
||||
|
@ -142,11 +146,33 @@ abstract class OpaqueThemeType {
|
|||
}
|
||||
}
|
||||
|
||||
// Borrowed from Stackoverflow
|
||||
MaterialColor getMaterialColor(Color color) {
|
||||
final int red = color.red;
|
||||
final int green = color.green;
|
||||
final int blue = color.blue;
|
||||
|
||||
final Map<int, Color> shades = {
|
||||
50: Color.fromRGBO(red, green, blue, .1),
|
||||
100: Color.fromRGBO(red, green, blue, .2),
|
||||
200: Color.fromRGBO(red, green, blue, .3),
|
||||
300: Color.fromRGBO(red, green, blue, .4),
|
||||
400: Color.fromRGBO(red, green, blue, .5),
|
||||
500: Color.fromRGBO(red, green, blue, .6),
|
||||
600: Color.fromRGBO(red, green, blue, .7),
|
||||
700: Color.fromRGBO(red, green, blue, .8),
|
||||
800: Color.fromRGBO(red, green, blue, .9),
|
||||
900: Color.fromRGBO(red, green, blue, 1),
|
||||
};
|
||||
|
||||
return MaterialColor(color.value, shades);
|
||||
}
|
||||
|
||||
ThemeData mkThemeData(Settings opaque) {
|
||||
return ThemeData(
|
||||
hoverColor: opaque.current().backgroundHilightElementColor.withOpacity(0.5),
|
||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||
primarySwatch: Colors.red,
|
||||
primarySwatch: getMaterialColor(opaque.current().topbarColor),
|
||||
primaryIconTheme: IconThemeData(
|
||||
color: opaque.current().mainTextColor,
|
||||
),
|
||||
|
@ -249,7 +275,7 @@ ThemeData mkThemeData(Settings opaque) {
|
|||
enableFeedback: true,
|
||||
splashColor: opaque.current().defaultButtonActiveColor),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: opaque.current().defaultButtonActiveColor, selectionColor: opaque.current().defaultButtonActiveColor, selectionHandleColor: opaque.current().defaultButtonActiveColor),
|
||||
cursorColor: opaque.current().textfieldSelectionColor, selectionColor: opaque.current().textfieldSelectionColor, selectionHandleColor: opaque.current().textfieldSelectionColor),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
color: opaque.current().backgroundPaneColor.withOpacity(0.9),
|
||||
),
|
||||
|
|
|
@ -175,6 +175,7 @@ class YmlTheme extends OpaqueThemeType {
|
|||
get textfieldBorderColor => getColor("textfieldBorderColor") ?? fallbackTheme.textfieldBorderColor;
|
||||
get textfieldHintColor => getColor("textfieldHintColor") ?? fallbackTheme.textfieldHintColor;
|
||||
get textfieldErrorColor => getColor("textfieldErrorColor") ?? fallbackTheme.textfieldErrorColor;
|
||||
get textfieldSelectionColor => getColor("textfieldSelectionColor") ?? fallbackTheme.textfieldSelectionColor;
|
||||
get scrollbarDefaultColor => getColor("scrollbarDefaultColor") ?? fallbackTheme.scrollbarDefaultColor;
|
||||
get portraitBackgroundColor => getColor("portraitBackgroundColor") ?? fallbackTheme.portraitBackgroundColor;
|
||||
get portraitOnlineBorderColor => getColor("portraitOnlineBorderColor") ?? fallbackTheme.portraitOnlineBorderColor;
|
||||
|
@ -185,8 +186,8 @@ class YmlTheme extends OpaqueThemeType {
|
|||
get portraitContactBadgeTextColor => getColor("portraitContactBadgeTextColor") ?? fallbackTheme.portraitContactBadgeTextColor;
|
||||
get portraitProfileBadgeColor => getColor("portraitProfileBadgeColor") ?? fallbackTheme.portraitProfileBadgeColor;
|
||||
get portraitProfileBadgeTextColor => getColor("portraitProfileBadgeTextColor") ?? fallbackTheme.portraitProfileBadgeTextColor;
|
||||
get portraitOnlineAwayColor => Color(0xFFFFF59D) ?? fallbackTheme.portraitOnlineAwayColor;
|
||||
get portraitOnlineBusyColor => Color(0xFFEF9A9A) ?? fallbackTheme.portraitOnlineBusyColor;
|
||||
get portraitOnlineAwayColor => getColor("portraitOnlineAwayColor") ?? fallbackTheme.portraitOnlineAwayColor;
|
||||
get portraitOnlineBusyColor => getColor("portraitOnlineBusyColor") ?? fallbackTheme.portraitOnlineBusyColor;
|
||||
get dropShadowColor => getColor("dropShadowColor") ?? fallbackTheme.dropShadowColor;
|
||||
get toolbarIconColor => getColor("toolbarIconColor") ?? fallbackTheme.toolbarIconColor;
|
||||
get chatReactionIconColor => getColor("chatReactionIconColor") ?? fallbackTheme.chatReactionIconColor;
|
||||
|
@ -194,6 +195,8 @@ class YmlTheme extends OpaqueThemeType {
|
|||
get messageFromMeTextColor => getColor("messageFromMeTextColor") ?? fallbackTheme.messageFromMeTextColor;
|
||||
get messageFromOtherBackgroundColor => getColor("messageFromOtherBackgroundColor") ?? fallbackTheme.messageFromOtherBackgroundColor;
|
||||
get messageFromOtherTextColor => getColor("messageFromOtherTextColor") ?? fallbackTheme.messageFromOtherTextColor;
|
||||
get messageSelectionColor => getColor("messageSelectionColor") ?? fallbackTheme.messageSelectionColor;
|
||||
get menuBackgroundColor => getColor("menuBackgroundColor") ?? fallbackTheme.menuBackgroundColor;
|
||||
get snackbarBackgroundColor => getColor("snackbarBackgroundColor") ?? fallbackTheme.snackbarBackgroundColor;
|
||||
get snackbarTextColor => getColor("snackbarTextColor") ?? fallbackTheme.snackbarTextColor;
|
||||
|
||||
|
|
|
@ -516,7 +516,9 @@ class _MessageViewState extends State<MessageView> {
|
|||
height: 164 + ((Provider.of<ContactInfoState>(context).messageDraft.messageText.split("\n").length - 1) * 16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [preview]),
|
||||
Container(
|
||||
decoration: BoxDecoration(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [preview])),
|
||||
Container(
|
||||
decoration: BoxDecoration(border: Border(top: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor))),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [wdgMessage])),
|
||||
|
|
|
@ -49,44 +49,51 @@ class _CwtchButtonTextFieldState extends State<CwtchButtonTextField> {
|
|||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(),
|
||||
child: TextFormField(
|
||||
key: widget.testKey,
|
||||
controller: widget.controller,
|
||||
readOnly: widget.readonly,
|
||||
showCursor: !widget.readonly,
|
||||
focusNode: _focusNode,
|
||||
enableIMEPersonalizedLearning: false,
|
||||
onChanged: widget.onChanged,
|
||||
maxLines: 1,
|
||||
style: widget.textStyle == null ? TextStyle(overflow: TextOverflow.clip) : widget.textStyle,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
labelStyle: TextStyle(color: theme.current().mainTextColor, backgroundColor: theme.current().textfieldBackgroundColor),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: widget.onPressed,
|
||||
icon: widget.icon,
|
||||
splashRadius: Material.defaultSplashRadius / 2,
|
||||
padding: EdgeInsets.fromLTRB(0.0, 4.0, 2.0, 2.0),
|
||||
tooltip: widget.tooltip,
|
||||
enableFeedback: true,
|
||||
color: theme.current().mainTextColor,
|
||||
highlightColor: theme.current().defaultButtonColor,
|
||||
focusColor: theme.current().defaultButtonActiveColor,
|
||||
splashColor: theme.current().defaultButtonActiveColor,
|
||||
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
||||
),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
filled: true,
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorStyle: TextStyle(
|
||||
color: theme.current().textfieldErrorColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0))),
|
||||
));
|
||||
),
|
||||
child: TextFormField(
|
||||
key: widget.testKey,
|
||||
controller: widget.controller,
|
||||
readOnly: widget.readonly,
|
||||
showCursor: !widget.readonly,
|
||||
focusNode: _focusNode,
|
||||
enableIMEPersonalizedLearning: false,
|
||||
onChanged: widget.onChanged,
|
||||
maxLines: 1,
|
||||
style: widget.textStyle == null ? TextStyle(overflow: TextOverflow.clip) : widget.textStyle,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
labelStyle: TextStyle(color: theme.current().mainTextColor, backgroundColor: theme.current().textfieldBackgroundColor),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: widget.onPressed,
|
||||
icon: widget.icon,
|
||||
splashRadius: Material.defaultSplashRadius / 2,
|
||||
padding: EdgeInsets.fromLTRB(0.0, 4.0, 2.0, 2.0),
|
||||
tooltip: widget.tooltip,
|
||||
enableFeedback: true,
|
||||
color: theme.current().mainTextColor,
|
||||
highlightColor: theme.current().defaultButtonColor,
|
||||
focusColor: theme.current().defaultButtonActiveColor,
|
||||
splashColor: theme.current().defaultButtonActiveColor,
|
||||
),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
filled: true,
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorStyle: TextStyle(
|
||||
color: theme.current().textfieldErrorColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0))),
|
||||
)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,11 +71,23 @@ class MessageBubbleState extends State<MessageBubble> {
|
|||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(9.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
||||
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: fromMe ? [wdgMessage, wdgDecorations] : [wdgSender, wdgMessage, wdgDecorations])))));
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: Provider.of<Settings>(context).theme.messageSelectionColor,
|
||||
selectionColor: Provider.of<Settings>(context).theme.messageSelectionColor,
|
||||
selectionHandleColor: Provider.of<Settings>(context).theme.messageSelectionColor),
|
||||
|
||||
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
||||
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: fromMe ? [wdgMessage, wdgDecorations] : [wdgSender, wdgMessage, wdgDecorations]))))));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,45 +38,52 @@ class _CwtchPasswordTextFieldState extends State<CwtchPasswordField> {
|
|||
}
|
||||
|
||||
return Consumer<Settings>(builder: (context, theme, child) {
|
||||
return TextFormField(
|
||||
autofocus: widget.autofocus,
|
||||
controller: widget.controller,
|
||||
validator: widget.validator,
|
||||
obscureText: obscureText,
|
||||
obscuringCharacter: '*',
|
||||
enableIMEPersonalizedLearning: false,
|
||||
autofillHints: widget.autoFillHints,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
onFieldSubmitted: widget.action,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false,
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
obscureText = !obscureText;
|
||||
});
|
||||
},
|
||||
icon: Icon((obscureText ? CwtchIcons.eye_closed : CwtchIcons.eye_open), semanticLabel: label),
|
||||
tooltip: label,
|
||||
color: theme.current().mainTextColor,
|
||||
highlightColor: theme.current().defaultButtonColor,
|
||||
focusColor: theme.current().defaultButtonActiveColor,
|
||||
splashColor: theme.current().defaultButtonActiveColor,
|
||||
splashRadius: Material.defaultSplashRadius / 2,
|
||||
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
||||
),
|
||||
),
|
||||
errorStyle: TextStyle(
|
||||
color: theme.current().textfieldErrorColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
filled: true,
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
),
|
||||
);
|
||||
child: TextFormField(
|
||||
autofocus: widget.autofocus,
|
||||
controller: widget.controller,
|
||||
validator: widget.validator,
|
||||
obscureText: obscureText,
|
||||
obscuringCharacter: '*',
|
||||
enableIMEPersonalizedLearning: false,
|
||||
autofillHints: widget.autoFillHints,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
onFieldSubmitted: widget.action,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false,
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
obscureText = !obscureText;
|
||||
});
|
||||
},
|
||||
icon: Icon((obscureText ? CwtchIcons.eye_closed : CwtchIcons.eye_open), semanticLabel: label),
|
||||
tooltip: label,
|
||||
color: theme.current().mainTextColor,
|
||||
highlightColor: theme.current().defaultButtonColor,
|
||||
focusColor: theme.current().defaultButtonActiveColor,
|
||||
splashColor: theme.current().defaultButtonActiveColor,
|
||||
splashRadius: Material.defaultSplashRadius / 2,
|
||||
),
|
||||
errorStyle: TextStyle(
|
||||
color: theme.current().textfieldErrorColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
filled: true,
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,39 +47,46 @@ class _CwtchTextFieldState extends State<CwtchTextField> {
|
|||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(),
|
||||
child: TextFormField(
|
||||
key: widget.testKey,
|
||||
controller: widget.controller,
|
||||
validator: widget.validator,
|
||||
onChanged: widget.onChanged,
|
||||
autofocus: widget.autofocus,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
textAlign: widget.number ? TextAlign.end : TextAlign.start,
|
||||
keyboardType: widget.multiLine
|
||||
? TextInputType.multiline
|
||||
: widget.number
|
||||
? TextInputType.number
|
||||
: TextInputType.text,
|
||||
inputFormatters: widget.number ? <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly] : null,
|
||||
maxLines: widget.multiLine ? null : 1,
|
||||
scrollController: _scrollController,
|
||||
enableIMEPersonalizedLearning: false,
|
||||
focusNode: _focusNode,
|
||||
style: Provider.of<Settings>(context).scaleFonts(defaultTextStyle).copyWith(overflow: TextOverflow.clip),
|
||||
decoration: InputDecoration(
|
||||
errorMaxLines: 2,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: TextStyle(color: (theme.current().mainTextColor as Color).withOpacity(0.5)),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
filled: true,
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorStyle: TextStyle(color: theme.current().textfieldErrorColor, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
contentPadding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0))),
|
||||
));
|
||||
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
||||
),
|
||||
),
|
||||
child: TextFormField(
|
||||
key: widget.testKey,
|
||||
controller: widget.controller,
|
||||
validator: widget.validator,
|
||||
onChanged: widget.onChanged,
|
||||
autofocus: widget.autofocus,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
textAlign: widget.number ? TextAlign.end : TextAlign.start,
|
||||
keyboardType: widget.multiLine
|
||||
? TextInputType.multiline
|
||||
: widget.number
|
||||
? TextInputType.number
|
||||
: TextInputType.text,
|
||||
inputFormatters: widget.number ? <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly] : null,
|
||||
maxLines: widget.multiLine ? null : 1,
|
||||
scrollController: _scrollController,
|
||||
enableIMEPersonalizedLearning: false,
|
||||
focusNode: _focusNode,
|
||||
style: Provider.of<Settings>(context).scaleFonts(defaultTextStyle).copyWith(overflow: TextOverflow.clip),
|
||||
decoration: InputDecoration(
|
||||
errorMaxLines: 2,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: TextStyle(color: (theme.current().mainTextColor as Color).withOpacity(0.5)),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
filled: true,
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 1.0)),
|
||||
errorStyle: TextStyle(color: theme.current().textfieldErrorColor, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),
|
||||
fillColor: theme.current().textfieldBackgroundColor,
|
||||
contentPadding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(6.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 1.0))),
|
||||
)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Loading…
Reference in New Issue