Merge branch 'Fatima' into 'master'

Fatima

See merge request mirza.shafique/mohem_flutter_app!77
merge-requests/1/merge
Sikander Saleem 2 years ago
commit a5062800ed

@ -71,10 +71,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Image.memory( Image.memory(
Utils.getPostBytes( Utils.getPostBytes(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
), ),
errorBuilder: (BuildContext context, error, stackTrace) {
return SvgPicture.asset(
"assets/images/user.svg", height: 34, width: 34,
);
},
width: 34, width: 34,
height: 34, height: 34,
fit: BoxFit.cover, fit: BoxFit.cover,

@ -43,7 +43,12 @@ class _AppDrawerState extends State<AppDrawer> {
).paddingOnly(left: 4, right: 14), ).paddingOnly(left: 4, right: 14),
Row( Row(
children: [ children: [
CircleAvatar( AppState().memberInformationList!.eMPLOYEEIMAGE == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 52,
width: 52,)
: CircleAvatar(
radius: 52 / 2, radius: 52 / 2,
backgroundImage: MemoryImage(Utils.getPostBytes(AppState().memberInformationList!.eMPLOYEEIMAGE)), backgroundImage: MemoryImage(Utils.getPostBytes(AppState().memberInformationList!.eMPLOYEEIMAGE)),
backgroundColor: Colors.black, backgroundColor: Colors.black,

@ -93,7 +93,6 @@ class _MyTeamState extends State<MyTeam> {
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
//contentPadding: EdgeInsets.fromLTRB(14, 15, 10, 15),
hintText: LocaleKeys.searchBy.tr() + " $dropdownValue", hintText: LocaleKeys.searchBy.tr() + " $dropdownValue",
hintStyle: const TextStyle( hintStyle: const TextStyle(
fontSize: 14.0, fontSize: 14.0,
@ -111,7 +110,6 @@ class _MyTeamState extends State<MyTeam> {
_textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty _textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 120) ? Utils.getNoDataWidget(context).paddingOnly(top: 120)
: ListView.separated( : ListView.separated(
//scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 12), padding: const EdgeInsets.only(top: 12),

@ -135,9 +135,8 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
: args['flag'] == 2 : args['flag'] == 2
? Column( ? Column(
children: [ children: [
getContactDetailsList!.isEmpty // getContactDetailsList!.isEmpty
? LocaleKeys.noDataAvailable.tr().toText16().center ListView(physics: const BouncingScrollPhysics(), padding: const EdgeInsets.all(21), children: [
: ListView(physics: const BouncingScrollPhysics(), padding: const EdgeInsets.all(21), children: [
ListView.separated( ListView.separated(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
@ -355,34 +354,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
return time; return time;
} }
Widget footer() {
return Container(
color: MyColors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
color: MyColors.gradiantEndColor,
margin: EdgeInsets.only(bottom: 20, top: 20),
padding: EdgeInsets.only(left: 50, right: 50),
child: TextButton(
style: TextButton.styleFrom(
primary: MyColors.white,
onSurface: MyColors.white,
backgroundColor: MyColors.gradiantEndColor,
),
onPressed: () {
submitUpdateForm();
},
child: Text(
LocaleKeys.next.tr(),
style: TextStyle(fontStyle: FontStyle.normal, fontSize: 16, color: Colors.white, fontWeight: FontWeight.w600),
),
)),
],
),
);
}
void submitUpdateForm() async { void submitUpdateForm() async {
try { try {

@ -1,4 +1,5 @@
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
@ -33,8 +34,15 @@ class _FamilyMembersState extends State<FamilyMembers> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!; List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
menuEntries = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList()[0];
List<GetMenuEntriesList> arr = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList();
if(arr.isNotEmpty){
menuEntries = arr[0];
}else{
menuEntries = new GetMenuEntriesList();
}
getEmployeeContacts(); getEmployeeContacts();
} }
@ -58,10 +66,10 @@ class _FamilyMembersState extends State<FamilyMembers> {
), ),
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
child: getEmployeeContactsList.length != 0 child: getEmployeeContactsList.isEmpty ? Utils.getNoDataWidget(context)
? ListView.separated( : ListView.separated(
padding: const EdgeInsets.all(21), padding: const EdgeInsets.all(21),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeeContactsList.length, itemCount: getEmployeeContactsList.length,
@ -82,20 +90,17 @@ class _FamilyMembersState extends State<FamilyMembers> {
text: TextSpan( text: TextSpan(
children: [ children: [
WidgetSpan( WidgetSpan(
child: menuEntries.updateButton == 'Y' child: Icon(Icons.edit, size: 14, color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor,)
? Icon(Icons.edit, size: 14, color: MyColors.grey67Color,
).onPress(() async {
relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr());
})
:Icon(Icons.edit, size: 14, color: MyColors.lightGreyColor,
),
), ),
TextSpan( TextSpan(
text: LocaleKeys.update.tr(), text: LocaleKeys.update.tr(),
style: menuEntries.updateButton == 'Y'? TextStyle(color: MyColors.grey67Color, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600) style:TextStyle(color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
:TextStyle(color: MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), recognizer: TapGestureRecognizer()
), ..onTap = () async {
relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()):null;
}
)
], ],
), ),
), ),
@ -119,13 +124,14 @@ class _FamilyMembersState extends State<FamilyMembers> {
), ),
], ],
).objectContainerView(disablePadding: true); ).objectContainerView(disablePadding: true);
}) }),
: Container(),
), ),
DefaultButton(LocaleKeys.addNewFamilyMember.tr(), () async { DefaultButton(LocaleKeys.addNewFamilyMember.tr(),
menuEntries.updateButton == 'Y'
? () async {
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"});
ProfileScreen(); // ProfileScreen();
}).insideContainer, } : null).insideContainer,
], ],
)); ));
} }
@ -147,7 +153,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
Navigator.pushNamed( Navigator.pushNamed(
context, context,
AppRoutes.addUpdateFamilyMember, AppRoutes.addUpdateFamilyMember,
arguments: {"relationID": relationId, "flag": flag, "actionType": "UPDATE"}, arguments: {"relationID": relationId, "flag": 2, "actionType": "UPDATE"},
); );
}, },
); );

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/ui/profile/widgets/profile_info.dart'; import 'package:mohem_flutter_app/ui/profile/widgets/profile_info.dart';
@ -41,7 +42,12 @@ class ProfilePanel extends StatelessWidget {
); );
} }
Widget profileImage() => CircleAvatar( Widget profileImage() => memberInformationList.eMPLOYEEIMAGE == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 68,
width: 68,)
: CircleAvatar(
radius: 68, radius: 68,
backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)),
backgroundColor: Colors.black, backgroundColor: Colors.black,

Loading…
Cancel
Save