Skip to content

Commit 080a7cc

Browse files
M-A-D-A-R-Aamlannandy
authored andcommitted
avatar padding & intial comment text
1 parent 6707e03 commit 080a7cc

File tree

2 files changed

+46
-42
lines changed

2 files changed

+46
-42
lines changed

labellab_mobile/lib/screen/issue/details/issue_details_screen.dart

+18-18
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
9595
// height: 50,
9696
child: Column(
9797
children: [
98-
MessageInput(_controller, _sendComment,list: _state.users,),
98+
MessageInput(
99+
_controller,
100+
_sendComment,
101+
list: _state.users,
102+
),
99103
for (var comment
100104
in _state.issue!.comments!)
101105
_commentItem(context, comment,
@@ -112,7 +116,11 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
112116
title: Text(
113117
"Comments"), // padding: const EdgeInsets.all(0),
114118
children: [
115-
MessageInput(_controller, _sendComment,list: _state.users,)
119+
MessageInput(
120+
_controller,
121+
_sendComment,
122+
list: _state.users,
123+
)
116124
],
117125
),
118126
],
@@ -198,14 +206,8 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
198206
_getPriorityBackgroundColor(
199207
IssueMapper.priorityToString(issue.issuePriority)),
200208
true),
201-
202-
// ],
203-
// )
204209
],
205210
),
206-
// SizedBox(
207-
// width: size.width / 3.2,
208-
// ),
209211
],
210212
),
211213
);
@@ -419,12 +421,10 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
419421
return Padding(
420422
padding: const EdgeInsets.only(left: 20, top: 20),
421423
child: Row(
422-
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
423424
crossAxisAlignment: CrossAxisAlignment.start,
424425
children: [
425426
Expanded(
426427
child: Row(
427-
// mainAxisAlignment: MainAxisAlignment.spaceAround,
428428
crossAxisAlignment: CrossAxisAlignment.start,
429429
children: [
430430
Align(
@@ -501,7 +501,7 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
501501
onSelected: (int value) async {
502502
if (value == 0) {
503503
final String? newText =
504-
await _asyncInputDialog(context);
504+
await _asyncInputDialog(context, comment);
505505
setState(() {
506506
comment.body = newText;
507507
Provider.of<IssueDetailBloc>(context, listen: false)
@@ -534,23 +534,23 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
534534
);
535535
}
536536

537-
Future<String?> _asyncInputDialog(BuildContext context) async {
538-
String sampleText = '';
537+
Future<String?> _asyncInputDialog(
538+
BuildContext context, Comment comment) async {
539+
String sampleText = comment.body!;
539540
return showDialog<String>(
540541
context: context,
541-
barrierDismissible:
542-
false, // dialog is dismissible with a tap on the barrier
542+
barrierDismissible: false,
543543
builder: (BuildContext context) {
544544
return AlertDialog(
545545
title: Text('Update your comment'),
546546
content: new Row(
547547
children: <Widget>[
548548
new Expanded(
549-
child: new TextField(
549+
child: new TextFormField(
550+
initialValue: sampleText,
550551
autofocus: true,
551552
decoration: new InputDecoration(
552-
focusColor: Colors.teal,
553-
labelText: 'Update Comment Here'),
553+
focusColor: Colors.teal, labelText: 'Update Comment Here'),
554554
onChanged: (value) {
555555
sampleText = value;
556556
},

labellab_mobile/lib/screen/project/chat/local_widgets/message_input.dart

+28-24
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ class _MessageInputState extends State<MessageInput> {
4141
maxHeight: 100,
4242
),
4343
child: Padding(
44-
padding: const EdgeInsets.only(left: 0),
44+
padding: const EdgeInsets.only(left: 10),
4545
child: FlutterMentions(
46+
suggestionListDecoration:
47+
BoxDecoration(color: Colors.grey.shade300),
4648
onEditingComplete: () {
4749
widget.onSubmit(isDataLoading);
4850
},
@@ -57,6 +59,7 @@ class _MessageInputState extends State<MessageInput> {
5759
if (_debounce?.isActive ?? false) _debounce!.cancel();
5860
_debounce = Timer(const Duration(milliseconds: 200), () {
5961
setState(() {
62+
mentiondata = [];
6063
widget.list!.forEach((element) {
6164
mentiondata.add({
6265
"username": element.username,
@@ -86,35 +89,38 @@ class _MessageInputState extends State<MessageInput> {
8689
matchAll: true,
8790
suggestionBuilder: (data) {
8891
return Padding(
89-
padding: const EdgeInsets.only(left:30.0),
90-
child: Card(
91-
elevation: 2,
92-
child: Container(
92+
padding: const EdgeInsets.only(left: 25, bottom: 5),
93+
child: Container(
9394
decoration: BoxDecoration(
94-
border: Border.all(
95-
color: Colors.grey,
95+
border: Border(
96+
bottom: BorderSide(
97+
color: Colors.grey,
98+
),
9699
),
97-
// borderRadius: BorderRadius.circular(10.0),
98100
),
99-
// margin: EdgeInsets.all(10),
100-
padding: const EdgeInsets.all(10.0),
101+
// padding: const EdgeInsets.all(10.0),
101102
child: Row(
102103
children: <Widget>[
103-
CircleAvatar(
104-
backgroundColor: Colors.black12,
105-
radius: 25,
106-
child: ClipOval(
107-
child: Image(
108-
width: 60,
109-
height: 60,
110-
image: CachedNetworkImageProvider(
111-
data['thumbnail']),
112-
fit: BoxFit.cover,
104+
Container(
105+
child: Padding(
106+
padding: const EdgeInsets.all(8.0),
107+
child: CircleAvatar(
108+
backgroundColor: Colors.black12,
109+
radius: 20,
110+
child: ClipOval(
111+
child: Image(
112+
width: 60,
113+
height: 60,
114+
image: CachedNetworkImageProvider(
115+
data['thumbnail']),
116+
fit: BoxFit.cover,
117+
),
118+
),
113119
),
114120
),
115121
),
116122
const SizedBox(
117-
width: 20.0,
123+
width: 10.0,
118124
),
119125
Column(
120126
crossAxisAlignment:
@@ -125,9 +131,7 @@ class _MessageInputState extends State<MessageInput> {
125131
],
126132
)
127133
],
128-
),
129-
),
130-
),
134+
)),
131135
);
132136
}),
133137
],

0 commit comments

Comments
 (0)