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 coldIcon = "assets/icons/cold.svg";
static String hotIcon = "assets/icons/hot.svg"; static String hotIcon = "assets/icons/hot.svg";
static String rainIcon = "assets/icons/rainy.svg"; static String rainIcon = "assets/icons/rainy.svg";
static String sunnyIcon = "assets/icons/sunny.svg";
static String windIcon = "assets/icons/windy.svg"; static String windIcon = "assets/icons/windy.svg";
} }

@ -37,6 +37,14 @@ class CallConfig {
late String queueNoText; late String queueNoText;
late String callForText; late String callForText;
late String currentServeText; 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 callTypeVitalSignText;
late String callTypeDoctorText; late String callTypeDoctorText;
late String callTypeProcedureText; late String callTypeProcedureText;
@ -69,7 +77,14 @@ class CallConfig {
this.queueNoText = "", this.queueNoText = "",
this.callForText = "", this.callForText = "",
this.currentServeText = "Current Serving", 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.callTypeDoctorText = "",
this.callTypeProcedureText = "", this.callTypeProcedureText = "",
this.callTypeVaccinationText = "", this.callTypeVaccinationText = "",
@ -89,11 +104,11 @@ class CallConfig {
prioritySMS = json['prioritySMS']; prioritySMS = json['prioritySMS'];
priorityWhatsApp = json['priorityWhatsApp']; priorityWhatsApp = json['priorityWhatsApp'];
priorityEmail = json['priorityEmail']; priorityEmail = json['priorityEmail'];
vitalSignText = json['vitalSignText']; vitalSignText = json['callForVitalSignText'];
doctorText = json['doctorText']; doctorText = json['callForDoctorText'];
procedureText = json['procedureText']; procedureText = json['callForProcedureText'];
vaccinationText = json['vaccinationText']; vaccinationText = json['callForVaccinationText'];
nebulizationText = json['nebulizationText']; nebulizationText = json['callForNebulizationText'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdOn = json['createdOn']; createdOn = json['createdOn'];
editedBy = json['editedBy']; editedBy = json['editedBy'];
@ -101,13 +116,19 @@ class CallConfig {
roomText = json['roomText']; roomText = json['roomText'];
queueNoText = json['queueNoText']; queueNoText = json['queueNoText'];
callForText = json['callForText']; 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']; currentServeText = json['currentServeText'];
callTypeVitalSignText = json['callTypeVitalSignText']; callTypeVitalSignText = json['vitalSignText'];
callTypeVitalSignText = json['callTypeVitalSignText']; callTypeDoctorText = json['doctorText'];
callTypeDoctorText = json['callTypeDoctorText']; callTypeProcedureText = json['procedureText'];
callTypeProcedureText = json['callTypeProcedureText']; callTypeVaccinationText = json['vaccinationText'];
callTypeVaccinationText = json['callTypeVaccinationText']; callTypeNebulizationText = json['nebulizationText'];
callTypeNebulizationText = json['callTypeNebulizationText'];
textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr; textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr;
// textDirection = TextDirection.ltr; // textDirection = TextDirection.ltr;
} }

@ -1,3 +1,5 @@
import 'package:queuing_system/core/config/config.dart';
class WeathersWidgetModel { class WeathersWidgetModel {
int? id; int? id;
String? headline; String? headline;
@ -11,9 +13,10 @@ class WeathersWidgetModel {
double? windSpeed; double? windSpeed;
String? windDirection; String? windDirection;
double? windDegrees; double? windDegrees;
String? weatherIconPath;
WeathersWidgetModel( WeathersWidgetModel({
{this.id, this.id,
this.headline, this.headline,
this.maxTemp, this.maxTemp,
this.minTemp, this.minTemp,
@ -24,7 +27,9 @@ class WeathersWidgetModel {
this.createDateTime, this.createDateTime,
this.windSpeed, this.windSpeed,
this.windDirection, this.windDirection,
this.windDegrees}); this.windDegrees,
this.weatherIconPath,
});
WeathersWidgetModel.fromJson(Map<String, dynamic> json) { WeathersWidgetModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -39,6 +44,23 @@ class WeathersWidgetModel {
windSpeed = json['windSpeed']; windSpeed = json['windSpeed'];
windDirection = json['windDirection']; windDirection = json['windDirection'];
windDegrees = json['windDegrees']; 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() { Map<String, dynamic> toJson() {

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

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

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

Loading…
Cancel
Save