diff --git a/lib/view/profile/change_password.dart b/lib/view/profile/change_password.dart index d9d408c..fcd0213 100644 --- a/lib/view/profile/change_password.dart +++ b/lib/view/profile/change_password.dart @@ -48,7 +48,7 @@ class _ChangeUsernameViewState extends State { ), title: Text( - "Changer son pseudo", + "Changer son Mot de passe", style: TextStyle( color: TColor.black, fontSize: 16, fontWeight: FontWeight.w700), ), @@ -71,15 +71,15 @@ class _ChangeUsernameViewState extends State { child: Column( children: [ RoundTextField( - hitText: "Nouveau pseudo", - icon: "assets/img/email.svg", + hitText: "Ancien mot de passe", + icon: "assets/img/lock.svg", keyboardType: TextInputType.text, controller: controllerTextEmail, ), SizedBox(height: media.width * 0.04), RoundTextField( controller: controllerTextPassword, - hitText: "Confirmer le pseudo", + hitText: "Nouveau mot de passe", icon: "assets/img/lock.svg", obscureText: true, rigtIcon: TextButton( diff --git a/lib/view/profile/web/web_profile_view.dart b/lib/view/profile/web/web_profile_view.dart index c306d85..14c8b1b 100644 --- a/lib/view/profile/web/web_profile_view.dart +++ b/lib/view/profile/web/web_profile_view.dart @@ -5,6 +5,7 @@ import 'package:smartfit_app_mobile/common_widget/button/round_button.dart'; import 'package:smartfit_app_mobile/common_widget/setting_row.dart'; import 'package:smartfit_app_mobile/common_widget/title_subtitle_cell.dart'; import 'package:smartfit_app_mobile/view/home/notification_view.dart'; +import 'package:smartfit_app_mobile/view/profile/change_password.dart'; import 'package:smartfit_app_mobile/view/profile/change_username.dart'; class WebProfileView extends StatefulWidget { @@ -197,21 +198,32 @@ class _WebProfileView extends State { shrinkWrap: true, itemCount: accountArr.length, itemBuilder: (context, index) { - var iObj = accountArr[index] as Map? ?? {}; + var iObj = accountArr[index]; return SettingRow( - icon: iObj["image"].toString(), - title: iObj["name"].toString(), + icon: iObj["image"]!, + title: iObj["name"]!, onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const ChangeUsernameView(), - ), - ); - }, + if (iObj["tag"] == "1") { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ChangeUsernameView(), + ), + ); + } else if (iObj["tag"] == "2") { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ChangePasswordView(), + ), + ); + } else { + // Autre logique si nécessaire pour d'autres éléments de la liste + } + }, ); }, - ) + ), ], ), ),