fix(ui): Change TextStyle to ResponsiveText
This commit is contained in:
@@ -90,9 +90,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
|||||||
hint: Text(
|
hint: Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
.choose_device_dropdownButton,
|
.choose_device_dropdownButton,
|
||||||
style: const TextStyle(
|
style: context.responsiveBodySmall
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
items: allDevicesSnapshot.data?.isNotEmpty ?? false
|
items: allDevicesSnapshot.data?.isNotEmpty ?? false
|
||||||
? allDevicesSnapshot.data!
|
? allDevicesSnapshot.data!
|
||||||
@@ -101,9 +99,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
|||||||
value: device.thingId,
|
value: device.thingId,
|
||||||
child: Text(
|
child: Text(
|
||||||
device.name!,
|
device.name!,
|
||||||
style: const TextStyle(
|
style: context.responsiveBodySmall
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ addNewDevice(BuildContext context, String role) async {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${appLocalization(context).add_device_title}: ',
|
'${appLocalization(context).add_device_title}: ',
|
||||||
style:
|
style: context.responsiveBodyLargeWithBold,
|
||||||
const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
|
|
||||||
late DetailDeviceBloc detailDeviceBloc;
|
late DetailDeviceBloc detailDeviceBloc;
|
||||||
Completer<GoogleMapController> controller = Completer();
|
Completer<GoogleMapController> controller = Completer();
|
||||||
CameraPosition initialCamera =
|
CameraPosition initialCamera = const CameraPosition(
|
||||||
const CameraPosition(target: LatLng(20.966048511844402, 105.74977710843086), zoom: 15);
|
target: LatLng(20.966048511844402, 105.74977710843086), zoom: 15);
|
||||||
Timer? getDeviceDetailTimer;
|
Timer? getDeviceDetailTimer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -118,7 +118,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
ImageConstants.instance.getImage('smoke-detector'),
|
ImageConstants.instance
|
||||||
|
.getImage('smoke-detector'),
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -156,13 +157,14 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
height: context.dynamicHeight(0.08),
|
height: context.dynamicHeight(0.08),
|
||||||
width: context.dynamicWidth(0.5),
|
width: context.dynamicWidth(0.5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: DeviceUtils.instance
|
color: DeviceUtils.instance.getTableRowColor(
|
||||||
.getTableRowColor(context,deviceSnapshot.data?.state ?? 3),
|
context, deviceSnapshot.data?.state ?? 3),
|
||||||
borderRadius: BorderRadius.circular(50),
|
borderRadius: BorderRadius.circular(50),
|
||||||
),
|
),
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: context.mediumValue,
|
height: context.mediumValue,
|
||||||
@@ -170,17 +172,20 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: deviceSnapshot.data?.state == 1
|
child: deviceSnapshot.data?.state == 1
|
||||||
? RippleAnimation(
|
? RippleAnimation(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
delay: context.dynamicMilliSecondDuration(
|
delay: context
|
||||||
|
.dynamicMilliSecondDuration(
|
||||||
800,
|
800,
|
||||||
),
|
),
|
||||||
repeat: true,
|
repeat: true,
|
||||||
minRadius: 10,
|
minRadius: 10,
|
||||||
ripplesCount: 5,
|
ripplesCount: 5,
|
||||||
duration: context.dynamicMilliSecondDuration(
|
duration: context
|
||||||
|
.dynamicMilliSecondDuration(
|
||||||
1800,
|
1800,
|
||||||
),
|
),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor:
|
||||||
|
Colors.transparent,
|
||||||
minRadius: context.mediumValue,
|
minRadius: context.mediumValue,
|
||||||
maxRadius: context.mediumValue,
|
maxRadius: context.mediumValue,
|
||||||
backgroundImage: AssetImage(
|
backgroundImage: AssetImage(
|
||||||
@@ -191,8 +196,10 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: CircleAvatar(
|
: CircleAvatar(
|
||||||
backgroundColor:
|
backgroundColor: DeviceUtils
|
||||||
DeviceUtils.instance.getTableRowColor(context,
|
.instance
|
||||||
|
.getTableRowColor(
|
||||||
|
context,
|
||||||
deviceSnapshot.data?.state ?? 3,
|
deviceSnapshot.data?.state ?? 3,
|
||||||
),
|
),
|
||||||
minRadius: context.mediumValue,
|
minRadius: context.mediumValue,
|
||||||
@@ -237,19 +244,18 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: context.paddingLow,
|
padding: context.paddingLow,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
.paginated_data_table_column_deviceSignal,
|
.paginated_data_table_column_deviceSignal,
|
||||||
style: const TextStyle(
|
style: context
|
||||||
fontSize: 18,
|
.responsiveBodyLargeWithBold),
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: context.dynamicWidth(0.12),
|
height: context.dynamicWidth(0.12),
|
||||||
width: context.dynamicWidth(0.12),
|
width: context.dynamicWidth(0.12),
|
||||||
@@ -259,7 +265,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
sensorSnapshot.data!['sensorCsq'],
|
sensorSnapshot.data!['sensorCsq'],
|
||||||
),
|
),
|
||||||
size: 30,
|
size: 30,
|
||||||
color: DeviceUtils.instance.getSignalIconColor(
|
color: DeviceUtils.instance
|
||||||
|
.getSignalIconColor(
|
||||||
context,
|
context,
|
||||||
sensorSnapshot.data!['sensorCsq'],
|
sensorSnapshot.data!['sensorCsq'],
|
||||||
),
|
),
|
||||||
@@ -268,8 +275,10 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment:
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: context.dynamicHeight(0.09),
|
height: context.dynamicHeight(0.09),
|
||||||
@@ -277,9 +286,11 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
sensorSnapshot.data!['sensorCsq'],
|
sensorSnapshot.data!['sensorCsq'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: DeviceUtils.instance.getSignalIconColor(
|
color: DeviceUtils.instance
|
||||||
|
.getSignalIconColor(
|
||||||
context,
|
context,
|
||||||
sensorSnapshot.data!['sensorCsq'],
|
sensorSnapshot
|
||||||
|
.data!['sensorCsq'],
|
||||||
),
|
),
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
@@ -299,10 +310,12 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: context.paddingLow,
|
padding: context.paddingLow,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
@@ -316,14 +329,18 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
height: context.dynamicWidth(0.12),
|
height: context.dynamicWidth(0.12),
|
||||||
width: context.dynamicWidth(0.12),
|
width: context.dynamicWidth(0.12),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
DeviceUtils.instance.getDeviceBatteryImg(
|
DeviceUtils.instance
|
||||||
|
.getDeviceBatteryImg(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorBattery'],
|
sensorSnapshot
|
||||||
|
.data!['sensorBattery'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
color: DeviceUtils.instance.getDeviceBatteryColor(
|
color: DeviceUtils.instance
|
||||||
|
.getDeviceBatteryColor(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorBattery'],
|
sensorSnapshot
|
||||||
|
.data!['sensorBattery'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -331,18 +348,23 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment:
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: context.dynamicHeight(0.09),
|
height: context.dynamicHeight(0.09),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
sensorSnapshot.data!['sensorBattery'],
|
sensorSnapshot
|
||||||
|
.data!['sensorBattery'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: DeviceUtils.instance.getDeviceBatteryColor(
|
color: DeviceUtils.instance
|
||||||
|
.getDeviceBatteryColor(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorBattery'],
|
sensorSnapshot
|
||||||
|
.data!['sensorBattery'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
fontSize: 50,
|
fontSize: 50,
|
||||||
@@ -360,9 +382,11 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'%',
|
'%',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: DeviceUtils.instance.getDeviceBatteryColor(
|
color: DeviceUtils.instance
|
||||||
|
.getDeviceBatteryColor(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorBattery'],
|
sensorSnapshot
|
||||||
|
.data!['sensorBattery'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
@@ -390,7 +414,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
@@ -405,9 +430,11 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
width: context.dynamicWidth(0.12),
|
width: context.dynamicWidth(0.12),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/icons/temperature.png',
|
'assets/icons/temperature.png',
|
||||||
color: DeviceUtils.instance.getDeviceTempColor(
|
color: DeviceUtils.instance
|
||||||
|
.getDeviceTempColor(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorTemp'],
|
sensorSnapshot
|
||||||
|
.data!['sensorTemp'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -423,20 +450,28 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 20,
|
height: 20,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey.withValues(alpha: 0.3),
|
color: Colors.grey
|
||||||
borderRadius: BorderRadius.circular(10),
|
.withValues(alpha: 0.3),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
LayoutBuilder(
|
LayoutBuilder(
|
||||||
builder: (context, constraints) => Container(
|
builder: (context, constraints) =>
|
||||||
|
Container(
|
||||||
width: constraints.maxWidth *
|
width: constraints.maxWidth *
|
||||||
(int.parse(sensorSnapshot.data!['sensorTemp']) / 75),
|
(int.parse(sensorSnapshot
|
||||||
|
.data!['sensorTemp']) /
|
||||||
|
75),
|
||||||
height: 20,
|
height: 20,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: DeviceUtils.instance.getDeviceTempColor(
|
color: DeviceUtils.instance
|
||||||
int.parse(sensorSnapshot.data!['sensorTemp']),
|
.getDeviceTempColor(
|
||||||
|
int.parse(sensorSnapshot
|
||||||
|
.data!['sensorTemp']),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -446,25 +481,26 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${sensorSnapshot.data!['sensorTemp']} °C",
|
"${sensorSnapshot.data!['sensorTemp']} °C",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: DeviceUtils.instance.getDeviceTempColor(
|
color: DeviceUtils.instance
|
||||||
|
.getDeviceTempColor(
|
||||||
int.parse(
|
int.parse(
|
||||||
sensorSnapshot.data!['sensorTemp'],
|
sensorSnapshot
|
||||||
|
.data!['sensorTemp'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Text(
|
Text(
|
||||||
"75 °C",
|
"75 °C",
|
||||||
style: TextStyle(
|
style: context.responsiveBodyLarge
|
||||||
fontSize: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@@ -480,11 +516,9 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context).paginated_data_table_column_devicePower,
|
appLocalization(context)
|
||||||
style: const TextStyle(
|
.paginated_data_table_column_devicePower,
|
||||||
fontSize: 18,
|
style: context.responsiveBodyLargeWithBold
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: context.dynamicWidth(0.12),
|
height: context.dynamicWidth(0.12),
|
||||||
@@ -504,7 +538,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
stream: detailDeviceBloc.streamSensorTemps,
|
stream: detailDeviceBloc.streamSensorTemps,
|
||||||
builder: (context, sensorTempsSnapshot) {
|
builder: (context, sensorTempsSnapshot) {
|
||||||
if (sensorTempsSnapshot.data == null) {
|
if (sensorTempsSnapshot.data == null) {
|
||||||
detailDeviceBloc.getNearerSensorValue(widget.thingID);
|
detailDeviceBloc
|
||||||
|
.getNearerSensorValue(widget.thingID);
|
||||||
return const AspectRatio(
|
return const AspectRatio(
|
||||||
aspectRatio: 3,
|
aspectRatio: 3,
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -523,7 +558,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
margin: context.paddingLow,
|
margin: context.paddingLow,
|
||||||
child: sharedLineChart(
|
child: sharedLineChart(
|
||||||
appLocalization(context).detail_device_volt_message,
|
appLocalization(context)
|
||||||
|
.detail_device_volt_message,
|
||||||
sensorTempsSnapshot.data ?? [],
|
sensorTempsSnapshot.data ?? [],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -550,33 +586,48 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
Radius.circular(15),
|
Radius.circular(15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: deviceSnapshot.data!.settings!.latitude != ""
|
child: deviceSnapshot
|
||||||
|
.data!.settings!.latitude !=
|
||||||
|
""
|
||||||
? StreamBuilder<String>(
|
? StreamBuilder<String>(
|
||||||
stream: detailDeviceBloc.streamDeviceLocation,
|
stream: detailDeviceBloc
|
||||||
|
.streamDeviceLocation,
|
||||||
builder: (context, locationSnapshot) {
|
builder: (context, locationSnapshot) {
|
||||||
if (locationSnapshot.data == null) {
|
if (locationSnapshot.data == null) {
|
||||||
detailDeviceBloc.findLocation(
|
detailDeviceBloc.findLocation(
|
||||||
context, deviceSnapshot.data!.areaPath!);
|
context,
|
||||||
|
deviceSnapshot
|
||||||
|
.data!.areaPath!);
|
||||||
}
|
}
|
||||||
return GoogleMap(
|
return GoogleMap(
|
||||||
initialCameraPosition: initialCamera,
|
initialCameraPosition:
|
||||||
|
initialCamera,
|
||||||
mapType: MapType.normal,
|
mapType: MapType.normal,
|
||||||
markers: {
|
markers: {
|
||||||
Marker(
|
Marker(
|
||||||
infoWindow: InfoWindow(
|
infoWindow: InfoWindow(
|
||||||
title: locationSnapshot.data ?? "",
|
title:
|
||||||
|
locationSnapshot.data ??
|
||||||
|
"",
|
||||||
),
|
),
|
||||||
markerId: MarkerId(deviceSnapshot.data!.thingId!),
|
markerId: MarkerId(
|
||||||
|
deviceSnapshot
|
||||||
|
.data!.thingId!),
|
||||||
position: LatLng(
|
position: LatLng(
|
||||||
double.parse(
|
double.parse(deviceSnapshot
|
||||||
deviceSnapshot.data!.settings!.latitude!),
|
.data!
|
||||||
double.parse(
|
.settings!
|
||||||
deviceSnapshot.data!.settings!.longitude!),
|
.latitude!),
|
||||||
|
double.parse(deviceSnapshot
|
||||||
|
.data!
|
||||||
|
.settings!
|
||||||
|
.longitude!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
onMapCreated: (mapcontroller) {
|
onMapCreated: (mapcontroller) {
|
||||||
controller.complete(mapcontroller);
|
controller
|
||||||
|
.complete(mapcontroller);
|
||||||
},
|
},
|
||||||
mapToolbarEnabled: false,
|
mapToolbarEnabled: false,
|
||||||
zoomControlsEnabled: false,
|
zoomControlsEnabled: false,
|
||||||
@@ -591,11 +642,9 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context).device_update_location,
|
appLocalization(context)
|
||||||
style: const TextStyle(
|
.device_update_location,
|
||||||
fontSize: 18,
|
style: context.responsiveBodyLargeWithBold
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
.paginated_data_table_title,
|
.paginated_data_table_title,
|
||||||
style: context.headlineMediumTextStyle,
|
style: context.responsiveBodyLargeWithBold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
columns: [
|
columns: [
|
||||||
@@ -190,10 +190,7 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
|
|||||||
SizedBox(height: context.lowValue),
|
SizedBox(height: context.lowValue),
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context).overview_message,
|
appLocalization(context).overview_message,
|
||||||
style: const TextStyle(
|
style: context.responsiveBodyLargeWithBold
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
StreamBuilder<Map<String, List<Device>>>(
|
StreamBuilder<Map<String, List<Device>>>(
|
||||||
stream: devicesManagerBloc.streamDeviceByState,
|
stream: devicesManagerBloc.streamDeviceByState,
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ Future<Widget> notificationCard(BuildContext context, String notiticationType,
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${appLocalization(context).device_title} ${device.isOwner! ? device.name : device.alias}",
|
"${appLocalization(context).device_title} ${device.isOwner! ? device.name : device.alias}",
|
||||||
style: const TextStyle(
|
style: context.responsiveBodyLargeWithBold,
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
@@ -92,7 +89,7 @@ Future<Widget> notificationCard(BuildContext context, String notiticationType,
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
location,
|
location,
|
||||||
style: const TextStyle(fontSize: 15),
|
style: context.responsiveBodySmall,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
@@ -111,7 +108,7 @@ Future<Widget> notificationCard(BuildContext context, String notiticationType,
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
time.toString(),
|
time.toString(),
|
||||||
style: const TextStyle(fontSize: 15),
|
style: context.responsiveBodySmall,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ class OverviewCard extends StatelessWidget {
|
|||||||
isOwner
|
isOwner
|
||||||
? appLocalization(context).overview_message
|
? appLocalization(context).overview_message
|
||||||
: appLocalization(context).interfamily_page_name,
|
: appLocalization(context).interfamily_page_name,
|
||||||
style: const TextStyle(
|
style: context.h2,
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: context.normalValue),
|
SizedBox(height: context.normalValue),
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../product/extension/context_extension.dart';
|
||||||
|
|
||||||
class StatusCard extends StatelessWidget {
|
class StatusCard extends StatelessWidget {
|
||||||
final String label;
|
final String label;
|
||||||
@@ -27,14 +28,8 @@ class StatusCard extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(label, style: const TextStyle(fontSize: 18)),
|
Text(label, style: context.responsiveBodyLarge),
|
||||||
Text(
|
Text(count.toString(), style: context.h2),
|
||||||
count.toString(),
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 24,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -97,10 +97,7 @@ Future<Widget> warningCard(BuildContext context, APIServices apiServices,
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${appLocalization(context).device_title}: ${device.isOwner! ? device.name : device.alias}",
|
"${appLocalization(context).device_title}: ${device.isOwner! ? device.name : device.alias}",
|
||||||
style: const TextStyle(
|
style: context.responsiveBodyLargeWithBold,
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
@@ -128,7 +125,7 @@ Future<Widget> warningCard(BuildContext context, APIServices apiServices,
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
fullLocation,
|
fullLocation,
|
||||||
style: const TextStyle(fontSize: 15),
|
style: context.responsiveBodySmall,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
@@ -147,7 +144,7 @@ Future<Widget> warningCard(BuildContext context, APIServices apiServices,
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
time,
|
time,
|
||||||
style: const TextStyle(fontSize: 15),
|
style: context.responsiveBodySmall,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../product/extension/context_extension.dart';
|
||||||
import '../../../bloc/group_detail_bloc.dart';
|
import '../../../bloc/group_detail_bloc.dart';
|
||||||
import '../../../product/constant/icon/icon_constants.dart';
|
import '../../../product/constant/icon/icon_constants.dart';
|
||||||
import '../../../product/services/language_services.dart';
|
import '../../../product/services/language_services.dart';
|
||||||
@@ -36,7 +37,7 @@ addDeviceDialog(BuildContext context, DetailGroupBloc detailGroupBloc,
|
|||||||
),
|
),
|
||||||
hint: Text(
|
hint: Text(
|
||||||
appLocalization(context).choose_device_dropdownButton,
|
appLocalization(context).choose_device_dropdownButton,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: context.responsiveBodySmall,
|
||||||
),
|
),
|
||||||
items: ownerDevices
|
items: ownerDevices
|
||||||
.map(
|
.map(
|
||||||
@@ -73,7 +74,7 @@ addDeviceDialog(BuildContext context, DetailGroupBloc detailGroupBloc,
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
item.name!,
|
item.name!,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: context.responsiveBodySmall,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -493,10 +493,7 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('${appLocalization(context).map_result}: ',
|
Text('${appLocalization(context).map_result}: ',
|
||||||
style: const TextStyle(
|
style: context.h3),
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.black)),
|
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class _InterFamilyScreenState extends State<InterFamilyScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
drawer: Drawer(
|
drawer: Drawer(
|
||||||
width: context.dynamicWidth(0.4),
|
width: context.dynamicWidth(0.6),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ showDirections(
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
appLocalization(context).map_show_direction,
|
appLocalization(context).map_show_direction,
|
||||||
style: context.titleLargeTextStyle,
|
style: context.responsiveBodyLargeWithBold,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ showNearPlacesSideSheet(
|
|||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${appLocalization(modalBottomSheetContext).map_result}: ',
|
'${appLocalization(modalBottomSheetContext).map_result}: ',
|
||||||
style: const TextStyle(
|
style: context.h3
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -119,10 +116,7 @@ showNearPlacesSideSheet(
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
place.result!.name!,
|
place.result!.name!,
|
||||||
style: const TextStyle(
|
style: context.responsiveBodyMediumWithBold,
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: listViewContext.lowValue),
|
SizedBox(height: listViewContext.lowValue),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class _DeviceNotificationSettingsScreenState
|
|||||||
hint: Text(
|
hint: Text(
|
||||||
appLocalization(context)
|
appLocalization(context)
|
||||||
.choose_device_dropdownButton,
|
.choose_device_dropdownButton,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: context.responsiveBodySmall,
|
||||||
),
|
),
|
||||||
iconStyleData: const IconStyleData(
|
iconStyleData: const IconStyleData(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
getAvatarContent(
|
getAvatarContent(
|
||||||
userSnapshot.data?.username ?? ""),
|
userSnapshot.data?.username ?? ""),
|
||||||
style: const TextStyle(
|
style: context.dynamicResponsiveSize(36),
|
||||||
fontSize: 35,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -76,8 +73,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
userSnapshot.data?.name ?? "User Name",
|
userSnapshot.data?.name ?? "User Name",
|
||||||
style: const TextStyle(
|
style: context.h2,
|
||||||
fontWeight: FontWeight.w900, fontSize: 26),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -132,7 +128,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
leading: IconConstants.instance.getMaterialIcon(icon),
|
leading: IconConstants.instance.getMaterialIcon(icon),
|
||||||
title: Text(
|
title: Text(
|
||||||
content,
|
content,
|
||||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
style: context.responsiveBodyMediumWithBold,
|
||||||
),
|
),
|
||||||
trailing: const Icon(
|
trailing: const Icon(
|
||||||
Icons.arrow_forward_ios_outlined,
|
Icons.arrow_forward_ios_outlined,
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ class RequestPermissionDialog {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"Alow app to use $content permission",
|
"Alow app to use $content permission",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: const TextStyle(
|
style: context.responsiveBodyLargeWithBold,
|
||||||
fontWeight: FontWeight.bold, fontSize: 18),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Divider(height: dialogContext.lowValue),
|
Divider(height: dialogContext.lowValue),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:sfm_app/product/utils/responsive_text_utils.dart';
|
||||||
|
|
||||||
import '../theme/app_theme_light.dart';
|
import '../theme/app_theme_light.dart';
|
||||||
|
|
||||||
@@ -9,33 +10,77 @@ extension ContextExtension on BuildContext {
|
|||||||
MediaQueryData get mediaQuery => MediaQuery.of(this);
|
MediaQueryData get mediaQuery => MediaQuery.of(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension ResponsiveTextStyle on BuildContext {
|
||||||
|
TextStyle get h1 => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 32), fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
TextStyle get h2 => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 24), fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
TextStyle get h3 => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 20), fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
TextStyle get responsiveBodyLarge =>
|
||||||
|
TextStyle(fontSize: ResponsiveText.getSize(this, 18));
|
||||||
|
|
||||||
|
TextStyle get responsiveBodyLargeWithBold => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 18), fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
TextStyle get responsiveBodyMedium =>
|
||||||
|
TextStyle(fontSize: ResponsiveText.getSize(this, 16));
|
||||||
|
|
||||||
|
TextStyle get responsiveBodyMediumWithBold => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 16), fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
TextStyle get responsiveBodySmall =>
|
||||||
|
TextStyle(fontSize: ResponsiveText.getSize(this, 14));
|
||||||
|
|
||||||
|
TextStyle get responsiveBodySmallWithBold => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, 14), fontWeight: FontWeight.bold);
|
||||||
|
TextStyle dynamicResponsiveSize(double val) =>
|
||||||
|
TextStyle(fontSize: ResponsiveText.getSize(this, val));
|
||||||
|
TextStyle dynamicResponsiveSizeWithBold(double val) => TextStyle(
|
||||||
|
fontSize: ResponsiveText.getSize(this, val), fontWeight: FontWeight.bold);
|
||||||
|
}
|
||||||
|
|
||||||
// VALUES
|
// VALUES
|
||||||
extension MediaQueryExtension on BuildContext {
|
extension MediaQueryExtension on BuildContext {
|
||||||
double get height => mediaQuery.size.height;
|
double get height => mediaQuery.size.height;
|
||||||
|
|
||||||
double get width => mediaQuery.size.width;
|
double get width => mediaQuery.size.width;
|
||||||
|
|
||||||
double get lowValue => height * 0.01;
|
double get lowValue => height * 0.01;
|
||||||
|
|
||||||
double get normalValue => height * 0.02;
|
double get normalValue => height * 0.02;
|
||||||
|
|
||||||
double get mediumValue => height * 0.04;
|
double get mediumValue => height * 0.04;
|
||||||
|
|
||||||
double get highValue => height * 0.1;
|
double get highValue => height * 0.1;
|
||||||
|
|
||||||
double dynamicWidth(double val) => width * val;
|
double dynamicWidth(double val) => width * val;
|
||||||
|
|
||||||
double dynamicHeight(double val) => height * val;
|
double dynamicHeight(double val) => height * val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// THEME
|
// THEME
|
||||||
extension ThemeExtension on BuildContext {
|
extension ThemeExtension on BuildContext {
|
||||||
ThemeData get theme => Theme.of(this);
|
ThemeData get theme => Theme.of(this);
|
||||||
|
|
||||||
TextTheme get textTheme => theme.textTheme;
|
TextTheme get textTheme => theme.textTheme;
|
||||||
|
|
||||||
ColorScheme get colors => AppThemeLight.instance.theme.colorScheme;
|
ColorScheme get colors => AppThemeLight.instance.theme.colorScheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PADDING ALLL
|
// PADDING ALLL
|
||||||
extension PaddingExtensionAll on BuildContext {
|
extension PaddingExtensionAll on BuildContext {
|
||||||
EdgeInsets get paddingLow => EdgeInsets.all(lowValue);
|
EdgeInsets get paddingLow => EdgeInsets.all(lowValue);
|
||||||
|
|
||||||
EdgeInsets get paddingNormal => EdgeInsets.all(normalValue);
|
EdgeInsets get paddingNormal => EdgeInsets.all(normalValue);
|
||||||
|
|
||||||
EdgeInsets get paddingMedium => EdgeInsets.all(mediumValue);
|
EdgeInsets get paddingMedium => EdgeInsets.all(mediumValue);
|
||||||
|
|
||||||
EdgeInsets get paddingHigh => EdgeInsets.all(highValue);
|
EdgeInsets get paddingHigh => EdgeInsets.all(highValue);
|
||||||
|
|
||||||
EdgeInsets dynamicPadding(double val) => EdgeInsets.all(val);
|
EdgeInsets dynamicPadding(double val) => EdgeInsets.all(val);
|
||||||
// double dynamicPadding(double val) => height * val;
|
// double dynamicPadding(double val) => height * val;
|
||||||
}
|
}
|
||||||
@@ -44,20 +89,26 @@ extension PaddingExtensionAll on BuildContext {
|
|||||||
extension PaddingExtensionSymetric on BuildContext {
|
extension PaddingExtensionSymetric on BuildContext {
|
||||||
// VERTICAL PADDİNG
|
// VERTICAL PADDİNG
|
||||||
EdgeInsets get paddingLowVertical => EdgeInsets.symmetric(vertical: lowValue);
|
EdgeInsets get paddingLowVertical => EdgeInsets.symmetric(vertical: lowValue);
|
||||||
|
|
||||||
EdgeInsets get paddingNormalVertical =>
|
EdgeInsets get paddingNormalVertical =>
|
||||||
EdgeInsets.symmetric(vertical: normalValue);
|
EdgeInsets.symmetric(vertical: normalValue);
|
||||||
|
|
||||||
EdgeInsets get paddingMediumVertical =>
|
EdgeInsets get paddingMediumVertical =>
|
||||||
EdgeInsets.symmetric(vertical: mediumValue);
|
EdgeInsets.symmetric(vertical: mediumValue);
|
||||||
|
|
||||||
EdgeInsets get paddingHighVertical =>
|
EdgeInsets get paddingHighVertical =>
|
||||||
EdgeInsets.symmetric(vertical: highValue);
|
EdgeInsets.symmetric(vertical: highValue);
|
||||||
|
|
||||||
// HORIZONTAL PADDİNG
|
// HORIZONTAL PADDİNG
|
||||||
EdgeInsets get paddingLowHorizontal =>
|
EdgeInsets get paddingLowHorizontal =>
|
||||||
EdgeInsets.symmetric(horizontal: lowValue);
|
EdgeInsets.symmetric(horizontal: lowValue);
|
||||||
|
|
||||||
EdgeInsets get paddingNormalHorizontal =>
|
EdgeInsets get paddingNormalHorizontal =>
|
||||||
EdgeInsets.symmetric(horizontal: normalValue);
|
EdgeInsets.symmetric(horizontal: normalValue);
|
||||||
|
|
||||||
EdgeInsets get paddingMediumHorizontal =>
|
EdgeInsets get paddingMediumHorizontal =>
|
||||||
EdgeInsets.symmetric(horizontal: mediumValue);
|
EdgeInsets.symmetric(horizontal: mediumValue);
|
||||||
|
|
||||||
EdgeInsets get paddingHighHorizontal =>
|
EdgeInsets get paddingHighHorizontal =>
|
||||||
EdgeInsets.symmetric(horizontal: highValue);
|
EdgeInsets.symmetric(horizontal: highValue);
|
||||||
}
|
}
|
||||||
@@ -70,34 +121,51 @@ extension PageExtension on BuildContext {
|
|||||||
// DURATION
|
// DURATION
|
||||||
extension DurationExtension on BuildContext {
|
extension DurationExtension on BuildContext {
|
||||||
Duration get lowDuration => const Duration(milliseconds: 150);
|
Duration get lowDuration => const Duration(milliseconds: 150);
|
||||||
|
|
||||||
Duration get normalDuration => const Duration(milliseconds: 500);
|
Duration get normalDuration => const Duration(milliseconds: 500);
|
||||||
|
|
||||||
Duration dynamicMilliSecondDuration(int milliseconds) =>
|
Duration dynamicMilliSecondDuration(int milliseconds) =>
|
||||||
Duration(milliseconds: milliseconds);
|
Duration(milliseconds: milliseconds);
|
||||||
|
|
||||||
Duration dynamicMinutesDuration(int minutes) => Duration(minutes: minutes);
|
Duration dynamicMinutesDuration(int minutes) => Duration(minutes: minutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// RADIUS
|
// RADIUS
|
||||||
extension RadiusExtension on BuildContext {
|
extension RadiusExtension on BuildContext {
|
||||||
Radius get lowRadius => Radius.circular(width * 0.02);
|
Radius get lowRadius => Radius.circular(width * 0.02);
|
||||||
|
|
||||||
Radius get normalRadius => Radius.circular(width * 0.05);
|
Radius get normalRadius => Radius.circular(width * 0.05);
|
||||||
|
|
||||||
Radius get highRadius => Radius.circular(width * 0.1);
|
Radius get highRadius => Radius.circular(width * 0.1);
|
||||||
|
|
||||||
Radius dynamicRadius(double radius) => Radius.circular(radius);
|
Radius dynamicRadius(double radius) => Radius.circular(radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension TextStyleExtention on BuildContext {
|
extension TextStyleExtention on BuildContext {
|
||||||
TextStyle get labelSmallTextStyle => Theme.of(this).textTheme.labelSmall!;
|
TextStyle get labelSmallTextStyle => Theme.of(this).textTheme.labelSmall!;
|
||||||
|
|
||||||
TextStyle get labelMediumTextStyle => Theme.of(this).textTheme.labelMedium!;
|
TextStyle get labelMediumTextStyle => Theme.of(this).textTheme.labelMedium!;
|
||||||
|
|
||||||
TextStyle get labelLargeTextStyle => Theme.of(this).textTheme.labelLarge!;
|
TextStyle get labelLargeTextStyle => Theme.of(this).textTheme.labelLarge!;
|
||||||
|
|
||||||
TextStyle get bodySmallTextStyle => Theme.of(this).textTheme.bodySmall!;
|
TextStyle get bodySmallTextStyle => Theme.of(this).textTheme.bodySmall!;
|
||||||
|
|
||||||
TextStyle get bodyMediumTextStyle => Theme.of(this).textTheme.bodyMedium!;
|
TextStyle get bodyMediumTextStyle => Theme.of(this).textTheme.bodyMedium!;
|
||||||
|
|
||||||
TextStyle get bodyLargeTextStyle => Theme.of(this).textTheme.bodyLarge!;
|
TextStyle get bodyLargeTextStyle => Theme.of(this).textTheme.bodyLarge!;
|
||||||
|
|
||||||
TextStyle get titleSmallTextStyle => Theme.of(this).textTheme.titleSmall!;
|
TextStyle get titleSmallTextStyle => Theme.of(this).textTheme.titleSmall!;
|
||||||
|
|
||||||
TextStyle get titleMediumTextStyle => Theme.of(this).textTheme.titleMedium!;
|
TextStyle get titleMediumTextStyle => Theme.of(this).textTheme.titleMedium!;
|
||||||
|
|
||||||
TextStyle get titleLargeTextStyle => Theme.of(this).textTheme.titleLarge!;
|
TextStyle get titleLargeTextStyle => Theme.of(this).textTheme.titleLarge!;
|
||||||
|
|
||||||
TextStyle get headlineSmallTextStyle =>
|
TextStyle get headlineSmallTextStyle =>
|
||||||
Theme.of(this).textTheme.headlineSmall!;
|
Theme.of(this).textTheme.headlineSmall!;
|
||||||
|
|
||||||
TextStyle get headlineMediumTextStyle =>
|
TextStyle get headlineMediumTextStyle =>
|
||||||
Theme.of(this).textTheme.headlineMedium!;
|
Theme.of(this).textTheme.headlineMedium!;
|
||||||
|
|
||||||
TextStyle get headlineLargeTextStyle =>
|
TextStyle get headlineLargeTextStyle =>
|
||||||
Theme.of(this).textTheme.headlineLarge!;
|
Theme.of(this).textTheme.headlineLarge!;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:fl_chart/fl_chart.dart';
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:sfm_app/feature/device_log/device_logs_model.dart';
|
import '../../feature/device_log/device_logs_model.dart';
|
||||||
import 'package:sfm_app/product/utils/date_time_utils.dart';
|
import '../utils/date_time_utils.dart';
|
||||||
|
|
||||||
Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
|
Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
|
||||||
return LineChart(
|
return LineChart(
|
||||||
|
|||||||
10
lib/product/utils/responsive_text_utils.dart
Normal file
10
lib/product/utils/responsive_text_utils.dart
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import '../extension/context_extension.dart';
|
||||||
|
|
||||||
|
class ResponsiveText{
|
||||||
|
static double getSize(BuildContext context, double size){
|
||||||
|
double screenWidth = context.width;
|
||||||
|
double scaleFactor = screenWidth / 375 ;
|
||||||
|
return (size* scaleFactor).clamp(size * 0.8, size * 1.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user