Compare commits
2 Commits
b4063a64e0
...
5c51eefa3e
Author | SHA1 | Date | |
---|---|---|---|
5c51eefa3e | |||
0d7ae321a7 |
@ -159,7 +159,8 @@
|
||||
"stickerPickerNoStickersLine1": "You have no sticker packs installed.",
|
||||
"stickerPickerNoStickersLine2": "They can be installed in the sticker settings.",
|
||||
"stickerSettings": "Sticker settings",
|
||||
"newDeviceMessage": "${title} added a new encryption device"
|
||||
"newDeviceMessage": "${title} added a new encryption device",
|
||||
"messageHint": "Send a message..."
|
||||
},
|
||||
"addcontact": {
|
||||
"title": "Add new contact",
|
||||
|
@ -159,7 +159,8 @@
|
||||
"stickerPickerNoStickersLine1": "Du hast keine Stickerpacks installiert.",
|
||||
"stickerPickerNoStickersLine2": "Diese können in den Stickereinstellungen installiert werden.",
|
||||
"stickerSettings": "Stickereinstellungen",
|
||||
"newDeviceMessage": "${title} hat ein neues Verschlüsselungsgerät hinzugefügt"
|
||||
"newDeviceMessage": "${title} hat ein neues Verschlüsselungsgerät hinzugefügt",
|
||||
"messageHint": "Nachricht senden..."
|
||||
},
|
||||
"addcontact": {
|
||||
"title": "Neuen Kontakt hinzufügen",
|
||||
|
@ -4,9 +4,24 @@ const Radius radiusLarge = Radius.circular(10);
|
||||
const Radius radiusSmall = Radius.circular(4);
|
||||
|
||||
const double textfieldRadiusRegular = 15;
|
||||
const double textfieldRadiusConversation = 20;
|
||||
const EdgeInsetsGeometry textfieldPaddingRegular = EdgeInsets.only(top: 4, bottom: 4, left: 8, right: 8);
|
||||
const EdgeInsetsGeometry textfieldPaddingConversation = EdgeInsets.all(10);
|
||||
const double textfieldRadiusConversation = 25;
|
||||
const EdgeInsetsGeometry textfieldPaddingRegular = EdgeInsets.only(
|
||||
top: 4,
|
||||
bottom: 4,
|
||||
left: 8,
|
||||
right: 8,
|
||||
);
|
||||
|
||||
/// The inner TextField padding for the TextField on the ConversationPage.
|
||||
const EdgeInsetsGeometry textfieldPaddingConversation = EdgeInsets.only(
|
||||
top: 12,
|
||||
bottom: 12,
|
||||
left: 8,
|
||||
right: 8,
|
||||
);
|
||||
|
||||
/// The font size for the TextField on the ConversationPage
|
||||
const double textFieldFontSizeConversation = 18;
|
||||
|
||||
const int primaryColorHexRGBO = 0xffcf4aff;
|
||||
const int primaryColorAltHexRGB = 0xff9c18cd;
|
||||
@ -25,6 +40,14 @@ const Color bubbleQuoteInTextFieldColorDark = Color(0xff2f2f2f);
|
||||
const Color bubbleQuoteInTextFieldTextColorLight = Color(0xff373737);
|
||||
const Color bubbleQuoteInTextFieldTextColorDark = Color(0xffdadada);
|
||||
|
||||
/// The text color of the hint text on the ConversationPage
|
||||
const Color textFieldHintTextColorLight = Color(0xff4a4a4a);
|
||||
const Color textFieldHintTextColorDark = Color(0xffd6d6d6);
|
||||
|
||||
/// The regular text color of the TextField on the ConversationPage
|
||||
const Color textFieldTextColorLight = Colors.black;
|
||||
const Color textFieldTextColorDark = Colors.white;
|
||||
|
||||
/// The color of a bubble that was sent
|
||||
const Color bubbleColorSent = Color(0xff7e0bce);
|
||||
|
||||
|
@ -80,15 +80,6 @@ class ConversationBottomRowState extends State<ConversationBottomRow> {
|
||||
);
|
||||
}
|
||||
|
||||
Color _getTextColor(BuildContext context) {
|
||||
// TODO(Unknown): Work on the colors
|
||||
if (MediaQuery.of(context).platformBrightness == Brightness.dark) {
|
||||
return Colors.white;
|
||||
}
|
||||
|
||||
return Colors.black;
|
||||
}
|
||||
|
||||
IconData _getSendButtonIcon(ConversationState state) {
|
||||
switch (state.sendButtonState) {
|
||||
case SendButtonState.audio: return Icons.mic;
|
||||
@ -123,11 +114,11 @@ class ConversationBottomRowState extends State<ConversationBottomRow> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: CustomTextField(
|
||||
// TODO(Unknown): Work on the colors
|
||||
backgroundColor: Theme.of(context).extension<MoxxyThemeData>()!.conversationTextFieldColor,
|
||||
textColor: _getTextColor(context),
|
||||
textColor: Theme.of(context).extension<MoxxyThemeData>()!.conversationTextFieldTextColor,
|
||||
maxLines: 5,
|
||||
hintText: 'Send a message...',
|
||||
hintText: t.pages.conversation.messageHint,
|
||||
hintTextColor: Theme.of(context).extension<MoxxyThemeData>()!.conversationTextFieldHintTextColor,
|
||||
isDense: true,
|
||||
onChanged: (value) {
|
||||
context.read<ConversationBloc>().add(
|
||||
@ -135,6 +126,7 @@ class ConversationBottomRowState extends State<ConversationBottomRow> {
|
||||
);
|
||||
},
|
||||
contentPadding: textfieldPaddingConversation,
|
||||
fontSize: textFieldFontSizeConversation,
|
||||
cornerRadius: textfieldRadiusConversation,
|
||||
controller: widget.controller,
|
||||
topWidget: state.quotedMessage != null ? buildQuoteMessageWidget(
|
||||
|
@ -10,6 +10,8 @@ class MoxxyThemeData extends ThemeExtension<MoxxyThemeData> {
|
||||
required this.profileFallbackTextColor,
|
||||
required this.bubbleQuoteInTextFieldColor,
|
||||
required this.bubbleQuoteInTextFieldTextColor,
|
||||
required this.conversationTextFieldHintTextColor,
|
||||
required this.conversationTextFieldTextColor,
|
||||
});
|
||||
|
||||
/// The color of the conversation TextField
|
||||
@ -27,14 +29,22 @@ class MoxxyThemeData extends ThemeExtension<MoxxyThemeData> {
|
||||
/// The color of text inside a quote bubble inside the TextField
|
||||
final Color bubbleQuoteInTextFieldTextColor;
|
||||
|
||||
/// The color of the hint text inside the TextField of the ConversationPage
|
||||
final Color conversationTextFieldHintTextColor;
|
||||
|
||||
/// The regular text color of the message TextField on the ConversationPage
|
||||
final Color conversationTextFieldTextColor;
|
||||
|
||||
@override
|
||||
MoxxyThemeData copyWith({Color? conversationTextFieldColor, Color? profileFallbackBackgroundColor, Color? profileFallbackTextColor, Color? bubbleQuoteInTextFieldColor, Color? bubbleQuoteInTextFieldTextColor}) {
|
||||
MoxxyThemeData copyWith({Color? conversationTextFieldColor, Color? profileFallbackBackgroundColor, Color? profileFallbackTextColor, Color? bubbleQuoteInTextFieldColor, Color? bubbleQuoteInTextFieldTextColor, Color? conversationTextFieldHintTextColor, Color? conversationTextFieldTextColor,}) {
|
||||
return MoxxyThemeData(
|
||||
conversationTextFieldColor: conversationTextFieldColor ?? this.conversationTextFieldColor,
|
||||
profileFallbackBackgroundColor: profileFallbackBackgroundColor ?? this.profileFallbackBackgroundColor,
|
||||
profileFallbackTextColor: profileFallbackTextColor ?? this.profileFallbackTextColor,
|
||||
bubbleQuoteInTextFieldColor: bubbleQuoteInTextFieldColor ?? this.bubbleQuoteInTextFieldColor,
|
||||
bubbleQuoteInTextFieldTextColor: bubbleQuoteInTextFieldTextColor ?? this.bubbleQuoteInTextFieldTextColor,
|
||||
conversationTextFieldHintTextColor: conversationTextFieldHintTextColor ?? this.conversationTextFieldHintTextColor,
|
||||
conversationTextFieldTextColor: conversationTextFieldTextColor ?? this.conversationTextFieldTextColor,
|
||||
);
|
||||
}
|
||||
|
||||
@ -104,6 +114,8 @@ ThemeData getThemeData(BuildContext context, Brightness brightness) {
|
||||
profileFallbackTextColor: profileFallbackTextColorDark,
|
||||
bubbleQuoteInTextFieldColor: bubbleQuoteInTextFieldColorDark,
|
||||
bubbleQuoteInTextFieldTextColor: bubbleQuoteInTextFieldTextColorDark,
|
||||
conversationTextFieldHintTextColor: textFieldHintTextColorDark,
|
||||
conversationTextFieldTextColor: textFieldTextColorDark,
|
||||
)
|
||||
else
|
||||
const MoxxyThemeData(
|
||||
@ -112,6 +124,8 @@ ThemeData getThemeData(BuildContext context, Brightness brightness) {
|
||||
profileFallbackTextColor: profileFallbackTextColorLight,
|
||||
bubbleQuoteInTextFieldColor: bubbleQuoteInTextFieldColorLight,
|
||||
bubbleQuoteInTextFieldTextColor: bubbleQuoteInTextFieldTextColorLight,
|
||||
conversationTextFieldHintTextColor: textFieldHintTextColorLight,
|
||||
conversationTextFieldTextColor: textFieldTextColorLight,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -7,6 +7,7 @@ class CustomTextField extends StatelessWidget {
|
||||
this.errorText,
|
||||
this.labelText,
|
||||
this.hintText,
|
||||
this.hintTextColor,
|
||||
this.suffix,
|
||||
this.suffixText,
|
||||
this.topWidget,
|
||||
@ -31,6 +32,7 @@ class CustomTextField extends StatelessWidget {
|
||||
this.onTap,
|
||||
this.shouldSummonKeyboard,
|
||||
this.focusNode,
|
||||
this.fontSize,
|
||||
super.key,
|
||||
});
|
||||
final double cornerRadius;
|
||||
@ -54,8 +56,10 @@ class CustomTextField extends StatelessWidget {
|
||||
final int minLines;
|
||||
final Color? backgroundColor;
|
||||
final Color? textColor;
|
||||
final Color? hintTextColor;
|
||||
final double? borderWidth;
|
||||
final Color? borderColor;
|
||||
final double? fontSize;
|
||||
final TextEditingController? controller;
|
||||
final ValueChanged<String>? onChanged;
|
||||
final void Function()? onTap;
|
||||
@ -64,7 +68,12 @@ class CustomTextField extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final style = textColor != null ? TextStyle(color: textColor) : null;
|
||||
final style = textColor != null ?
|
||||
TextStyle(
|
||||
color: textColor,
|
||||
fontSize: fontSize,
|
||||
) :
|
||||
null;
|
||||
return Column(
|
||||
children: [
|
||||
DecoratedBox(
|
||||
@ -105,7 +114,10 @@ class CustomTextField extends StatelessWidget {
|
||||
isDense: isDense,
|
||||
labelStyle: style,
|
||||
suffixStyle: style,
|
||||
hintStyle: style,
|
||||
hintStyle: TextStyle(
|
||||
color: hintTextColor,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
prefixIcon: prefixIcon,
|
||||
prefixIconConstraints: prefixIconConstraints,
|
||||
suffixIconConstraints: suffixIconConstraints,
|
||||
|
Loading…
Reference in New Issue
Block a user