@@ -95,7 +95,11 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
95
95
// height: 50,
96
96
child: Column (
97
97
children: [
98
- MessageInput (_controller, _sendComment,list: _state.users,),
98
+ MessageInput (
99
+ _controller,
100
+ _sendComment,
101
+ list: _state.users,
102
+ ),
99
103
for (var comment
100
104
in _state.issue! .comments! )
101
105
_commentItem (context, comment,
@@ -112,7 +116,11 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
112
116
title: Text (
113
117
"Comments" ), // padding: const EdgeInsets.all(0),
114
118
children: [
115
- MessageInput (_controller, _sendComment,list: _state.users,)
119
+ MessageInput (
120
+ _controller,
121
+ _sendComment,
122
+ list: _state.users,
123
+ )
116
124
],
117
125
),
118
126
],
@@ -198,14 +206,8 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
198
206
_getPriorityBackgroundColor (
199
207
IssueMapper .priorityToString (issue.issuePriority)),
200
208
true ),
201
-
202
- // ],
203
- // )
204
209
],
205
210
),
206
- // SizedBox(
207
- // width: size.width / 3.2,
208
- // ),
209
211
],
210
212
),
211
213
);
@@ -419,12 +421,10 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
419
421
return Padding (
420
422
padding: const EdgeInsets .only (left: 20 , top: 20 ),
421
423
child: Row (
422
- // mainAxisAlignment: MainAxisAlignment.spaceBetween,
423
424
crossAxisAlignment: CrossAxisAlignment .start,
424
425
children: [
425
426
Expanded (
426
427
child: Row (
427
- // mainAxisAlignment: MainAxisAlignment.spaceAround,
428
428
crossAxisAlignment: CrossAxisAlignment .start,
429
429
children: [
430
430
Align (
@@ -501,7 +501,7 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
501
501
onSelected: (int value) async {
502
502
if (value == 0 ) {
503
503
final String ? newText =
504
- await _asyncInputDialog (context);
504
+ await _asyncInputDialog (context, comment );
505
505
setState (() {
506
506
comment.body = newText;
507
507
Provider .of <IssueDetailBloc >(context, listen: false )
@@ -534,23 +534,23 @@ class _IssueDetailScreenState extends State<IssueDetailScreen> {
534
534
);
535
535
}
536
536
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! ;
539
540
return showDialog <String >(
540
541
context: context,
541
- barrierDismissible:
542
- false , // dialog is dismissible with a tap on the barrier
542
+ barrierDismissible: false ,
543
543
builder: (BuildContext context) {
544
544
return AlertDialog (
545
545
title: Text ('Update your comment' ),
546
546
content: new Row (
547
547
children: < Widget > [
548
548
new Expanded (
549
- child: new TextField (
549
+ child: new TextFormField (
550
+ initialValue: sampleText,
550
551
autofocus: true ,
551
552
decoration: new InputDecoration (
552
- focusColor: Colors .teal,
553
- labelText: 'Update Comment Here' ),
553
+ focusColor: Colors .teal, labelText: 'Update Comment Here' ),
554
554
onChanged: (value) {
555
555
sampleText = value;
556
556
},
0 commit comments