File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
lib/data/view/chat/widgets Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ChatMessageBubble extends StatefulWidget {
22
22
23
23
class _ChatMessageBubbleState extends State <ChatMessageBubble > {
24
24
bool _showFullText = false ;
25
+ final _textController = TextEditingController ();
25
26
26
27
@override
27
28
void initState () {
@@ -31,6 +32,12 @@ class _ChatMessageBubbleState extends State<ChatMessageBubble> {
31
32
}
32
33
}
33
34
35
+ @override
36
+ void dispose () {
37
+ _textController.dispose ();
38
+ super .dispose ();
39
+ }
40
+
34
41
@override
35
42
Widget build (BuildContext context) {
36
43
return Column (
@@ -139,18 +146,24 @@ class _ChatMessageBubbleState extends State<ChatMessageBubble> {
139
146
),
140
147
)
141
148
else
142
- TypeWriter (
143
- text: text,
144
- duration: const Duration (milliseconds: 30 ),
145
- textStyle: const TextStyle (
146
- color: Color (0xFFD1D5DB ),
147
- fontSize: 16 ,
148
- ),
149
- onEnd: () {
149
+ TypeWriterText (
150
+ controller: _textController,
151
+ builder: (context, value) {
152
+ return Text (
153
+ value,
154
+ style: const TextStyle (
155
+ color: Color (0xFFD1D5DB ),
156
+ fontSize: 16 ,
157
+ ),
158
+ );
159
+ },
160
+ onComplete: () {
150
161
setState (() {
151
162
_showFullText = true ;
152
163
});
153
164
},
165
+ text: Text (text),
166
+ duration: const Duration (milliseconds: 30 ),
154
167
),
155
168
if (! isUser) ...[
156
169
const Divider (color: Color (0xFF4D4D4D )),
You can’t perform that action at this time.
0 commit comments