From c4fd2d9bd809180393feed8dcfd427b19679700b Mon Sep 17 00:00:00 2001 From: PGAN-MIS Date: Wed, 6 Sep 2023 08:54:53 +0800 Subject: [PATCH] commit for release --- lib/screens/unit2/basic-info/basic-info.dart | 52 +++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/lib/screens/unit2/basic-info/basic-info.dart b/lib/screens/unit2/basic-info/basic-info.dart index 578cc7d..9b1544b 100644 --- a/lib/screens/unit2/basic-info/basic-info.dart +++ b/lib/screens/unit2/basic-info/basic-info.dart @@ -31,9 +31,9 @@ class BasicInfo extends StatelessWidget { child: ProgressHUD( child: BlocBuilder( builder: (context, state) { - if (state is UserLoggedIn) { - String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}/media/${ state.userData!.employeeInfo!.profile!.photoPath!}'; + String fileUrl = + '${Url.instance.prefixHost()}://${Url.instance.host()}/media/${state.userData?.employeeInfo?.profile?.photoPath}'; state.userData!.employeeInfo!.profile!.sex!.toUpperCase(); return SafeArea( child: Scaffold( @@ -51,22 +51,38 @@ class BasicInfo extends StatelessWidget { child: Stack( alignment: Alignment.center, children: [ - - CachedNetworkImage( - imageUrl: fileUrl, - imageBuilder: (context, imageProvider) => Container( - width: 160, - height: 160, - decoration: BoxDecoration( - border: Border.all(color: third,width: 3), - shape: BoxShape.circle, - image: DecorationImage( - image: imageProvider, fit: BoxFit.cover), - ), - ), - placeholder: (context, url) => const CircularProgressIndicator(), - errorWidget: (context, url, error) =>const Icon(Icons.error), -), + CachedNetworkImage( + imageUrl: fileUrl, + imageBuilder: (context, imageProvider) => + Container( + width: 160, + height: 160, + decoration: BoxDecoration( + border: + Border.all(color: Colors.black26, width: 3), + shape: BoxShape.circle, + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover), + ), + ), + placeholder: (context, url) => + const CircularProgressIndicator(), + errorWidget: (context, url, error) => + Container( + width: 160, + height: 160, + decoration: BoxDecoration( + border: + Border.all(color: Colors.white, width: 3), + shape: BoxShape.circle, + + ), + child: SvgPicture.asset( + 'assets/svgs/male.svg', + ), + ), + ), ], ), ),