Widgets Info Completed

master
FaizHashmiCS22 2 years ago
parent eea3394461
commit 5262af379e

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m256 96.23c-70.52 0-127.89 57.37-127.89 127.88 0 70.52 57.37 127.89 127.89 127.89s127.89-57.37 127.89-127.89c0-70.51-57.37-127.88-127.89-127.88z"/><path d="m256 72c8.837 0 16-7.164 16-16v-40c0-8.836-7.163-16-16-16s-16 7.164-16 16v40c0 8.836 7.163 16 16 16z"/><path d="m464 208h-40c-8.837 0-16 7.164-16 16s7.163 16 16 16h40c8.837 0 16-7.164 16-16s-7.163-16-16-16z"/><path d="m104 224c0-8.836-7.163-16-16-16h-40c-8.837 0-16 7.164-16 16s7.163 16 16 16h40c8.837 0 16-7.164 16-16z"/><path d="m386.107 331.48c-6.248-6.248-16.379-6.248-22.627 0-6.249 6.249-6.249 16.379 0 22.628l28.284 28.284c3.124 3.124 7.219 4.686 11.313 4.686 14.127 0 21.422-17.206 11.313-27.314z"/><path d="m125.893 116.52c6.248 6.248 16.379 6.248 22.627 0 6.249-6.249 6.249-16.379 0-22.628l-28.284-28.284c-6.248-6.248-16.379-6.248-22.627 0-6.249 6.249-6.249 16.379 0 22.628z"/><path d="m374.794 121.206c4.095 0 8.189-1.562 11.313-4.686l28.284-28.284c6.249-6.249 6.249-16.379 0-22.628-6.248-6.248-16.379-6.248-22.627 0l-28.284 28.284c-10.109 10.109-2.812 27.314 11.314 27.314z"/><path d="m125.893 331.48-28.284 28.284c-6.249 6.249-6.249 16.379 0 22.628 6.248 6.248 16.379 6.248 22.627 0l28.284-28.284c6.249-6.249 6.249-16.379 0-22.628-6.249-6.248-16.379-6.248-22.627 0z"/><path d="m267.319 380.692c-5.248-5.251-13.726-6.327-20.202-1.998-1.909 1.277.671-1.109-42.431 41.992-6.249 6.248-6.249 16.379 0 22.627 6.248 6.249 16.379 6.249 22.627 0l12.687-12.686v65.373c0 8.836 7.163 16 16 16s16-7.164 16-16v-65.373l12.687 12.686c6.247 6.248 16.379 6.249 22.627 0 6.249-6.248 6.249-16.379 0-22.627z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -44,5 +44,6 @@ class AppGlobal {
static String coldIcon = "assets/icons/cold.svg";
static String hotIcon = "assets/icons/hot.svg";
static String rainIcon = "assets/icons/rainy.svg";
static String sunnyIcon = "assets/icons/sunny.svg";
static String windIcon = "assets/icons/windy.svg";
}

