diff --git a/assets/icons/cloudy.svg b/assets/icons/cloudy.svg
new file mode 100644
index 0000000..b1f6b7e
--- /dev/null
+++ b/assets/icons/cloudy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/icons/cold.svg b/assets/icons/cold.svg
new file mode 100644
index 0000000..06b4b0b
--- /dev/null
+++ b/assets/icons/cold.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/icons/hot.svg b/assets/icons/hot.svg
new file mode 100644
index 0000000..1fedcc1
--- /dev/null
+++ b/assets/icons/hot.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/icons/mosque.png b/assets/icons/mosque.png
new file mode 100644
index 0000000..6d736d7
Binary files /dev/null and b/assets/icons/mosque.png differ
diff --git a/assets/icons/rainy.svg b/assets/icons/rainy.svg
new file mode 100644
index 0000000..c3ce867
--- /dev/null
+++ b/assets/icons/rainy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/icons/weather.svg b/assets/icons/weather.svg
new file mode 100644
index 0000000..8c0ac78
--- /dev/null
+++ b/assets/icons/weather.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/icons/windy.svg b/assets/icons/windy.svg
new file mode 100644
index 0000000..9e12431
--- /dev/null
+++ b/assets/icons/windy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/lib/core/api.dart b/lib/core/api.dart
index c8cfa78..9e66b0b 100644
--- a/lib/core/api.dart
+++ b/lib/core/api.dart
@@ -5,9 +5,15 @@ import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/core/response_models/patient_ticket_model.dart';
+import 'package:queuing_system/core/response_models/prayers_widget_model.dart';
+import 'package:queuing_system/core/response_models/weathers_widget_model.dart';
+import 'package:queuing_system/core/response_models/widgets_config_model.dart';
const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfo_ByIP";
const _callUpdateNotIsQueueRecordByIDAsync = "/CallRequest_QueueUpdate";
+const _waitingAreaScreenConfigGet = "/WaitingAreaScreen_Config_Get";
+const _weatherForecastGetBy5Days = "/WeatherForecast_GetBy5Days";
+const _prayerTimeToday = "/PrayerTime_Today";
class MyHttpOverrides extends HttpOverrides {
@override
@@ -20,7 +26,7 @@ class API {
static getCallRequestInfoByClinicInfo(String deviceIp,
{required Function(List, List, CallConfig callConfig) onSuccess, required Function(dynamic) onFailure}) async {
final body = {"ipAdress": deviceIp, "apiKey": apiKey};
- bool isDevMode = true;
+ bool isDevMode = false;
if (isDevMode) {
var callPatients = PatientTicketModel.testCallPatients;
CallConfig callConfig = CallConfig.testCallConfig;
@@ -80,4 +86,51 @@ class API {
onFailure(false);
}
}
+
+ static Future getWidgetConfigsFromServer(String deviceIp, {required Function(dynamic) onFailure}) async {
+ final body = {"ipAddress": deviceIp};
+
+ WidgetsConfigModel widgetsConfigModel = WidgetsConfigModel();
+ await BaseAppClient.post(_waitingAreaScreenConfigGet,
+ body: body,
+ onSuccess: (response, status) {
+ if (status == 200 && response["data"] != null) {
+ widgetsConfigModel = (response["data"] as List).map((e) => WidgetsConfigModel.fromJson(e)).toList().first;
+ }
+ },
+ onFailure: (error, status) => log("error: ${error.toString()}"));
+ return widgetsConfigModel;
+ }
+
+ static Future getWeatherDetailsFromServer(String cityId, {required Function(dynamic) onFailure}) async {
+ final body = {"cityID": cityId};
+ WeathersWidgetModel weathersWidgetModel = WeathersWidgetModel();
+ await BaseAppClient.post(_weatherForecastGetBy5Days,
+ body: body,
+ onSuccess: (response, status) {
+ if (status == 200 && response["data"] != null) {
+ weathersWidgetModel = (response["data"] as List).map((e) => WeathersWidgetModel.fromJson(e)).toList().first;
+ }
+ },
+ onFailure: (error, status) => log("error: ${error.toString()}"));
+ return weathersWidgetModel;
+ }
+
+ static Future> getPrayerDetailsFromServer({
+ required double latitude,
+ required double longitude,
+ required Function(dynamic) onFailure,
+ }) async {
+ final body = {"latitude": latitude, "longitude": longitude};
+ await BaseAppClient.post(_prayerTimeToday,
+ body: body,
+ onSuccess: (response, status) {
+ if (status == 200 && response["data"] != null) {
+ List prayersWidgetModel = (response["data"] as List).map((e) => PrayersWidgetModel.fromJson(e)).toList();
+ return prayersWidgetModel;
+ }
+ },
+ onFailure: (error, status) => log("error: ${error.toString()}"));
+ return [];
+ }
}
diff --git a/lib/core/config/config.dart b/lib/core/config/config.dart
index 1faa39c..6556230 100644
--- a/lib/core/config/config.dart
+++ b/lib/core/config/config.dart
@@ -24,15 +24,25 @@ class AppGlobal {
static Color nebulizationColor = const Color(0xFF3C86D0);
static Color vitalSignColor = const Color(0xFFD02127);
static Color doctorColor = const Color(0xFF52964F);
+
// static Color procedureColor = const Color(0xFFC99609);
static Color vaccinationColor = const Color(0xFFC99609);
static Color procedureColor = const Color(0xFF460707);
-
//IconPaths
static String vitalSignIcon = "assets/images/vitalsign_icon.svg";
static String nebulizationIcon = "assets/images/nebulization_icon.svg";
static String doctorIcon = "assets/images/doctor_icon.svg";
static String procedureIcon = "assets/images/procedure_icon.svg";
static String vaccinationIcon = "assets/images/vaccination_icon.svg";
+
+ //Widgets
+ static String mosqueIcon = "assets/icons/mosque.png";
+ static String weatherIcon = "assets/icons/weather.svg";
+
+ static String cloudIcon = "assets/icons/cloudy.svg";
+ static String coldIcon = "assets/icons/cold.svg";
+ static String hotIcon = "assets/icons/hot.svg";
+ static String rainIcon = "assets/icons/rainy.svg";
+ static String windIcon = "assets/icons/windy.svg";
}
diff --git a/lib/core/response_models/prayers_widget_model.dart b/lib/core/response_models/prayers_widget_model.dart
new file mode 100644
index 0000000..c985644
--- /dev/null
+++ b/lib/core/response_models/prayers_widget_model.dart
@@ -0,0 +1,48 @@
+class PrayersWidgetModel {
+ String? fajr;
+ String? sunrise;
+ String? dhuhr;
+ String? asr;
+ String? sunset;
+ String? maghrib;
+ String? isha;
+ String? imsak;
+ String? midnight;
+ String? firstthird;
+ String? lastthird;
+ String? dateFor;
+
+ PrayersWidgetModel({this.fajr, this.sunrise, this.dhuhr, this.asr, this.sunset, this.maghrib, this.isha, this.imsak, this.midnight, this.firstthird, this.lastthird, this.dateFor});
+
+ PrayersWidgetModel.fromJson(Map json) {
+ fajr = json['fajr'];
+ sunrise = json['sunrise'];
+ dhuhr = json['dhuhr'];
+ asr = json['asr'];
+ sunset = json['sunset'];
+ maghrib = json['maghrib'];
+ isha = json['isha'];
+ imsak = json['imsak'];
+ midnight = json['midnight'];
+ firstthird = json['firstthird'];
+ lastthird = json['lastthird'];
+ dateFor = json['dateFor'];
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['fajr'] = fajr;
+ data['sunrise'] = sunrise;
+ data['dhuhr'] = dhuhr;
+ data['asr'] = asr;
+ data['sunset'] = sunset;
+ data['maghrib'] = maghrib;
+ data['isha'] = isha;
+ data['imsak'] = imsak;
+ data['midnight'] = midnight;
+ data['firstthird'] = firstthird;
+ data['lastthird'] = lastthird;
+ data['dateFor'] = dateFor;
+ return data;
+ }
+}
diff --git a/lib/core/response_models/weathers_widget_model.dart b/lib/core/response_models/weathers_widget_model.dart
new file mode 100644
index 0000000..65732eb
--- /dev/null
+++ b/lib/core/response_models/weathers_widget_model.dart
@@ -0,0 +1,65 @@
+class WeathersWidgetModel {
+ int? id;
+ String? headline;
+ double? maxTemp;
+ double? minTemp;
+ String? iconPhrase;
+ String? forecastDate;
+ int? cityID;
+ String? forecastDay;
+ String? createDateTime;
+ double? windSpeed;
+ String? windDirection;
+ double? 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});
+
+ WeathersWidgetModel.fromJson(Map json) {
+ id = json['id'];
+ headline = json['headline'];
+ maxTemp = json['maxTemp'];
+ minTemp = json['minTemp'];
+ iconPhrase = json['iconPhrase'];
+ forecastDate = json['forecastDate'];
+ cityID = json['cityID'];
+ forecastDay = json['forecastDay'];
+ createDateTime = json['createDateTime'];
+ windSpeed = json['windSpeed'];
+ windDirection = json['windDirection'];
+ windDegrees = json['windDegrees'];
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['id'] = id;
+ data['headline'] = headline;
+ data['maxTemp'] = maxTemp;
+ data['minTemp'] = minTemp;
+ data['iconPhrase'] = iconPhrase;
+ data['forecastDate'] = forecastDate;
+ data['cityID'] = cityID;
+ data['forecastDay'] = forecastDay;
+ data['createDateTime'] = createDateTime;
+ data['windSpeed'] = windSpeed;
+ data['windDirection'] = windDirection;
+ data['windDegrees'] = windDegrees;
+ return data;
+ }
+
+ @override
+ String toString() {
+ return 'WeathersWidgetModel{id: $id, headline: $headline, maxTemp: $maxTemp, minTemp: $minTemp, iconPhrase: $iconPhrase, forecastDate: $forecastDate, cityID: $cityID, forecastDay: $forecastDay, createDateTime: $createDateTime, windSpeed: $windSpeed, windDirection: $windDirection, windDegrees: $windDegrees}';
+ }
+}
diff --git a/lib/core/response_models/widgets_config_model.dart b/lib/core/response_models/widgets_config_model.dart
new file mode 100644
index 0000000..cbc04b2
--- /dev/null
+++ b/lib/core/response_models/widgets_config_model.dart
@@ -0,0 +1,53 @@
+class WidgetsConfigModel {
+ int? waitingAreaID;
+ String? waitingAreaName;
+ bool? isWeatherReq;
+ bool? isPrayerTimeReq;
+ int? projectID;
+ double? projectLatitude;
+ double? projectLongitude;
+ int? cityKey;
+
+ WidgetsConfigModel({
+ this.waitingAreaID,
+ this.waitingAreaName,
+ this.isWeatherReq,
+ this.isPrayerTimeReq,
+ this.projectID,
+ this.projectLatitude,
+ this.projectLongitude,
+ this.cityKey,
+ });
+
+ WidgetsConfigModel.fromJson(Map json) {
+ print("jsonToConvert: $json");
+ waitingAreaID = json['waitingAreaID'];
+ waitingAreaName = json['waitingAreaName'];
+ isWeatherReq = true;
+ isPrayerTimeReq = true;
+ // isWeatherReq = json['isWeatherReq'];
+ // isPrayerTimeReq = json['isPrayerTimeReq'];
+ projectID = json['projectID'];
+ projectLatitude = json['projectLatitude'];
+ projectLongitude = json['projectLongitude'];
+ cityKey = json['cityKey'];
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['waitingAreaID'] = waitingAreaID;
+ data['waitingAreaName'] = waitingAreaName;
+ data['isWeatherReq'] = isWeatherReq;
+ data['isPrayerTimeReq'] = isPrayerTimeReq;
+ data['projectID'] = projectID;
+ data['projectLatitude'] = projectLatitude;
+ data['projectLongitude'] = projectLongitude;
+ data['cityKey'] = cityKey;
+ return data;
+ }
+
+ @override
+ String toString() {
+ return 'WidgetsConfigModel{waitingAreaID: $waitingAreaID, waitingAreaName: $waitingAreaName, isWeatherReq: $isWeatherReq, isPrayerTimeReq: $isPrayerTimeReq, projectLatitude: $projectLatitude,projectLongitude: $projectLongitude, cityKey: $cityKey}';
+ }
+}
diff --git a/lib/header/app_header.dart b/lib/header/app_header.dart
index 28a9f1a..0ba8bcd 100644
--- a/lib/header/app_header.dart
+++ b/lib/header/app_header.dart
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/config/config.dart';
+import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/utils/utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
@@ -9,6 +10,51 @@ import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class AppHeader extends StatelessWidget with PreferredSizeWidget {
const AppHeader({Key? key}) : super(key: key);
+ Widget getWeatherWidget(AppProvider appProvider) {
+ 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",
+ color: Colors.white,
+ fontSize: SizeConfig.getHeightMultiplier() * 1.3,
+ ),
+ ),
+ ],
+ );
+ }
+
+ Widget getPrayerWidget(AppProvider appProvider) {
+ return Row(
+ children: [
+ Image.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: Dhuhr (11:49am)",
+ color: Colors.white,
+ fontSize: SizeConfig.getHeightMultiplier() * 1.3,
+ ),
+ ),
+ ],
+ );
+ }
+
@override
Widget build(BuildContext context) {
AppProvider appProvider = context.read();
@@ -36,9 +82,10 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget {
child: AppText(
appProvider.patientCallConfigurations.currentServeText,
color: Colors.white,
- fontFamily: 'Poppins-SemiBold.ttf',
),
),
+ getPrayerWidget(appProvider),
+ getWeatherWidget(appProvider),
SvgPicture.asset(
"assets/images/hmglogo.svg",
height: Utils.getHeight() * 0.5,
diff --git a/lib/home/app_provider.dart b/lib/home/app_provider.dart
index bd9efa6..7606cf5 100644
--- a/lib/home/app_provider.dart
+++ b/lib/home/app_provider.dart
@@ -9,15 +9,26 @@ import 'package:just_audio/just_audio.dart';
import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/core/response_models/patient_ticket_model.dart';
+import 'package:queuing_system/core/response_models/prayers_widget_model.dart';
+import 'package:queuing_system/core/response_models/weathers_widget_model.dart';
+import 'package:queuing_system/core/response_models/widgets_config_model.dart';
import 'package:queuing_system/utils/call_by_voice.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/utils/signalR_utils.dart';
+import 'package:shared_preferences/shared_preferences.dart';
class AppProvider extends ChangeNotifier {
AppProvider() {
- startSignalHubConnection();
+ callInitializations();
+ }
+
+ Future callInitializations() async {
+ await startSignalHubConnection();
+ await getInfoWidgetsDetailsFromServer();
+ await getLastTimeUpdatedFromCache();
listenNetworkConnectivity();
listenAudioPlayerEvents();
+ getTheWidgetsConfigurationsEveryMidnight();
}
SignalRHelper signalRHelper = SignalRHelper();
@@ -57,6 +68,103 @@ class AppProvider extends ChangeNotifier {
}
}
+ WidgetsConfigModel? currentWidgetsConfigModel = WidgetsConfigModel();
+
+ Future getInfoWidgetsConfigurationsFromServer() async {
+ WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
+ log("Api call failed with this error: ${error.toString()}");
+ });
+
+ if (widgetsConfigModel != null) {
+ currentWidgetsConfigModel = widgetsConfigModel;
+ log("I got this data: ${widgetsConfigModel.toString()}");
+ notifyListeners();
+ }
+ }
+
+ WeathersWidgetModel currentWeathersWidgetModel = WeathersWidgetModel();
+
+ Future getWeatherDetailsFromServer() async {
+ log("I got this data from Weather: ");
+
+ WeathersWidgetModel? weathersWidgetModel = await API.getWeatherDetailsFromServer(
+ (currentWidgetsConfigModel!.cityKey ?? "").toString(),
+ onFailure: (error) => log("Api call failed with this error: ${error.toString()}"),
+ );
+
+ if (weathersWidgetModel != null) {
+ currentWeathersWidgetModel = weathersWidgetModel;
+ log("I got this data from Weather: ${weathersWidgetModel.toString()}");
+ notifyListeners();
+ }
+ }
+
+ PrayersWidgetModel nextPrayerToShow = PrayersWidgetModel();
+
+ Future getTheNextPrayerToShow() async {
+
+ }
+
+ List currentPrayersWidgetModel = [];
+
+ Future getPrayerDetailsFromServer() async {
+ List prayersWidgetModel = await API.getPrayerDetailsFromServer(
+ latitude: currentWidgetsConfigModel!.projectLatitude ?? 0,
+ longitude: currentWidgetsConfigModel!.projectLongitude ?? 0,
+ onFailure: (error) => log("Api call failed with this error: ${error.toString()}"));
+
+ if (prayersWidgetModel.isNotEmpty) {
+ currentPrayersWidgetModel = prayersWidgetModel;
+ log("I got this data: ${prayersWidgetModel.toString()}");
+ notifyListeners();
+ }
+ }
+
+ Future getInfoWidgetsDetailsFromServer() async {
+ if (currentWidgetsConfigModel == null) return;
+
+ await getInfoWidgetsConfigurationsFromServer().whenComplete(() async {
+ if (currentWidgetsConfigModel!.isWeatherReq!) {
+ await getWeatherDetailsFromServer();
+ }
+ if (currentWidgetsConfigModel!.isPrayerTimeReq!) {
+ await getPrayerDetailsFromServer();
+ }
+ });
+
+ int currentDate = DateTime.now().millisecondsSinceEpoch;
+ await setLastTimeUpdatedInCache(lasTimeUpdated: currentDate.toString());
+ }
+
+ Future getTheWidgetsConfigurationsEveryMidnight() async {
+ if (currentWidgetsConfigModel == null) return;
+ if (!currentWidgetsConfigModel!.isWeatherReq! && !currentWidgetsConfigModel!.isPrayerTimeReq!) {
+ return;
+ }
+
+ DateTime current = DateTime.now();
+ Stream timer = Stream.periodic(const Duration(hours: 1), (i) {
+ current = current.add(const Duration(hours: 1));
+ return current;
+ });
+
+ timer.listen((data) async {
+ DateTime dateTime = DateTime.parse(data.toString());
+
+ if (currentWidgetsConfigModel!.isWeatherReq!) {
+ if (dateTime.day > currentLastTimeUpdated.day) {
+ await getWeatherDetailsFromServer();
+ }
+ }
+
+ if (currentWidgetsConfigModel!.isPrayerTimeReq!) {
+ if (dateTime.day > currentLastTimeUpdated.day) {
+ await getPrayerDetailsFromServer();
+ }
+ }
+ });
+ }
+
Future startSignalHubConnection() async {
if (!signalRHelper.getConnectionState()) {
await getCurrentIP().whenComplete(() => signalRHelper.startSignalRConnection(
@@ -71,22 +179,22 @@ class AppProvider extends ChangeNotifier {
Future callPatientsAPI() async {
patientTickets.clear();
- API.getCallRequestInfoByClinicInfo(currentDeviceIp, onSuccess: (waitingCalls, isQueuePatientsCalls, callConfigs) async {
- patientCallConfigurations = callConfigs;
- if (waitingCalls.length > patientCallConfigurations.screenMaxDisplayPatients) {
- patientTickets = waitingCalls.sublist(0, patientCallConfigurations.screenMaxDisplayPatients);
- } else {
- patientTickets = waitingCalls;
- }
- isQueuePatients = isQueuePatientsCalls;
- notifyListeners();
- if (patientTickets.isNotEmpty) {
- voiceCallPatientTicket(patientTickets.first);
- updatePatientTicket(patientTickets.first);
- }
- }, onFailure: (error) {
- log("Api call failed with this error: ${error.toString()}");
- });
+ API.getCallRequestInfoByClinicInfo(currentDeviceIp,
+ onSuccess: (waitingCalls, isQueuePatientsCalls, callConfigs) async {
+ patientCallConfigurations = callConfigs;
+ if (waitingCalls.length > patientCallConfigurations.screenMaxDisplayPatients) {
+ patientTickets = waitingCalls.sublist(0, patientCallConfigurations.screenMaxDisplayPatients);
+ } else {
+ patientTickets = waitingCalls;
+ }
+ isQueuePatients = isQueuePatientsCalls;
+ notifyListeners();
+ if (patientTickets.isNotEmpty) {
+ voiceCallPatientTicket(patientTickets.first);
+ updatePatientTicket(patientTickets.first);
+ }
+ },
+ onFailure: (error) => log("Api call failed with this error: ${error.toString()}"));
}
onPingReceived(data) async {
@@ -286,4 +394,25 @@ class AppProvider extends ChangeNotifier {
}
});
}
+
+ //SHARED PREFERENCE HANDLING
+
+ DateTime currentLastTimeUpdated = DateTime.now();
+
+ Future getLastTimeUpdatedFromCache() async {
+ final SharedPreferences prefs = await SharedPreferences.getInstance();
+
+ if (prefs.containsKey("lastTimeUpdated")) {
+ String? lastTimeUpdated = prefs.getString("lastTimeUpdated");
+ currentLastTimeUpdated = DateTime.fromMillisecondsSinceEpoch(int.parse(lastTimeUpdated!));
+ return lastTimeUpdated;
+ } else {
+ return null;
+ }
+ }
+
+ Future setLastTimeUpdatedInCache({required String lasTimeUpdated}) async {
+ final SharedPreferences prefs = await SharedPreferences.getInstance();
+ await prefs.setString("lastTimeUpdated", lasTimeUpdated);
+ }
}
diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart
index 61bab0f..b39fb28 100644
--- a/lib/home/home_screen.dart
+++ b/lib/home/home_screen.dart
@@ -1,3 +1,4 @@
+
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/base/app_scaffold_widget.dart';
diff --git a/lib/widget/data_display/app_texts_widget.dart b/lib/widget/data_display/app_texts_widget.dart
index e4c9767..b566592 100644
--- a/lib/widget/data_display/app_texts_widget.dart
+++ b/lib/widget/data_display/app_texts_widget.dart
@@ -112,6 +112,7 @@ class _AppTextState extends State {
? _getFontStyle()?.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color,
+ fontFamily: 'Poppins',
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight,
)
@@ -121,7 +122,7 @@ class _AppTextState extends State {
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
- fontFamily: widget.fontFamily ?? 'Poppins',
+ fontFamily: 'Poppins',
decoration: widget.textDecoration,
height: widget.fontHeight),
)
diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift
index caf5f62..fda5d83 100644
--- a/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -10,6 +10,7 @@ import connectivity_macos
import flutter_tts
import just_audio
import path_provider_foundation
+import shared_preferences_foundation
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
@@ -18,5 +19,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
+ SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}
diff --git a/pubspec.lock b/pubspec.lock
index 05279b0..f396328 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -121,6 +121,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.2"
+ file:
+ dependency: transitive
+ description:
+ name: file
+ sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.1.4"
flutter:
dependency: "direct main"
description: flutter
@@ -384,6 +392,62 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.27.7"
+ shared_preferences:
+ dependency: "direct main"
+ description:
+ name: shared_preferences
+ sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.2.1"
+ shared_preferences_android:
+ dependency: transitive
+ description:
+ name: shared_preferences_android
+ sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.2.1"
+ shared_preferences_foundation:
+ dependency: transitive
+ description:
+ name: shared_preferences_foundation
+ sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.4"
+ shared_preferences_linux:
+ dependency: transitive
+ description:
+ name: shared_preferences_linux
+ sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.1"
+ shared_preferences_platform_interface:
+ dependency: transitive
+ description:
+ name: shared_preferences_platform_interface
+ sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.1"
+ shared_preferences_web:
+ dependency: transitive
+ description:
+ name: shared_preferences_web
+ sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.2.1"
+ shared_preferences_windows:
+ dependency: transitive
+ description:
+ name: shared_preferences_windows
+ sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.1"
signalr_core:
dependency: "direct main"
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 73fc1be..3d20df2 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -31,7 +31,7 @@ dependencies:
sdk: flutter
- # Base packages
+ # Base packages
provider: ^6.0.1
get_it: ^7.1.3
connectivity: ^3.0.6
@@ -42,13 +42,12 @@ dependencies:
just_audio: ^0.9.31
flutter_tts: ^3.6.3
wakelock: ^0.6.2
+ shared_preferences: ^2.2.1
#signalr core
signalr_core: ^1.1.1
-
-
dev_dependencies:
flutter_test:
sdk: flutter
@@ -75,6 +74,7 @@ flutter:
assets:
- assets/images/
- assets/tones/
+ - assets/icons/
fonts: