|
|
@ -73,78 +73,80 @@ class _UserScreenState extends State<UserScreen> {
|
|
|
|
padding: EdgeInsets.only(top: 68.h, bottom: 40),
|
|
|
|
padding: EdgeInsets.only(top: 68.h, bottom: 40),
|
|
|
|
child: ProfileComponent(user: widget.user),
|
|
|
|
child: ProfileComponent(user: widget.user),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Align(
|
|
|
|
MyApp.userViewModel.userCurrent.id != widget.user.id
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
? Align(
|
|
|
|
child: isClicked
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
? SizedBox(
|
|
|
|
child: isClicked
|
|
|
|
// Définir une largeur minimale pour le bouton "Ajouter"
|
|
|
|
? SizedBox(
|
|
|
|
width: 120, // Réglez cette valeur en fonction de vos besoins
|
|
|
|
// Définir une largeur minimale pour le bouton "Ajouter"
|
|
|
|
child: Material(
|
|
|
|
width: 120, // Réglez cette valeur en fonction de vos besoins
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
child: Material(
|
|
|
|
color: selectedButton,
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
child: InkWell(
|
|
|
|
color: selectedButton,
|
|
|
|
splashColor: Colors.white.withOpacity(0.3),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
splashColor: Colors.white.withOpacity(0.3),
|
|
|
|
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
|
|
|
|
onTap: () async {
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
|
|
|
|
SnackBar(
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
content: Text(
|
|
|
|
SnackBar(
|
|
|
|
"Vous ne suivez plus ${widget.user.pseudo}",
|
|
|
|
content: Text(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
"Vous ne suivez plus ${widget.user.pseudo}",
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
),
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
),
|
|
|
|
closeIconColor: Colors.white,
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
),
|
|
|
|
closeIconColor: Colors.white,
|
|
|
|
);
|
|
|
|
),
|
|
|
|
setState(() {});
|
|
|
|
);
|
|
|
|
},
|
|
|
|
setState(() {});
|
|
|
|
child: Container(
|
|
|
|
},
|
|
|
|
padding: EdgeInsets.fromLTRB(28, 7, 28, 7),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(7))),
|
|
|
|
padding: EdgeInsets.fromLTRB(28, 7, 28, 7),
|
|
|
|
child: Center(
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(7))),
|
|
|
|
child: Text("Ajouté",
|
|
|
|
child: Center(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
child: Text("Ajouté",
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w600, fontSize: 13)),
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
),
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w600, fontSize: 13)),
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
))),
|
|
|
|
: SizedBox(
|
|
|
|
)
|
|
|
|
// Définir une largeur minimale pour le bouton "Ajouter"
|
|
|
|
: SizedBox(
|
|
|
|
width: 120, // Réglez cette valeur en fonction de vos besoins
|
|
|
|
// Définir une largeur minimale pour le bouton "Ajouter"
|
|
|
|
child: Material(
|
|
|
|
width: 120, // Réglez cette valeur en fonction de vos besoins
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
child: Material(
|
|
|
|
color: primaryColor,
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
child: InkWell(
|
|
|
|
color: primaryColor,
|
|
|
|
splashColor: Colors.white.withOpacity(0.3),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
splashColor: Colors.white.withOpacity(0.3),
|
|
|
|
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
|
|
|
|
onTap: () async {
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
|
|
|
|
SnackBar(
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
backgroundColor: primaryColor,
|
|
|
|
SnackBar(
|
|
|
|
content: Text(
|
|
|
|
backgroundColor: primaryColor,
|
|
|
|
"Vous suivez à present ${widget.user.pseudo}",
|
|
|
|
content: Text(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
"Vous suivez à present ${widget.user.pseudo}",
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
),
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
),
|
|
|
|
setState(() {});
|
|
|
|
);
|
|
|
|
},
|
|
|
|
setState(() {});
|
|
|
|
child: Container(
|
|
|
|
},
|
|
|
|
padding: EdgeInsets.fromLTRB(25, 7, 25, 7),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(7))),
|
|
|
|
padding: EdgeInsets.fromLTRB(25, 7, 25, 7),
|
|
|
|
child: Center(
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(7))),
|
|
|
|
child: Text("Ajouter",
|
|
|
|
child: Center(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
child: Text("Ajouter",
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w600, fontSize: 13)),
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
),
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w600, fontSize: 13)),
|
|
|
|
)))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)))),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Container(),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 40,
|
|
|
|
height: 40,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
RecapComponent()
|
|
|
|
RecapComponent(user: widget.user)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|