@@ -28,9 +28,30 @@ class _FeedPostReplyPageState extends State<FeedPostReplyPage> {
28
28
bool isScrollingDown = false ;
29
29
String postId;
30
30
File _image;
31
+ FeedModel model;
31
32
@override
32
33
void initState () {
33
34
postId = widget.postId;
35
+ var feedState = Provider .of <FeedState >(context,listen: false );
36
+
37
+ /// if tweet is detail tweet
38
+ if (feedState.tweetDetailModel.any ((x)=> x.key == postId)){
39
+ cprint ('Search tweet from tweet detail page stack tweet' );
40
+ model = feedState.tweetDetailModel.last;
41
+ }
42
+ /// if tweet is reply tweet
43
+ else if (feedState.tweetReplyMap.values.any ((x)=> x.any ((y)=> y.key == postId))){
44
+ cprint ('Search tweet from twee detail page roply tweet' );
45
+ feedState.tweetReplyMap.forEach ((key,value){
46
+ if (value.any ((x)=> x.key == postId)){
47
+ model = value.firstWhere ((x)=> x.key == postId);
48
+ }
49
+ });
50
+ }
51
+ else {
52
+ cprint ('Search tweet from home page tweet' );
53
+ model = feedState.feedlist.firstWhere ((x)=> x.key == postId);
54
+ }
34
55
scrollcontroller = ScrollController ();
35
56
_textEditingController = TextEditingController ();
36
57
scrollcontroller..addListener (_scrollListener);
@@ -40,6 +61,7 @@ class _FeedPostReplyPageState extends State<FeedPostReplyPage> {
40
61
@override
41
62
void dispose () {
42
63
scrollcontroller.dispose ();
64
+ _textEditingController.dispose ();
43
65
super .dispose ();
44
66
}
45
67
@@ -77,10 +99,8 @@ class _FeedPostReplyPageState extends State<FeedPostReplyPage> {
77
99
}
78
100
79
101
Widget _tweerCard () {
80
- var feedState = Provider .of <FeedState >(
81
- context,
82
- );
83
- var model = feedState.tweetDetailModel.last;
102
+
103
+
84
104
return Row (
85
105
crossAxisAlignment: CrossAxisAlignment .start,
86
106
mainAxisSize: MainAxisSize .min,
@@ -104,7 +124,7 @@ class _FeedPostReplyPageState extends State<FeedPostReplyPage> {
104
124
Container (
105
125
width: fullWidth (context) - 82 ,
106
126
child: UrlText (
107
- text: model.description,
127
+ text: model.description ?? '' ,
108
128
style: TextStyle (color: Colors .black,fontSize: 18 ,
109
129
fontWeight: FontWeight .w400),
110
130
urlStyle: TextStyle (
0 commit comments