Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messageBar textfield customization #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.17.2"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -219,10 +219,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
js:
dependency: transitive
description:
Expand All @@ -235,18 +235,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.15"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -352,10 +352,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
sqflite:
dependency: transitive
description:
Expand Down Expand Up @@ -416,10 +416,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.6.0"
typed_data:
dependency: transitive
description:
Expand All @@ -444,6 +444,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
win32:
dependency: transitive
description:
Expand All @@ -461,5 +469,5 @@ packages:
source: hosted
version: "1.0.2"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.3.0"
60 changes: 37 additions & 23 deletions lib/message_bars/message_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import 'package:flutter/material.dart';
/// [replyWidgetColor] is the reply widget color
/// [replyIconColor] is the reply icon color on the left side of reply widget
/// [replyCloseColor] is the close icon color on the right side of the reply
/// [textFieldColor] is the fill color of the message textfield
/// [textFieldBorderColor] is the border color of the message textfield
/// [textFieldBorderRadius] is the border radius of the message textfield
/// [textFieldDecoration] is the input decoration for the message text field
/// widget
/// [messageBarColor] is the color of the message bar
/// [sendButtonColor] is the color of the send button
Expand All @@ -44,6 +48,10 @@ class MessageBar extends StatelessWidget {
final TextStyle messageBarHintStyle;
final TextStyle textFieldTextStyle;
final Color sendButtonColor;
final Color textFieldColor;
final Color textFieldBorderColor;
final double textFieldBorderRadius;
final InputDecoration? textFieldDecoration;
final void Function(String)? onTextChanged;
final void Function(String)? onSend;
final void Function()? onTapCloseReply;
Expand All @@ -63,6 +71,10 @@ class MessageBar extends StatelessWidget {
this.messageBarHintText = "Type your message here",
this.messageBarHintStyle = const TextStyle(fontSize: 16),
this.textFieldTextStyle = const TextStyle(color: Colors.black),
this.textFieldColor = Colors.white,
this.textFieldBorderColor = Colors.white,
this.textFieldBorderRadius = 30,
this.textFieldDecoration,
this.onTextChanged,
this.onSend,
this.onTapCloseReply,
Expand Down Expand Up @@ -95,7 +107,7 @@ class MessageBar extends StatelessWidget {
Expanded(
child: Container(
child: Text(
'Re : ' + replyingTo,
'Re : $replyingTo',
overflow: TextOverflow.ellipsis,
),
),
Expand Down Expand Up @@ -136,29 +148,31 @@ class MessageBar extends StatelessWidget {
maxLines: 3,
onChanged: onTextChanged,
style: textFieldTextStyle,
decoration: InputDecoration(
hintText: messageBarHintText,
hintMaxLines: 1,
contentPadding: const EdgeInsets.symmetric(
horizontal: 8.0, vertical: 10),
hintStyle: messageBarHintStyle,
fillColor: Colors.white,
filled: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(30.0),
borderSide: const BorderSide(
color: Colors.white,
width: 0.2,
decoration: textFieldDecoration ??
InputDecoration(
hintText: messageBarHintText,
hintMaxLines: 1,
contentPadding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 10),
hintStyle: messageBarHintStyle,
fillColor: textFieldColor,
filled: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(
textFieldBorderRadius),
borderSide: BorderSide(
color: textFieldBorderColor,
width: 0.2,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(30.0),
borderSide: const BorderSide(
color: Colors.black26,
width: 0.2,
),
),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(30.0),
borderSide: const BorderSide(
color: Colors.black26,
width: 0.2,
),
),
),
),
),
),
Expand Down