@ -37,6 +37,14 @@ class CallConfig {
late String queueNoText;
late String callForText;
late String currentServeText;
late String nextPrayerText;
late String minText;
late String maxText;
late String fajrText;
late String dhuhrText;
late String asrText;
late String maghribText;
late String ishaText;
late String callTypeVitalSignText;
late String callTypeDoctorText;
late String callTypeProcedureText;
@ -69,7 +77,14 @@ class CallConfig {
this.queueNoText = "",
this.callForText = "",
this.currentServeText = "Current Serving",
this.callTypeVitalSignText = "",
this.nextPrayerText = "Next Prayer",
this.minText = "Min",
this.maxText = "Max",
this.fajrText = "Fajar",
this.dhuhrText = "Dhuhr",
this.asrText = "Asr",
this.maghribText = "Maghrib",
this.ishaText = "Isha",
this.callTypeDoctorText = "",
this.callTypeProcedureText = "",
this.callTypeVaccinationText = "",
@ -89,11 +104,11 @@ class CallConfig {
prioritySMS = json['prioritySMS'];
priorityWhatsApp = json['priorityWhatsApp'];
priorityEmail = json['priorityEmail'];
vitalSignText = json['vitalSignText'];
doctorText = json['doctorText'];
procedureText = json['procedureText'];
vaccinationText = json['vaccinationText'];
nebulizationText = json['nebulizationText'];
vitalSignText = json['callForVitalSignText'];
doctorText = json['callForDoctorText'];
procedureText = json['callForProcedureText'];
vaccinationText = json['callForVaccinationText'];
nebulizationText = json['callForNebulizationText'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedBy = json['editedBy'];
@ -101,13 +116,19 @@ class CallConfig {
roomText = json['roomText'];
queueNoText = json['queueNoText'];
callForText = json['callForText'];
nextPrayerText = json['nextPrayerText'];
maxText = json['maxText'];
fajrText = json['fajrText'];
dhuhrText = json['dhuhrText'];
asrText = json['asrText'];
maghribText = json['maghribText'];
ishaText = json['ishaText'];
currentServeText = json['currentServeText'];
callTypeVitalSignText = json['callTypeVitalSignText'];
callTypeVitalSignText = json['callTypeVitalSignText'];
callTypeDoctorText = json['callTypeDoctorText'];
callTypeProcedureText = json['callTypeProcedureText'];
callTypeVaccinationText = json['callTypeVaccinationText'];
callTypeNebulizationText = json['callTypeNebulizationText'];
callTypeVitalSignText = json['vitalSignText'];
callTypeDoctorText = json['doctorText'];
callTypeProcedureText = json['procedureText'];
callTypeVaccinationText = json['vaccinationText'];
callTypeNebulizationText = json['nebulizationText'];
textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr;
// textDirection = TextDirection.ltr;
}

@ -1,3 +1,5 @@
import 'package:queuing_system/core/config/config.dart';
class WeathersWidgetModel {
int? id;
String? headline;
@ -11,20 +13,23 @@ class WeathersWidgetModel {
double? windSpeed;
String? windDirection;
double? windDegrees;
String? weatherIconPath;
WeathersWidgetModel(
{this.id,
this.headline,
this.maxTemp,
this.minTemp,
this.iconPhrase,
this.forecastDate,
this.cityID,
this.forecastDay,
this.createDateTime,
this.windSpeed,
this.windDirection,
this.windDegrees});
WeathersWidgetModel({
this.id,
this.headline,
this.maxTemp,
this.minTemp,
this.iconPhrase,
this.forecastDate,
this.cityID,
this.forecastDay,
this.createDateTime,
this.windSpeed,
this.windDirection,
this.windDegrees,
this.weatherIconPath,
});
WeathersWidgetModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -39,6 +44,23 @@ class WeathersWidgetModel {
windSpeed = json['windSpeed'];
windDirection = json['windDirection'];
windDegrees = json['windDegrees'];
weatherIconPath = getWeatherIconPath(json['iconPhrase']);
}
String getWeatherIconPath(String iconPhrase) {
if (iconPhrase == "Rain" || iconPhrase == "Showers" || iconPhrase == "ThunderStorms") {
return AppGlobal.rainIcon;
} else if (iconPhrase == "Hot") {
return AppGlobal.hotIcon;
} else if (iconPhrase == "Windy") {
return AppGlobal.windIcon;
} else if (iconPhrase == "Cloudy" || iconPhrase == "Mostly cloudy" || iconPhrase == "Intermittent clouds") {
return AppGlobal.cloudIcon;
} else if (iconPhrase == "Sunny" || iconPhrase == "Mostly sunny" || iconPhrase == "Partly sunny" || iconPhrase == "Hazy sunshine") {
return AppGlobal.sunnyIcon;
} else {
return AppGlobal.weatherIcon;
}
}
Map<String, dynamic> toJson() {

@ -17,23 +17,26 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget {
if (appProvider.currentWeathersWidgetModel.maxTemp == null || appProvider.currentWeathersWidgetModel.minTemp == null || appProvider.currentWeathersWidgetModel.iconPhrase == null) {
return const SizedBox.shrink();
}
return Row(
children: [
SvgPicture.asset(
AppGlobal.weatherIcon,
height: SizeConfig.getHeightMultiplier() * 2.5,
color: Colors.white,
),
const SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 15),
child: AppText(
"Max: ${appProvider.currentWeathersWidgetModel.maxTemp}°C , Min: ${appProvider.currentWeathersWidgetModel.minTemp}°C",
return Directionality(
textDirection: appProvider.patientCallConfigurations.textDirection,
child: Row(
children: [
SvgPicture.asset(
appProvider.currentWeathersWidgetModel.weatherIconPath ?? AppGlobal.weatherIcon,
height: SizeConfig.getHeightMultiplier() * 2.5,
color: Colors.white,
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
),
),
],
const SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 15),
child: AppText(
"${appProvider.patientCallConfigurations.maxText}: ${appProvider.currentWeathersWidgetModel.maxTemp}°C , ${appProvider.patientCallConfigurations.minText}: ${appProvider.currentWeathersWidgetModel.minTemp}°C",
color: Colors.white,
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
),
),
],
),
);
});
}
@ -43,23 +46,26 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget {
if (appProvider.nextPrayerToShowWithTime.isEmpty) {
return const SizedBox.shrink();
}
return Row(
children: [
SvgPicture.asset(
AppGlobal.mosqueIcon,
height: SizeConfig.getHeightMultiplier() * 2.5,
color: Colors.white,
),
const SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 15),
child: AppText(
"Next Prayer: ${appProvider.nextPrayerToShowWithTime}",
return Directionality(
textDirection: appProvider.patientCallConfigurations.textDirection,
child: Row(
children: [
SvgPicture.asset(
AppGlobal.mosqueIcon,
height: SizeConfig.getHeightMultiplier() * 2.5,
color: Colors.white,
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
),
),
],
const SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 15),
child: AppText(
"Next Prayer: ${appProvider.nextPrayerToShowWithTime}",
color: Colors.white,
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
),
),
],
),
);
});
}

