Compare commits
2 Commits
vypq
...
758cc22a0f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
758cc22a0f | ||
|
|
345c554519 |
38
ios/Podfile
38
ios/Podfile
@@ -9,58 +9,24 @@ post_install do |installer|
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
|
||||
'$(inherited)',
|
||||
|
||||
## dart: PermissionGroup.calendar
|
||||
# 'PERMISSION_EVENTS=1',
|
||||
|
||||
## dart: PermissionGroup.calendarFullAccess
|
||||
# 'PERMISSION_EVENTS_FULL_ACCESS=1',
|
||||
|
||||
## dart: PermissionGroup.reminders
|
||||
# 'PERMISSION_REMINDERS=1',
|
||||
|
||||
## dart: PermissionGroup.contacts
|
||||
# 'PERMISSION_CONTACTS=1',
|
||||
|
||||
## dart: PermissionGroup.camera
|
||||
'PERMISSION_CAMERA=1',
|
||||
|
||||
## dart: PermissionGroup.microphone
|
||||
# 'PERMISSION_MICROPHONE=1',
|
||||
|
||||
## dart: PermissionGroup.speech
|
||||
# 'PERMISSION_SPEECH_RECOGNIZER=1',
|
||||
|
||||
## dart: PermissionGroup.photos
|
||||
# 'PERMISSION_PHOTOS=1',
|
||||
|
||||
## The 'PERMISSION_LOCATION' macro enables the `locationWhenInUse` and `locationAlways` permission. If
|
||||
## the application only requires `locationWhenInUse`, only specify the `PERMISSION_LOCATION_WHENINUSE`
|
||||
## macro.
|
||||
##
|
||||
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
|
||||
'PERMISSION_LOCATION=1',
|
||||
'PERMISSION_LOCATION_WHENINUSE=0',
|
||||
'PERMISSION_LOCATION=0',
|
||||
'PERMISSION_LOCATION_WHENINUSE=1',
|
||||
|
||||
## dart: PermissionGroup.notification
|
||||
'PERMISSION_NOTIFICATIONS=1',
|
||||
|
||||
## dart: PermissionGroup.mediaLibrary
|
||||
# 'PERMISSION_MEDIA_LIBRARY=1',
|
||||
|
||||
## dart: PermissionGroup.sensors
|
||||
# 'PERMISSION_SENSORS=1',
|
||||
|
||||
## dart: PermissionGroup.bluetooth
|
||||
# 'PERMISSION_BLUETOOTH=1',
|
||||
|
||||
## dart: PermissionGroup.appTrackingTransparency
|
||||
# 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
|
||||
|
||||
## dart: PermissionGroup.criticalAlerts
|
||||
'PERMISSION_CRITICAL_ALERTS=1',
|
||||
|
||||
## dart: PermissionGroup.criticalAlerts
|
||||
'PERMISSION_ASSISTANT=1',
|
||||
]
|
||||
|
||||
end
|
||||
|
||||
@@ -28,14 +28,12 @@
|
||||
<true/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Camera permission is required for barcode scanning.</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>Always and when in use!</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>Can I have location always?</string>
|
||||
<key>NSLocationUsageDescription</key>
|
||||
<string>Older devices need location.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>Need location when in use</string>
|
||||
<string>Cần vị trí để hiển thị bản đồ hoặc tìm địa điểm gần bạn</string>
|
||||
<key>NSUserNotificationsUsageDescription</key>
|
||||
<string>Chúng tôi cần gửi thông báo khẩn cấp để cảnh báo về việc thiết bị phát hiện có cháy.</string>
|
||||
<key>com.apple.developer.usernotifications.critical-alerts</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
|
||||
@@ -82,60 +82,57 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
stream: homeBloc.streamOwnerDevicesStatus,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data?['state'] != null || snapshot.data?['battery'] != null) {
|
||||
return Row(
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (snapshot.data?['state'] != null)
|
||||
...snapshot.data!['state']!
|
||||
.map(
|
||||
(item) => FutureBuilder<Widget>(
|
||||
(item) => SizedBox(
|
||||
width: context.dynamicWidth(0.95),
|
||||
child: FutureBuilder<Widget>(
|
||||
future: warningCard(context, apiServices, item),
|
||||
builder: (context, warningCardSnapshot) {
|
||||
if (warningCardSnapshot.hasData) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 400,
|
||||
maxHeight: 260,
|
||||
),
|
||||
child: warningCardSnapshot.data!,
|
||||
);
|
||||
return warningCardSnapshot.data!;
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
if (snapshot.data?['battery'] != null)
|
||||
...snapshot.data!['battery']!
|
||||
.map(
|
||||
(batteryItem) => FutureBuilder<Widget>(
|
||||
(batteryItem) => SizedBox(
|
||||
width: context.dynamicWidth(0.95),
|
||||
child: FutureBuilder<Widget>(
|
||||
future: notificationCard(
|
||||
context, "lowBattery", appLocalization(context).low_battery_message, batteryItem),
|
||||
builder: (context, warningCardSnapshot) {
|
||||
if (warningCardSnapshot.hasData) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 400,
|
||||
maxHeight: 260,
|
||||
),
|
||||
child: warningCardSnapshot.data!,
|
||||
);
|
||||
return warningCardSnapshot.data!;
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Padding(
|
||||
padding: context.paddingMedium,
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.check_circle_outline_rounded,
|
||||
@@ -159,6 +156,11 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
StreamBuilder<Map<String, List<DeviceWithAlias>>>(
|
||||
stream: homeBloc.streamAllDevicesAliasMap,
|
||||
builder: (context, allDevicesAliasMapSnapshot) {
|
||||
|
||||
@@ -23,7 +23,6 @@ class OverviewCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
margin: context.paddingLow,
|
||||
elevation: 8,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
|
||||
@@ -234,9 +234,9 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
if (hasStateOne) {
|
||||
return flameIcon; // flameIcon
|
||||
} else if (hasOtherState) {
|
||||
return normalIcon; // normalIcon
|
||||
return offlineIcon; // normalIcon
|
||||
} else {
|
||||
return offlineIcon; // offlineIcon
|
||||
return normalIcon; // offlineIcon
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,16 +274,13 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
if (response != "") {
|
||||
final data = jsonDecode(response);
|
||||
List<dynamic> result = data['items'];
|
||||
if(result.isNotEmpty){
|
||||
if (result.isNotEmpty) {
|
||||
devices.clear();
|
||||
final devicesList = Device.fromJsonDynamicList(result);
|
||||
for (var device in devicesList) {
|
||||
devices.add(device);
|
||||
}
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ onTapMarker(
|
||||
style: const ButtonStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(Colors.red),
|
||||
foregroundColor: WidgetStatePropertyAll(Colors.white),
|
||||
iconColor: WidgetStatePropertyAll(Colors.white),
|
||||
),
|
||||
icon: IconConstants.instance
|
||||
.getMaterialIcon(Icons.fire_truck_outlined),
|
||||
|
||||
Reference in New Issue
Block a user