@@ -7,10 +7,12 @@ import 'package:lam7a/core/providers/authentication.dart';
77import 'package:lam7a/features/profile/repository/profile_repository.dart' ;
88import 'package:lam7a/features/tweet/ui/viewmodel/tweet_home_viewmodel.dart' ;
99
10+
1011class FollowButton extends ConsumerStatefulWidget {
1112 final UserModel user;
13+ final VoidCallback ? onFollowStateChanged;
1214
13- const FollowButton ({super .key, required this .user});
15+ const FollowButton ({super .key, required this .user, this .onFollowStateChanged });
1416
1517 @override
1618 ConsumerState <FollowButton > createState () => _FollowButtonState ();
@@ -20,6 +22,8 @@ class _FollowButtonState extends ConsumerState<FollowButton> {
2022 late UserModel _user;
2123 bool _loading = false ;
2224
25+
26+
2327 @override
2428 void initState () {
2529 super .initState ();
@@ -65,6 +69,7 @@ class _FollowButtonState extends ConsumerState<FollowButton> {
6569 myUser.copyWith (followingCount: myUser.followingCount + 1 ),
6670 );
6771 }
72+ widget.onFollowStateChanged? .call ();
6873
6974 if (mounted) setState (() {});
7075 } finally {
@@ -81,10 +86,17 @@ class _FollowButtonState extends ConsumerState<FollowButton> {
8186
8287 return OutlinedButton (
8388 onPressed: _loading ? null : _toggle,
84- style: OutlinedButton .styleFrom (
89+ style: OutlinedButton .styleFrom
90+ (
91+ side: BorderSide (
92+ color: Theme .of (context).brightness == Brightness .light
93+ ? Colors .black
94+ : Colors .white,
95+ ),
96+
97+
8598 backgroundColor: isFollowing ? Colors .white : Colors .black,
8699 foregroundColor: isFollowing ? Colors .black : Colors .white,
87- side: const BorderSide (color: Colors .black),
88100 shape: RoundedRectangleBorder (borderRadius: BorderRadius .circular (20 )),
89101 padding: const EdgeInsets .symmetric (
90102 horizontal: 14 ,
0 commit comments