@ -107,31 +107,31 @@ class AppProvider extends ChangeNotifier {
final current = DateTime.now();
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!));
nextPrayerToShowWithTime = "Fajr ($namazTime)";
nextPrayerToShowWithTime = "${patientCallConfigurations.fajrText} ($namazTime)";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.dhuhr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.dhuhr!));
nextPrayerToShowWithTime = "Dhuhr ($namazTime)";
nextPrayerToShowWithTime = "${patientCallConfigurations.dhuhrText} ($namazTime)";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.asr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.asr!));
nextPrayerToShowWithTime = "Asar ($namazTime)";
nextPrayerToShowWithTime = "${patientCallConfigurations.asrText} ($namazTime)";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.maghrib!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.maghrib!));
nextPrayerToShowWithTime = "Maghrib ($namazTime)";
nextPrayerToShowWithTime = "${patientCallConfigurations.maghribText} ($namazTime)";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.isha!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.isha!));
nextPrayerToShowWithTime = "Isha ($namazTime)";
nextPrayerToShowWithTime = "${patientCallConfigurations.ishaText} ($namazTime)";
notifyListeners();
return;
}

@ -14,10 +14,10 @@ class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final appProvider = context.watch<AppProvider>();
return AppScaffold(
appProvider: appProvider,
appBar: AppHeader(),
appBar: const AppHeader(),
body: dataContent(appProvider: appProvider),
bottomNavigationBar: Container(
color: Colors.grey.withOpacity(0.1),
@ -35,7 +35,7 @@ class MyHomePage extends StatelessWidget {
children: [
InkWell(
onTap: () async {
await context.read<AppProvider>().callPatientsAPI();
// await context.read<AppProvider>().callPatientsAPI();
},
child: AppText(
"Powered By",

Loading…
Cancel
Save