fix(ui): display interfamily tags when interfamily's devices state = 1
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:sfm_app/feature/home/device_alias_model.dart';
|
||||
import '../../../product/constant/enums/app_route_enums.dart';
|
||||
import '../../../product/constant/image/image_constants.dart';
|
||||
import '../../../product/extention/context_extention.dart';
|
||||
import '../../../product/services/language_services.dart';
|
||||
@@ -8,14 +11,13 @@ import '../../../product/utils/device_utils.dart';
|
||||
|
||||
import '../../../product/constant/icon/icon_constants.dart';
|
||||
|
||||
Future<Widget> notificationCard(
|
||||
BuildContext context,
|
||||
String notiticationType,
|
||||
String notificationTitle,
|
||||
String notificationDevicename,
|
||||
String notificationLocation) async {
|
||||
String location = await DeviceUtils.instance
|
||||
.getFullDeviceLocation(context, notificationLocation);
|
||||
Future<Widget> notificationCard(BuildContext context, String notiticationType,
|
||||
String notificationTitle, DeviceWithAlias device) async {
|
||||
String location = "";
|
||||
if (device.areaPath != "") {
|
||||
location = await DeviceUtils.instance
|
||||
.getFullDeviceLocation(context, device.areaPath!);
|
||||
}
|
||||
String path = "";
|
||||
DateTime time = DateTime.now();
|
||||
if (notiticationType == "lowBattery") {
|
||||
@@ -50,7 +52,7 @@ Future<Widget> notificationCard(
|
||||
SizedBox(height: context.lowValue),
|
||||
SizedBox(
|
||||
child: Text(
|
||||
"${appLocalization(context).device_title} $notificationDevicename",
|
||||
"${appLocalization(context).device_title} ${device.isOwner! ? device.name : device.alias}",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
@@ -113,8 +115,12 @@ Future<Widget> notificationCard(
|
||||
alignment: Alignment.centerRight,
|
||||
child: OutlinedButton(
|
||||
style: const ButtonStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(Colors.blueAccent)),
|
||||
onPressed: () {},
|
||||
backgroundColor: WidgetStatePropertyAll(Colors.blueAccent),
|
||||
),
|
||||
onPressed: () {
|
||||
context.pushNamed(AppRoutes.DEVICE_DETAIL.name,
|
||||
pathParameters: {'thingID': device.thingId!});
|
||||
},
|
||||
child: Text(
|
||||
appLocalization(context).detail_message,
|
||||
style: const TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user