PopupMenuButton(
position: PopupMenuPosition.under,
itemBuilder: (_) => [
const PopupMenuItem(
enabled: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Are you sure?"),
Text("You want to sign out."),
],
)),
PopupMenuItem(
onTap: () async {
await LocalDB.deleteLoginInfo().then((value) =>
Navigator.pushAndRemoveUntil(
context,
CupertinoPageRoute(builder: (_) => const LoginScreen()),
(route) => false));
},
child: const Row(
children: [
Icon(
CupertinoIcons.power,
size: 16,
color: AppColors.red,
),
Text(" Signing Out",style: TextStyle(color: AppColors.red,),),
],
))
],
child: ClipOval(
child: Container(
color: appRandomColor(),
child: CachedNetworkImage(
height: 40,
width: 40,
fit: BoxFit.cover,
imageUrl: "${AppUrls.fileUrl}/${authBloc?.avatar}",
placeholder: (context, url) => Align(
alignment: Alignment.center,
child: Text(
(authBloc == null ? "" : authBloc!.username)
.toString()
.substring(0, 1),
style: const TextStyle(color: Colors.white),
),
),
errorWidget: (context, url, error) => Align(
alignment: Alignment.center,
child: Text(
(authBloc == null ? "" : authBloc!.username)
.toString()
.substring(0, 1),
style: const TextStyle(
color: Colors.white, fontWeight: FontWeight.w500),
),
),
),
),
),
),
Comments
Post a Comment