Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!24
faiz_marathon_signalR_critical
haroon amjad 2 years ago
commit 120f19de14

@ -73,6 +73,8 @@ class AppState {
bool isArabic(context) => EasyLocalization.of(context)?.locale.languageCode == "ar";
int getLanguageID(context) => EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2;
String? _username;
// todo ''sikander' added password for now, later will remove & improve

@ -1,3 +1,5 @@
import 'package:mohem_flutter_app/app_state/app_state.dart';
class PostParamsModel {
double? versionID;
int? channel;

@ -169,11 +169,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
Directionality(
textDirection: TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
@ -206,16 +209,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
.toText14(color: Colors.white, isBold: true),
4.height,
],
).paddingOnly(left: 12),
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 14, right: 14),
decoration: const BoxDecoration(
decoration: BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(15),
bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
@ -360,7 +365,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
drawer: SafeArea(
child: AppDrawer(),
child: AppDrawer(onLanguageChange: _onRefresh),
),
bottomNavigationBar: SizedBox(
height: Platform.isAndroid ? 70 : 100,

@ -18,6 +18,10 @@ import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:provider/provider.dart';
class AppDrawer extends StatefulWidget {
final Function onLanguageChange;
AppDrawer({required this.onLanguageChange});
@override
_AppDrawerState createState() => _AppDrawerState();
}
@ -65,6 +69,28 @@ class _AppDrawerState extends State<AppDrawer> {
).expanded
],
).paddingOnly(left: 14, right: 14, top: 21, bottom: 21),
Row(
children: [
Row(
children: [
LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("en", "US"));
postLanguageChange(context);
}),
Container(
width: 1,
color: MyColors.darkWhiteColor,
height: 16,
margin: const EdgeInsets.only(left: 10, right: 10),
),
LocaleKeys.arabic.tr().toText14(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("ar", "SA"));
postLanguageChange(context);
}),
],
),
],
).paddingOnly(left: 14, right: 14, bottom: 14),
const Divider(
height: 1,
thickness: 1,
@ -132,6 +158,14 @@ class _AppDrawerState extends State<AppDrawer> {
: onPress!);
}
void postLanguageChange(BuildContext context) {
var obj = AppState().postParamsObject;
obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2;
AppState().setPostParamsModel(obj!);
Navigator.pop(context);
widget.onLanguageChange();
}
void performLogout() async {
AppState().isAuthenticated = false;
AppState().isLogged = false;

@ -175,7 +175,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
12.height,
DynamicTextFieldWidget(
LocaleKeys.startDateT.tr() + "*",
startDateTime == null ? "Select date" : startDateTime.toString().split(' ')[0],
startDateTime == null ? LocaleKeys.pleaseSelectDate.tr() : startDateTime.toString().split(' ')[0],
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
@ -189,7 +189,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
12.height,
DynamicTextFieldWidget(
LocaleKeys.endDateT.tr() + "*",
endDateTime == null ? "Select date" : endDateTime.toString().split(' ')[0],
endDateTime == null ? LocaleKeys.pleaseSelectDate.tr() : endDateTime.toString().split(' ')[0],
suffixIconData: Icons.calendar_today,
isEnable: false,
isReadOnly: selectedAbsenceType == null || startDateTime == null,
@ -206,7 +206,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
12.height,
DynamicTextFieldWidget(
LocaleKeys.totalDays.tr(),
totalDays?.toString() ?? "Calculated days",
totalDays?.toString() ?? LocaleKeys.calculatedDays.tr(),
isInputTypeNum: true,
isEnable: false,
onChange: (input) {

@ -73,7 +73,7 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
Container(
height: 200,
margin: EdgeInsets.only(top: 30),
decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates!.eMPLOYEEIMAGE)), fit: BoxFit.cover)),
decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.dataFromBase64String(getEmployeeSubordinates!.eMPLOYEEIMAGE!)), fit: BoxFit.cover)),
child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(

@ -141,7 +141,7 @@ class _MyTeamState extends State<MyTeam> {
width: 34,
child: CircleAvatar(
radius: 25,
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)),
backgroundImage: MemoryImage(Utils.dataFromBase64String(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE!)),
backgroundColor: Colors.black,
).paddingOnly(top: 4),
),

@ -85,7 +85,7 @@ class _TeamMembersState extends State<TeamMembers> {
width: 34,
child: CircleAvatar(
radius: 25,
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)),
backgroundImage: MemoryImage(Utils.dataFromBase64String(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE!)),
backgroundColor: Colors.black,
).paddingOnly(top: 4),
),

@ -50,7 +50,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
decoration: BoxDecoration(
image: DecorationImage(
image: MemoryImage(
Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE),
Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!),
),
fit: BoxFit.cover),
),

@ -49,7 +49,7 @@ class ProfilePanel extends StatelessWidget {
width: 68,)
: CircleAvatar(
radius: 68,
backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)),
backgroundImage: MemoryImage(Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!)),
backgroundColor: Colors.black,
);
}

Loading…
Cancel
Save