Facebook
From lala, 1 Year ago, written in Dart.
Embed
Download Paste or View Raw
Hits: 110
  1. import 'package:age_calculator/age_calculator.dart';
  2. import 'package:buttons_tabbar/buttons_tabbar.dart';
  3. import 'package:cached_network_image/cached_network_image.dart';
  4. import 'package:easy_localization/easy_localization.dart';
  5. import 'package:flutter/foundation.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:flutter_bloc/flutter_bloc.dart';
  8. import 'package:flutter_hooks/flutter_hooks.dart';
  9. import 'package:flutter_screenutil/flutter_screenutil.dart';
  10. import 'package:gap/gap.dart';
  11. import 'package:get_it/get_it.dart';
  12. import 'package:velocity_x/velocity_x.dart';
  13. import 'package:pull_to_refresh/pull_to_refresh.dart';
  14. import 'package:you_app/blocs/account_cubit/account_cubit.dart';
  15. import 'package:you_app/models/profile/profile_details.dart';
  16. import 'package:you_app/screen/components/base_page.dart';
  17. import 'package:you_app/screen/components/custom_button/custom_button.dart';
  18. import 'package:you_app/screen/components/profile/no_data_widget.dart';
  19. import 'package:you_app/screen/page/profile/widgets/left_menu_widget.dart';
  20. import 'package:you_app/utils/alert_toast.dart';
  21.  
  22. import '../../../models/account/profile_model.dart';
  23. import '../../../services/navigation.dart';
  24. import '../../../utils/app_assets.dart';
  25. import '../../../utils/app_routes.dart';
  26. import '../../../utils/cont_const.dart';
  27. import '../../../utils/themes.dart';
  28. import '../../components/appbar/custom_appbar_profile.dart';
  29. import '../../components/profile/family_widget.dart';
  30. import '../../components/profile/photo_widget.dart';
  31. import '../../components/profile/small_tag_widget.dart';
  32. import '../../components/text_widget.dart';
  33. import 'cubit/profile_cubit.dart';
  34. import 'widgets/selection_account.bottom_sheet.dart';
  35.  
  36. class CompleteProfileScreen extends StatelessWidget {
  37.   const CompleteProfileScreen(
  38.       {Key? key,
  39.       required this.inContact,
  40.       required this.notSelfProfile,
  41.       this.profileID})
  42.       : super(key: key);
  43.   final bool inContact, notSelfProfile;
  44.   final String? profileID;
  45.  
  46.   @override
  47.   Widget build(BuildContext context) {
  48.     return MultiBlocProvider(
  49.       providers: [
  50.         BlocProvider(
  51.           create: (context) => ProfileCubit(),
  52.         ),
  53.         BlocProvider(
  54.           create: (context) => AccountCubit(),
  55.         ),
  56.       ],
  57.       child: _CompleteProfileScreen(
  58.         inContact: inContact,
  59.         notSelfProfile: notSelfProfile,
  60.         profileID: profileID,
  61.       ),
  62.     );
  63.   }
  64. }
  65.  
  66. class _CompleteProfileScreen extends StatefulHookWidget {
  67.   const _CompleteProfileScreen({
  68.     Key? key,
  69.     required this.inContact,
  70.     required this.notSelfProfile,
  71.     this.profileID,
  72.   }) : super(key: key);
  73.   final bool inContact, notSelfProfile;
  74.   final String? profileID;
  75.  
  76.   @override
  77.   State<_CompleteProfileScreen> createState() => _CompleteProfileScreenState();
  78. }
  79.  
  80. class _CompleteProfileScreenState extends State<_CompleteProfileScreen>
  81.     with AutomaticKeepAliveClientMixin<_CompleteProfileScreen> {
  82.   final RefreshController refreshController =
  83.       RefreshController(initialRefresh: false);
  84.  
  85.   @override
  86.   bool get wantKeepAlive => true;
  87.  
  88.   @override
  89.   Widget build(BuildContext context) {
  90.     super.build(context);
  91.     final profileCubit = context.read<ProfileCubit>();
  92.     final accountCubit = context.read<AccountCubit>();
  93.     //call
  94.  
  95.     bool closeWidget = true;
  96.     final showTheWidget = useState<bool>(false);
  97.     var size = MediaQuery.of(context).size;
  98.  
  99.     useEffect(() {
  100.       profileCubit.getProfileDataC(null);
  101.       profileCubit.getAccountDataC(null);
  102.       profileCubit.getProfileDetailsC(null);
  103.       return;
  104.     });
  105.  
  106.     void onRefresh() async {
  107.       // monitor network fetch
  108.       profileCubit.getProfileDetailsC(null);
  109.       profileCubit.getProfileDataC(null);
  110.       profileCubit.getAccountDataC(null);
  111.       // if failed,use refreshFailed()
  112.       refreshController.refreshCompleted();
  113.     }
  114.  
  115.     void onLoading() async {
  116.       // monitor network fetch
  117.       await Future.delayed(const Duration(milliseconds: 500));
  118.       // if failed,use loadFailed(),if no data return,use LoadNodata()
  119.       profileCubit.getProfileDataC(null);
  120.       profileCubit.getAccountDataC(null);
  121.       profileCubit.getProfileDetailsC(null);
  122.       refreshController.refreshCompleted();
  123.     }
  124.  
  125.     List<ProfileList>? profileList = [];
  126.     List<Family>? famList = [];
  127.     List<Experience> experienceList = [];
  128.     List<Media> mediaList = [];
  129.     ProfileDetails? profileDetails;
  130.     // Map<String, String>? listDesc = {};
  131.     List<String>? listLanguage = [];
  132.     List<String>? listDesc = [];
  133.  
  134.     String? thumbnail,
  135.         username,
  136.         firstName,
  137.         lastName,
  138.         countryId,
  139.         bio,
  140.         gender,
  141.         height,
  142.         weight,
  143.         background,
  144.         description,
  145.         work,
  146.         passcode,
  147.         accountId,
  148.         defaultProfileId;
  149.     final age = useState<int>(23);
  150.  
  151.     DateTime dob = DateTime(2000, 1, 1);
  152.  
  153.     bool isLoading = false;
  154.  
  155.     return BlocConsumer<ProfileCubit, ProfileState>(
  156.       listener: (context, state) {
  157.         if (state is ProfileLoading) {
  158.           isLoading = true;
  159.         }
  160.         if (state is CloseWidget) {
  161.           closeWidget = state.value;
  162.         }
  163.  
  164.         if (state is ProfileDetailSuccess) {
  165.           defaultProfileId = state.data.id ?? '';
  166.           thumbnail = state.data.thumbnail;
  167.           username = state.data.name;
  168.           firstName = state.data.firstName ?? '-';
  169.           lastName = state.data.lastName ?? "-";
  170.           countryId = state.data.countryId ?? "SG";
  171.           dob = state.data.dob ?? DateTime(2000, 1, 1);
  172.           gender = state.data.gender ?? "";
  173.           height = state.data.height ?? '155';
  174.           weight = state.data.weight ?? '45';
  175.           listLanguage = state.data.language ?? [];
  176.           listDesc = state.data.description;
  177.           bio = state.data.bio ?? '';
  178.           famList = state.data.family;
  179.           mediaList = state.data.media ?? [];
  180.           experienceList = state.data.experiences ?? [];
  181.           background = state.data.background ?? 'You doing best';
  182.           profileDetails = state.data;
  183.  
  184.           if (profileDetails!.lastEditAt == null) {
  185.             showTheWidget.value = true;
  186.           }
  187.           DateDuration duration;
  188.           duration = AgeCalculator.age(dob);
  189.           age.value = int.parse(duration.years.toString());
  190.  
  191.           print("ini age ========== ${duration.years}");
  192.  
  193.           isLoading = false;
  194.         }
  195.  
  196.         if (state is ProfileDataSuccess) {
  197.           profileList = state.data.profile;
  198.           work = state.data.currentDepartementWork ?? '';
  199.           passcode = state.data.passcode ?? '';
  200.           accountId = state.data.id ?? '';
  201.           isLoading = false;
  202.         }
  203.  
  204.         if (state is AccountDataSuccess) {
  205.           //age.value = state.data.age ?? 22;
  206.           isLoading = false;
  207.         }
  208.  
  209.         if (state is CreateProfileLoading) {
  210.           isLoading = false;
  211.           GetIt.I<NavigationServiceMain>().pop();
  212.         }
  213.  
  214.         if (state is CreateProfileSuccess) {
  215.           isLoading = false;
  216.           profileDetails = state.data;
  217.           GetIt.I<NavigationServiceMain>().pushNamed(AppRoutes.editProfile,
  218.               args: {
  219.                 'profileData': profileDetails
  220.               })?.then((value) => onRefresh());
  221.         }
  222.  
  223.         if (state is CreateProfileError) {
  224.           showToastSuccess(state.error);
  225.         }
  226.       },
  227.       builder: (context, state) {
  228.         if (kDebugMode) {
  229.           print('ini last edit');
  230.           print(profileDetails?.lastEditAt);
  231.         }
  232.  
  233.         String formattedDob = DateFormat('yyyy-MM-dd').format(dob);
  234.         return BasePage(
  235.           isLoading: isLoading,
  236.           appBar: CustomAppBarProfile(
  237.             label: '',
  238.             elevation: 0,
  239.             hideBackbutton: false,
  240.             backgroundColor: CustomColor.background,
  241.             leftWidget: widget.notSelfProfile == false
  242.                 ? Image.asset(AppIcons.appIcon)
  243.                     .onTap(() => Scaffold.of(context).openDrawer())
  244.                 : null,
  245.             title: profileDetails?.lastEditAt == null
  246.                 ? Container()
  247.                 : widget.notSelfProfile == false
  248.                     ? HStack([
  249.                         Image.asset(
  250.                           AppIcons.arrowGoldLeft,
  251.                           width: 15.sp,
  252.                         ),
  253.                         ValueTextWidget(
  254.                           text: username ?? '@',
  255.                           fontSize: 14.sp,
  256.                           fontWeight: FontWeight.w600,
  257.                           color: CustomColor.onBackground,
  258.                         ),
  259.                         Gap(4.sp),
  260.                         Image.asset(
  261.                           AppIcons.passcode,
  262.                           width: 15.sp,
  263.                           color: CustomColor.onBackground,
  264.                         ),
  265.                         Image.asset(
  266.                           AppIcons.arrowGoldRight,
  267.                           width: 15.sp,
  268.                         ),
  269.                       ]).onTap(() {
  270.                         accountBottomSheetSelection(context, profileList,
  271.                                 accountId ?? '', defaultProfileId ?? '')
  272.                             .then((value) {
  273.                           if (value == true) {
  274.                             onRefresh();
  275.                           }
  276.                         });
  277.                       }).pOnly(left: 12.sp)
  278.                     : ValueTextWidget(
  279.                         text: username ?? '@',
  280.                         fontSize: 14.sp,
  281.                         fontWeight: FontWeight.w600,
  282.                         color: CustomColor.onBackground,
  283.                       ),
  284.             actionWidget: profileDetails?.lastEditAt == null
  285.                 ? Container()
  286.                 : widget.notSelfProfile
  287.                     ? widget.inContact == true
  288.                         ? const LeftMenuProfileInContact()
  289.                         : const LeftMenuProfile()
  290.                     : Image.asset(AppIcons.editProfile).onTap(() {
  291.                         GetIt.I<NavigationServiceMain>()
  292.                             .pushNamed(AppRoutes.editProfile, args: {
  293.                           'profileData': profileDetails
  294.                         })?.then((value) => onRefresh());
  295.                       }),
  296.           ),
  297.           body: SmartRefresher(
  298.             header: WaterDropMaterialHeader(
  299.               color: Colors.white,
  300.               backgroundColor: gradientFincy[1].withOpacity(0.7),
  301.             ),
  302.             onRefresh: onRefresh,
  303.             onLoading: onLoading,
  304.             enablePullDown: true,
  305.             controller: refreshController,
  306.             child: profileDetails?.lastEditAt == null
  307.                 ? Center(
  308.                     child: VStack([
  309.                       "Create your profile to start chatting with"
  310.                           .text
  311.                           .color(CustomColor.onBackground)
  312.                           .make()
  313.                           .centered(),
  314.                       "likeminded folks"
  315.                           .text
  316.                           .bold
  317.                           .color(CustomColor.onBackground)
  318.                           .make()
  319.                           .centered(),
  320.                       Gap(20.sp),
  321.                       GradientButton(
  322.                         title: "Create Profile",
  323.                         onTap: () {
  324.                           GetIt.I<NavigationServiceMain>()
  325.                               .pushNamed(AppRoutes.editProfile, args: {
  326.                             'profileData': profileDetails
  327.                           })?.then((value) => onRefresh());
  328.                         },
  329.                         colors: gradientFincy,
  330.                         gradientColors: isFillGradient,
  331.                       ).w56(context).centered()
  332.                     ]),
  333.                   )
  334.                 : SingleChildScrollView(
  335.                     child: Column(
  336.                       children: [
  337.                         //Gap(18.sp),
  338.                         BlocConsumer<ProfileCubit, ProfileState>(
  339.                           listener: (context, state) {
  340.                             if (state is CloseWidget) {
  341.                               closeWidget = state.value;
  342.                             }
  343.                             if (state is ProfileDataSuccess) {
  344.                               // username = state.data.username ?? '@';
  345.                             }
  346.                           },
  347.                           builder: (context, state) {
  348.                             return AnimatedContainer(
  349.                               height: 210.sp,
  350.                               width: 360.sp,
  351.                               curve: Curves.fastLinearToSlowEaseIn,
  352.                               decoration: BoxDecoration(
  353.                                 gradient: LinearGradient(
  354.                                     colors: [
  355.                                       Colors.black.withOpacity(0.76),
  356.                                       // Colors.black.withOpacity(0.0),
  357.                                       Colors.black.withOpacity(0.79)
  358.                                     ],
  359.                                     begin: Alignment.topCenter,
  360.                                     end: Alignment.bottomCenter),
  361.                                 image: DecorationImage(
  362.                                   opacity: 0.5,
  363.                                   image: thumbnail == null
  364.                                       ? const AssetImage(
  365.                                               AppImages.defaultProfile)
  366.                                           as ImageProvider
  367.                                       : CachedNetworkImageProvider(thumbnail!),
  368.                                   fit: BoxFit.cover,
  369.                                 ),
  370.                                 borderRadius: BorderRadius.all(
  371.                                   Radius.circular(32.sp),
  372.                                 ),
  373.                               ),
  374.                               duration: const Duration(milliseconds: 500),
  375.                               child: Column(
  376.                                 mainAxisAlignment:
  377.                                     MainAxisAlignment.spaceBetween,
  378.                                 crossAxisAlignment: CrossAxisAlignment.start,
  379.                                 children: [
  380.                                   Row(
  381.                                     mainAxisAlignment: MainAxisAlignment.end,
  382.                                     children: [
  383.                                       Container(
  384.                                         decoration: BoxDecoration(
  385.                                           gradient: LinearGradient(colors: [
  386.                                             Colors.white.withOpacity(0.4),
  387.                                             Colors.white.withOpacity(0.13)
  388.                                           ]),
  389.                                           //color: Colors.white.withOpacity(0.13),
  390.                                           shape: BoxShape.circle,
  391.                                         ),
  392.                                         child:
  393.                                             Image.asset(AppIcons.zoomOutGolden)
  394.                                                 .p(10.sp),
  395.                                       ).onTap(() {
  396.                                         // profileCubit
  397.                                         //     .changeCloseUpWidget(!closeWidget);
  398.                                       })
  399.                                     ],
  400.                                   ).pOnly(left: 10.sp),
  401.                                   VStack([
  402.                                     age.value == 0
  403.                                         ? ValueTextWidget(
  404.                                             text: '$username',
  405.                                             fontSize: 16.sp,
  406.                                             fontWeight: FontWeight.w700,
  407.                                             color: Colors.white,
  408.                                             letterSpacing: -23 / 100,
  409.                                           )
  410.                                         : ValueTextWidget(
  411.                                             text: '$username, ${age.value}',
  412.                                             fontSize: 16.sp,
  413.                                             fontWeight: FontWeight.w700,
  414.                                             color: Colors.white,
  415.                                             letterSpacing: -23 / 100,
  416.                                           ),
  417.                                     Gap(10.sp),
  418.                                     work == ''
  419.                                         ? ValueTextWidget(
  420.                                             text: '$gender ',
  421.                                             fontSize: 13.sp,
  422.                                             fontWeight: FontWeight.w500,
  423.                                             color: Colors.white,
  424.                                             letterSpacing: -23 / 100,
  425.                                           )
  426.                                         : ValueTextWidget(
  427.                                             text: '$gender | $work',
  428.                                             fontSize: 13.sp,
  429.                                             fontWeight: FontWeight.w500,
  430.                                             color: Colors.white,
  431.                                             letterSpacing: -23 / 100,
  432.                                           ),
  433.                                     Gap(12.sp),
  434.                                     SizedBox(
  435.                                       width: size.width,
  436.                                       child: Wrap(
  437.                                         runSpacing: 5.sp,
  438.                                         spacing: 5.sp,
  439.                                         children: [
  440.                                           for (int i = 0;
  441.                                               i <
  442.                                                   ((listDesc?.length ?? 0) > 3
  443.                                                       ? 3
  444.                                                       : (listDesc?.length ??
  445.                                                           0));
  446.                                               i++)
  447.                                             SmallTagWidget(
  448.                                               tag: listDesc![i],
  449.                                               widgetColor:
  450.                                                   cEAF4F7.withOpacity(0.32),
  451.                                               tagColor: Colors.white,
  452.                                             ),
  453.                                           (listDesc?.length ?? 0) < 4
  454.                                               ? Container()
  455.                                               : SmallTagWidget(
  456.                                                   tag: '...',
  457.                                                   widgetColor:
  458.                                                       cEAF4F7.withOpacity(0.32),
  459.                                                   tagColor: Colors.white,
  460.                                                 ).onTap(
  461.                                                   () {
  462.                                                     GetIt.I<NavigationServiceMain>()
  463.                                                         .pushNamed(
  464.                                                             AppRoutes
  465.                                                                 .detailDescriptionProfile,
  466.                                                             args: {
  467.                                                           'listDesc': listDesc
  468.                                                         });
  469.                                                   },
  470.                                                 ),
  471.                                         ],
  472.                                       ),
  473.                                     ),
  474.                                   ]).p8()
  475.                                 ],
  476.                               ).p(12.sp),
  477.                             );
  478.                           },
  479.                         ),
  480.  
  481.                         //widget detail profile on tab
  482.  
  483.                         Gap(20.sp),
  484.                         BlocConsumer<ProfileCubit, ProfileState>(
  485.                           listener: (context, state) {
  486.                             if (state is CloseWidget) {
  487.                               closeWidget = state.value;
  488.                             }
  489.                           },
  490.                           builder: (context, state) {
  491.                             return Visibility(
  492.                               visible: closeWidget ? false : true,
  493.                               child: SizedBox(
  494.                                 height: size.height,
  495.                                 width: size.width,
  496.                                 child: DefaultTabController(
  497.                                   length: 2,
  498.                                   child: Column(
  499.                                     mainAxisSize: MainAxisSize.min,
  500.                                     children: [
  501.                                       ButtonsTabBar(
  502.                                         unselectedBackgroundColor:
  503.                                             Colors.transparent,
  504.                                         decoration: const BoxDecoration(
  505.                                           color: Colors.transparent,
  506.                                         ),
  507.                                         labelStyle: TextStyle(
  508.                                           fontSize: 13.sp,
  509.                                           fontWeight: FontWeight.w600,
  510.                                           color: CustomColor.onBackground,
  511.                                         ),
  512.                                         // backgroundColor: Colors.transparent,
  513.                                         unselectedLabelStyle: TextStyle(
  514.                                           fontSize: 13.sp,
  515.                                           fontWeight: FontWeight.w400,
  516.                                           color: textGrey,
  517.                                         ),
  518.                                         onTap: (p0) {
  519.                                           // print(p0);
  520.                                         },
  521.                                         splashColor:
  522.                                             gradientFincy[1].withOpacity(0.1),
  523.                                         tabs: [
  524.                                           Tab(
  525.                                             icon: Image.asset(
  526.                                                 AppIcons.likeGolden),
  527.                                             text: 'about'.tr(),
  528.                                           ),
  529.                                           // Tab(
  530.                                           //   icon: Image.asset(
  531.                                           //       AppIcons.shopGolden),
  532.                                           //   text: 'shop'.tr(),
  533.                                           // ),
  534.                                           // Tab(
  535.                                           //   icon:
  536.                                           //       Image.asset(AppIcons.boxGolden),
  537.                                           //   text: 'services'.tr(),
  538.                                           // ),
  539.                                           Tab(
  540.                                             icon: Image.asset(
  541.                                                 AppIcons.galleryGolden),
  542.                                             text: "media".tr(),
  543.                                           ),
  544.                                           // Tab(
  545.                                           //   icon: Image.asset(
  546.                                           //       AppIcons.experienceGolden),
  547.                                           //   text:
  548.                                           //       "professional_experience".tr(),
  549.                                           // )
  550.                                         ],
  551.                                       ),
  552.                                       Gap(10.sp),
  553.                                       Expanded(
  554.                                         child: TabBarView(
  555.                                           children: [
  556.                                             //this is tab about
  557.  
  558.                                             SingleChildScrollView(
  559.                                               child: Column(
  560.                                                 mainAxisAlignment:
  561.                                                     MainAxisAlignment.start,
  562.                                                 crossAxisAlignment:
  563.                                                     CrossAxisAlignment.start,
  564.                                                 children: [
  565.                                                   // widget bio
  566.  
  567.                                                   Container(
  568.                                                     decoration: boxNewProfile,
  569.                                                     child: VStack([
  570.                                                       TextWidget(
  571.                                                         text: 'bio',
  572.                                                         fontSize: 14.sp,
  573.                                                         fontWeight:
  574.                                                             FontWeight.w700,
  575.                                                         color: CustomColor
  576.                                                             .onBackground,
  577.                                                       ),
  578.                                                       Gap(16.sp),
  579.                                                       SizedBox(
  580.                                                         width: size.width,
  581.                                                         child: ValueTextWidget(
  582.                                                           text: bio ??
  583.                                                               'There is no bio data',
  584.                                                           fontSize: 13.sp,
  585.                                                           fontWeight:
  586.                                                               FontWeight.w500,
  587.                                                           color: textRegular,
  588.                                                         ),
  589.                                                       )
  590.                                                     ]).p(15.sp),
  591.                                                   ).pOnly(
  592.                                                       left: 4.sp,
  593.                                                       right: 4.sp,
  594.                                                       top: 16.sp,
  595.                                                       bottom: 10.sp),
  596.  
  597.                                                   //widget about
  598.  
  599.                                                   Container(
  600.                                                     decoration: boxNewProfile,
  601.                                                     child: VStack([
  602.                                                       TextWidget(
  603.                                                         text: 'about',
  604.                                                         fontSize: 14.sp,
  605.                                                         fontWeight:
  606.                                                             FontWeight.w700,
  607.                                                         color: CustomColor
  608.                                                             .onBackground,
  609.                                                       ),
  610.                                                       Gap(12.sp),
  611.                                                       HStack([
  612.                                                         TextWidget(
  613.                                                           text: 'birthday:',
  614.                                                           fontSize: 13.sp,
  615.                                                           fontWeight:
  616.                                                               FontWeight.w500,
  617.                                                           color: cA4A4A4,
  618.                                                         ),
  619.                                                         ValueTextWidget(
  620.                                                           text:
  621.                                                               ' $formattedDob',
  622.                                                           fontSize: 13.sp,
  623.                                                           fontWeight:
  624.                                                               FontWeight.w500,
  625.                                                           color: CustomColor
  626.                                                               .onBackground,
  627.                                                         )
  628.                                                       ]),
  629.                                                       Gap(12.sp),
  630.                                                       HStack([
  631.                                                         TextWidget(
  632.                                                           text: 'background:',
  633.                                                           fontSize: 13.sp,
  634.                                                           fontWeight:
  635.                                                               FontWeight.w500,
  636.                                                           color: cA4A4A4,
  637.                                                         ),
  638.                                                         ValueTextWidget(
  639.                                                           text: " $background",
  640.                                                           fontSize: 13.sp,
  641.                                                           fontWeight:
  642.                                                               FontWeight.w500,
  643.                                                           color: CustomColor
  644.                                                               .onBackground,
  645.                                                         )
  646.                                                       ]),
  647.                                                       Gap(12.sp),
  648.                                                       HStack([
  649.                                                         TextWidget(
  650.                                                           text: 'language:',
  651.                                                           fontSize: 13.sp,
  652.                                                           fontWeight:
  653.                                                               FontWeight.w500,
  654.                                                           color: cA4A4A4,
  655.                                                         ),
  656.                                                         SizedBox(
  657.                                                           width:
  658.                                                               size.width - 130,
  659.                                                           child: Wrap(
  660.                                                             children:
  661.                                                                 List.generate(
  662.                                                                     listLanguage
  663.                                                                             ?.length ??
  664.                                                                         0,
  665.                                                                     (index) =>
  666.                                                                         ValueTextWidget(
  667.                                                                           text:
  668.                                                                               " ${index != 0 ? listLanguage![0] != "" && listLanguage![1] != "" ? " | " : "" : ""}${listLanguage![index]}",
  669.                                                                           fontSize:
  670.                                                                               13.sp,
  671.                                                                           fontWeight:
  672.                                                                               FontWeight.w500,
  673.                                                                           color:
  674.                                                                               CustomColor.onBackground,
  675.                                                                         )),
  676.                                                           ),
  677.                                                         )
  678.                                                       ]),
  679.                                                       Gap(12.sp),
  680.                                                       HStack(
  681.                                                         [
  682.                                                           TextWidget(
  683.                                                             text: 'height:',
  684.                                                             fontSize: 13.sp,
  685.                                                             fontWeight:
  686.                                                                 FontWeight.w500,
  687.                                                             color: cA4A4A4,
  688.                                                           ),
  689.                                                           ValueTextWidget(
  690.                                                             text: ' $height cm',
  691.                                                             fontSize: 13.sp,
  692.                                                             fontWeight:
  693.                                                                 FontWeight.w500,
  694.                                                             color: CustomColor
  695.                                                                 .onBackground,
  696.                                                           )
  697.                                                         ],
  698.                                                       ),
  699.                                                       Gap(12.sp),
  700.                                                       HStack([
  701.                                                         TextWidget(
  702.                                                           text: 'weight:',
  703.                                                           fontSize: 13.sp,
  704.                                                           fontWeight:
  705.                                                               FontWeight.w500,
  706.                                                           color: cA4A4A4,
  707.                                                         ),
  708.                                                         ValueTextWidget(
  709.                                                           text: ' $weight kg',
  710.                                                           fontSize: 13.sp,
  711.                                                           fontWeight:
  712.                                                               FontWeight.w500,
  713.                                                           color: CustomColor
  714.                                                               .onBackground,
  715.                                                         )
  716.                                                       ]),
  717.                                                     ]).pOnly(
  718.                                                         left: 16.sp,
  719.                                                         right: 10.sp,
  720.                                                         top: 12.sp,
  721.                                                         bottom: 10.sp),
  722.                                                   ),
  723.                                                   //widget experience
  724.                                                   Gap(10.sp),
  725.  
  726.                                                   Visibility(
  727.                                                     visible:
  728.                                                         experienceList.isEmpty
  729.                                                             ? false
  730.                                                             : true,
  731.                                                     child: Container(
  732.                                                       decoration: boxNewProfile,
  733.                                                       child: VStack([
  734.                                                         Gap(5.sp),
  735.                                                         ValueTextWidget(
  736.                                                           text:
  737.                                                               'Professional Experience',
  738.                                                           fontSize: 14.sp,
  739.                                                           fontWeight:
  740.                                                               FontWeight.w700,
  741.                                                           color: CustomColor
  742.                                                               .onBackground,
  743.                                                         ),
  744.                                                         Gap(16.sp),
  745.                                                         ListView.separated(
  746.                                                           shrinkWrap: true,
  747.                                                           primary: false,
  748.                                                           itemCount:
  749.                                                               experienceList
  750.                                                                   .length,
  751.                                                           separatorBuilder:
  752.                                                               (context,
  753.                                                                       index) =>
  754.                                                                   Gap(12.sp),
  755.                                                           itemBuilder:
  756.                                                               (context, index) {
  757.                                                             final exp =
  758.                                                                 experienceList[
  759.                                                                     index];
  760.                                                             return HStack(
  761.                                                               [
  762.                                                                 ClipRRect(
  763.                                                                   borderRadius:
  764.                                                                       BorderRadius
  765.                                                                           .circular(
  766.                                                                               8.sp),
  767.                                                                   child:
  768.                                                                       CachedNetworkImage(
  769.                                                                     imageUrl:
  770.                                                                         exp.image ??
  771.                                                                             "",
  772.                                                                     height:
  773.                                                                         32.sp,
  774.                                                                     width:
  775.                                                                         32.sp,
  776.                                                                     fit: BoxFit
  777.                                                                         .cover,
  778.                                                                   ),
  779.                                                                 ),
  780.                                                                 Gap(8.sp),
  781.                                                                 VStack(
  782.                                                                   [
  783.                                                                     SizedBox(
  784.                                                                       width: 263
  785.                                                                           .sp,
  786.                                                                       child:
  787.                                                                           ValueTextWidget(
  788.                                                                         text:
  789.                                                                             '${exp.jobTitle} | ${exp.companyName}',
  790.                                                                         fontSize:
  791.                                                                             12.sp,
  792.                                                                         fontWeight:
  793.                                                                             FontWeight.w500,
  794.                                                                         color: CustomColor
  795.                                                                             .onBackground,
  796.                                                                       ),
  797.                                                                     ),
  798.                                                                     Gap(3.sp),
  799.                                                                     ValueTextWidget(
  800.                                                                       text:
  801.                                                                           '${exp.startDate != null ? "${DateFormat.MMM().format(exp.startDate!).toString()} ${exp.startDate?.year}" : "..."} '
  802.                                                                           '- ${(exp.status ?? "") == "active" ? "active" : exp.endDate != null ? "${DateFormat.MMM().format(exp.endDate!).toString()} ${exp.endDate?.year}" : "Present"}',
  803.                                                                       fontSize:
  804.                                                                           11.sp,
  805.                                                                       fontWeight:
  806.                                                                           FontWeight
  807.                                                                               .w400,
  808.                                                                       color:
  809.                                                                           cA4A4A4,
  810.                                                                     )
  811.                                                                   ],
  812.                                                                 ).expand(),
  813.                                                               ],
  814.                                                             ).pOnly(
  815.                                                                 top: 12.sp,
  816.                                                                 left: 10.sp);
  817.                                                           },
  818.                                                         ),
  819.                                                       ]).pOnly(
  820.                                                           left: 12.sp,
  821.                                                           right: 12.sp,
  822.                                                           bottom: 10.sp,
  823.                                                           top: 10.sp),
  824.                                                     ),
  825.                                                   ),
  826.  
  827.                                                   Gap(10.sp),
  828.  
  829.                                                   //widget family
  830.  
  831.                                                   Visibility(
  832.                                                     visible: famList!.isEmpty
  833.                                                         ? false
  834.                                                         : true,
  835.                                                     child: Container(
  836.                                                       decoration: boxNewProfile,
  837.                                                       child: VStack([
  838.                                                         Gap(5.sp),
  839.                                                         TextWidget(
  840.                                                           text: 'family',
  841.                                                           fontSize: 14.sp,
  842.                                                           fontWeight:
  843.                                                               FontWeight.w700,
  844.                                                           color: CustomColor
  845.                                                               .onBackground,
  846.                                                         ),
  847.                                                         Gap(2.sp),
  848.                                                         ListView.builder(
  849.                                                           shrinkWrap: true,
  850.                                                           primary: false,
  851.                                                           itemCount:
  852.                                                               famList?.length ??
  853.                                                                   0,
  854.                                                           itemBuilder:
  855.                                                               (BuildContext
  856.                                                                       context,
  857.                                                                   int index) {
  858.                                                             return ItemFamilyWidget(
  859.                                                               family: famList![
  860.                                                                   index],
  861.                                                               padding: EdgeInsets
  862.                                                                   .symmetric(
  863.                                                                       vertical:
  864.                                                                           5.sp),
  865.                                                             ).pOnly(top: 12.sp);
  866.                                                           },
  867.                                                         ),
  868.                                                       ]).pOnly(
  869.                                                           left: 12.sp,
  870.                                                           right: 12.sp,
  871.                                                           bottom: 10.sp,
  872.                                                           top: 10.sp),
  873.                                                     ),
  874.                                                   ),
  875.                                                 ],
  876.                                               ),
  877.                                             ),
  878.  
  879.                                             //widget shop
  880.  
  881.                                             // const Visibility(
  882.                                             //   visible: true,
  883.                                             //   child: NoDataWidget(
  884.                                             //       text: 'no_data_shop'),
  885.                                             // ),
  886.  
  887.                                             //widget service
  888.  
  889.                                             // const Visibility(
  890.                                             //   visible: true,
  891.                                             //   child: NoDataWidget(
  892.                                             //       text: 'no_data_services'),
  893.                                             // ),
  894.  
  895.                                             //widget media profile
  896.  
  897.                                             mediaList.isEmpty
  898.                                                 ? const NoDataWidget(
  899.                                                     text: 'no_data_media')
  900.                                                 : SingleChildScrollView(
  901.                                                     child: Column(
  902.                                                       children: [
  903.                                                         SizedBox(
  904.                                                           height: size.height,
  905.                                                           width: size.width,
  906.                                                           child:
  907.                                                               GridView.builder(
  908.                                                             itemCount: mediaList
  909.                                                                 .length,
  910.                                                             gridDelegate:
  911.                                                                 const SliverGridDelegateWithFixedCrossAxisCount(
  912.                                                               crossAxisCount: 3,
  913.                                                             ),
  914.                                                             itemBuilder:
  915.                                                                 (BuildContext
  916.                                                                         context,
  917.                                                                     int index) {
  918.                                                               return MediaWidget(
  919.                                                                       image: mediaList[index]
  920.                                                                               .url ??
  921.                                                                           'https://images.unsplash.com/photo-1666454638303-435ad6a49533?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=686&q=80',
  922.                                                                       weight: 2)
  923.                                                                   .p(6.sp);
  924.                                                             },
  925.                                                           ),
  926.                                                         ),
  927.                                                       ],
  928.                                                     ),
  929.                                                   ),
  930.                                           ],
  931.                                         ),
  932.                                       )
  933.                                     ],
  934.                                   ),
  935.                                 ),
  936.                               ),
  937.                             );
  938.                           },
  939.                         )
  940.                       ],
  941.                     ).p(8.sp),
  942.                   ),
  943.           ),
  944.         );
  945.       },
  946.     );
  947.   }
  948. }
  949.