chore(deps): upgrade Flutter SDK from 3.10.1 to 3.27.1

- Update Flutter SDK version to 3.27.1
- Update minimum dart SDK version
- Update dependencies to compatible versions
- Fix deprecated method calls
- Run migration for breaking changes
This commit is contained in:
anhtunz
2025-01-05 18:48:11 +07:00
parent 178a00f5ba
commit fb12c44505
30 changed files with 266 additions and 212 deletions

View File

@@ -9,7 +9,7 @@ buildscript {
// START: FlutterFire Configuration // START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.3.15'
// END: FlutterFire Configuration // END: FlutterFire Configuration
classpath 'com.android.tools.build:gradle:7.3.1' classpath 'com.android.tools.build:gradle:8.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
@@ -19,6 +19,17 @@ allprojects {
google() google()
mavenCentral() mavenCentral()
} }
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
} }
rootProject.buildDir = '../build' rootProject.buildDir = '../build'

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip

View File

@@ -149,9 +149,9 @@ class _LoginScreenState extends State<LoginScreen> {
ElevatedButton( ElevatedButton(
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll(Colors.blue), WidgetStatePropertyAll(Colors.blue),
foregroundColor: foregroundColor:
MaterialStatePropertyAll(Colors.white), WidgetStatePropertyAll(Colors.white),
), ),
onPressed: () { onPressed: () {
validate(); validate();

View File

@@ -3,15 +3,15 @@ import 'dart:developer';
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 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:sfm_app/feature/device_log/widgets/tag_widget.dart'; import 'widgets/tag_widget.dart';
import 'package:sfm_app/feature/devices/device_model.dart'; import '../devices/device_model.dart';
import 'package:sfm_app/feature/device_log/device_logs_bloc.dart'; import 'device_logs_bloc.dart';
import 'package:sfm_app/product/constant/icon/icon_constants.dart'; import '../../product/constant/icon/icon_constants.dart';
import 'package:sfm_app/product/extention/context_extention.dart'; import '../../product/extention/context_extention.dart';
import 'package:sfm_app/product/services/language_services.dart'; import '../../product/services/language_services.dart';
import 'package:sfm_app/product/shared/shared_snack_bar.dart'; import '../../product/shared/shared_snack_bar.dart';
import 'package:sfm_app/product/utils/date_time_utils.dart'; import '../../product/utils/date_time_utils.dart';
import 'package:sfm_app/product/utils/device_utils.dart'; import '../../product/utils/device_utils.dart';
import '../../product/base/bloc/base_bloc.dart'; import '../../product/base/bloc/base_bloc.dart';
import 'device_logs_model.dart'; import 'device_logs_model.dart';
@@ -178,10 +178,10 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
Center( Center(
child: TextButton.icon( child: TextButton.icon(
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll( backgroundColor:
Colors.green), WidgetStatePropertyAll(Colors.green),
foregroundColor: MaterialStatePropertyAll( foregroundColor:
Colors.white), WidgetStatePropertyAll(Colors.white),
), ),
onPressed: () { onPressed: () {
if (fromDateApi.isEmpty) { if (fromDateApi.isEmpty) {
@@ -278,7 +278,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
ListTile( ListTile(
subtitle: subtitle:
Text(DeviceUtils.instance.getDeviceSensorsLog(context, sensor)), Text(DeviceUtils.instance.getDeviceSensorsLog(context, sensor)),
leading: leadingList(sensor), // leading: leadingList(sensor),
title: Text( title: Text(
DateTimeUtils.instance DateTimeUtils.instance
.convertCurrentMillisToDateTimeString(sensor.time ?? 0), .convertCurrentMillisToDateTimeString(sensor.time ?? 0),
@@ -310,7 +310,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
content = "Điều khiển"; content = "Điều khiển";
} else { } else {
boxColor = Colors.lightGreen; boxColor = Colors.lightGreen;
content = "Sự kiện"; content = appLocalization(context).event_tag_title;
} }
return TagWidgetShared( return TagWidgetShared(

View File

@@ -59,10 +59,10 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
BoxDecoration boxDecoration = BoxDecoration( BoxDecoration boxDecoration = BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Colors.grey.withOpacity(0.1), color: Colors.grey.withValues(alpha: 0.1),
border: Border.all( border: Border.all(
width: 1, width: 1,
color: Colors.grey.withOpacity(0.6), color: Colors.grey.withValues(alpha: 0.6),
), ),
); );
@@ -439,7 +439,8 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
width: double.infinity, width: double.infinity,
height: 20, height: 20,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.3), color: Colors.grey
.withValues(alpha: 0.3),
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
), ),

View File

@@ -1,4 +1,4 @@
import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart'; import 'package:google_maps_cluster_manager_2/google_maps_cluster_manager_2.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
// class Device { // class Device {

View File

@@ -187,7 +187,7 @@ class _DeviceUpdateScreenState extends State<DeviceUpdateScreen> {
child: IconButton.filled( child: IconButton.filled(
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll( WidgetStatePropertyAll(
Colors Colors
.lightGreen)), .lightGreen)),
// iconSize: 24, // iconSize: 24,
@@ -379,7 +379,7 @@ class _DeviceUpdateScreenState extends State<DeviceUpdateScreen> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
const BorderRadius const BorderRadius
.all( .all(
Radius.circular( Radius.circular(
20)), 20)),
border: Border.all()), border: Border.all()),
@@ -429,11 +429,11 @@ class _DeviceUpdateScreenState extends State<DeviceUpdateScreen> {
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
foregroundColor: foregroundColor:
MaterialStateProperty WidgetStateProperty
.all(Colors .all(Colors
.white), .white),
backgroundColor: backgroundColor:
MaterialStateProperty WidgetStateProperty
.all(Colors .all(Colors
.blue)), .blue)),
onPressed: () async { onPressed: () async {

View File

@@ -51,7 +51,7 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
// backgroundColor: Colors.grey.withOpacity(0.6), // backgroundColor: Colors.grey.withValues(alpha: 0.6),
body: SafeArea( body: SafeArea(
child: StreamBuilder<List<Device>>( child: StreamBuilder<List<Device>>(
stream: devicesManagerBloc.streamAllDevices, stream: devicesManagerBloc.streamAllDevices,
@@ -138,11 +138,10 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
IconButton( IconButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStateProperty.all<Color>( WidgetStateProperty.all<Color>(
Colors.green), Colors.green),
iconColor: iconColor: WidgetStateProperty.all<Color>(
MaterialStateProperty.all<Color>( Colors.white)),
Colors.white)),
onPressed: () { onPressed: () {
ScaffoldMessenger.of(context) ScaffoldMessenger.of(context)
.clearSnackBars(); .clearSnackBars();
@@ -163,7 +162,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: const TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

View File

@@ -113,7 +113,7 @@ Future<Widget> notificationCard(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: OutlinedButton( child: OutlinedButton(
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.blueAccent)), backgroundColor: WidgetStatePropertyAll(Colors.blueAccent)),
onPressed: () {}, onPressed: () {},
child: Text( child: Text(
appLocalization(context).detail_message, appLocalization(context).detail_message,

View File

@@ -15,7 +15,7 @@ class StatusCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: color.withOpacity(0.2), color: color.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
border: Border.all( border: Border.all(
color: color, color: color,

View File

@@ -148,7 +148,7 @@ Future<Widget> warningCard(
iconSize: 25, iconSize: 25,
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStateProperty.all<Color>(Colors.blue[300]!), WidgetStateProperty.all<Color>(Colors.blue[300]!),
), ),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
@@ -164,7 +164,7 @@ Future<Widget> warningCard(
iconSize: 25, iconSize: 25,
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStateProperty.all<Color>(Colors.blue[300]!), WidgetStateProperty.all<Color>(Colors.blue[300]!),
), ),
), ),
SizedBox(width: context.mediumValue), SizedBox(width: context.mediumValue),
@@ -174,7 +174,7 @@ Future<Widget> warningCard(
child: OutlinedButton( child: OutlinedButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll(backgroundColor)), WidgetStatePropertyAll(backgroundColor)),
onPressed: () async { onPressed: () async {
if (message == if (message ==
appLocalization(context).button_fake_fire_message) { appLocalization(context).button_fake_fire_message) {

View File

@@ -335,8 +335,8 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
); );
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.red), backgroundColor: WidgetStatePropertyAll(Colors.red),
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
), ),
child: Text( child: Text(
appLocalization(context).delete_group_title, appLocalization(context).delete_group_title,
@@ -383,7 +383,8 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
child: Text( child: Text(
appLocalization(context) appLocalization(context)
.confirm_button_content, .confirm_button_content,
style: const TextStyle(color: Colors.red), style: const TextStyle(
color: Colors.red),
)) ))
], ],
); );
@@ -391,8 +392,8 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
}); });
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.red), backgroundColor: WidgetStatePropertyAll(Colors.red),
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
), ),
child: Text( child: Text(
appLocalization(context).leave_group_title, appLocalization(context).leave_group_title,
@@ -437,16 +438,19 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
itemCount: devices.length, itemCount: devices.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ListTile( return ListTile(
title: Text(devices[index].alias != "" title: Text(
? devices[index].alias! devices[index].alias != ""
: devices[index].name!,), ? devices[index].alias!
: devices[index].name!,
),
trailing: Text( trailing: Text(
DeviceUtils.instance.checkStateDevice( DeviceUtils.instance.checkStateDevice(
context, devices[index].state!), context, devices[index].state!),
style: TextStyle( style: TextStyle(
color: DeviceUtils.instance color: DeviceUtils.instance.getTableRowColor(
.getTableRowColor( devices[index].state!,
devices[index].state!,),), ),
),
), ),
); );
}, },
@@ -454,7 +458,8 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
), ),
], ],
); );
},), },
),
), ),
); );
} }
@@ -500,8 +505,8 @@ class _DetailGroupScreenState extends State<DetailGroupScreen> {
Center( Center(
child: TextButton( child: TextButton(
style: const ButtonStyle( style: const ButtonStyle(
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
backgroundColor: MaterialStatePropertyAll(Colors.green)), backgroundColor: WidgetStatePropertyAll(Colors.green)),
onPressed: () async { onPressed: () async {
ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).hideCurrentSnackBar();
String alias = aliasController.text; String alias = aliasController.text;

View File

@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@@ -36,74 +38,75 @@ class _GroupsScreenState extends State<GroupsScreen> {
widget.role == ApplicationConstants.PARTICIPANT_GROUP) { widget.role == ApplicationConstants.PARTICIPANT_GROUP) {
interFamilyBloc.getAllGroup(widget.role); interFamilyBloc.getAllGroup(widget.role);
return StreamBuilder<List<Group>>( return StreamBuilder<List<Group>>(
stream: interFamilyBloc.streamCurrentGroups, stream: interFamilyBloc.streamCurrentGroups,
builder: (context, groupsSnapshot) { builder: (context, groupsSnapshot) {
return Scaffold( return Scaffold(
body: groupsSnapshot.data?.isEmpty ?? true body: groupsSnapshot.data?.isEmpty ?? true
? const Center( ? const Center(
child: CircularProgressIndicator(), child: CircularProgressIndicator(),
) )
: ListView.builder( : ListView.builder(
itemCount: groupsSnapshot.data!.length, itemCount: groupsSnapshot.data!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ListTile( return ListTile(
onTap: () { onTap: () {
context.pushNamed(AppRoutes.GROUP_DETAIL.name, context.pushNamed(AppRoutes.GROUP_DETAIL.name,
pathParameters: { pathParameters: {
"groupId": groupsSnapshot.data![index].id! "groupId": groupsSnapshot.data![index].id!
}, },
extra: widget.role); extra: widget.role);
}, },
leading: IconConstants.instance leading: IconConstants.instance
.getMaterialIcon(Icons.diversity_2), .getMaterialIcon(Icons.diversity_2),
title: Text( title: Text(
groupsSnapshot.data![index].name ?? '', groupsSnapshot.data![index].name ?? '',
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
), ),
subtitle: Text( subtitle:
groupsSnapshot.data![index].description ?? ""), Text(groupsSnapshot.data![index].description ?? ""),
trailing: trailing:
widget.role == ApplicationConstants.OWNER_GROUP widget.role == ApplicationConstants.OWNER_GROUP
? PopupMenuButton( ? PopupMenuButton(
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8.0), bottomLeft: Radius.circular(8.0),
bottomRight: Radius.circular(8.0), bottomRight: Radius.circular(8.0),
topLeft: Radius.circular(8.0), topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0), topRight: Radius.circular(8.0),
),
), ),
itemBuilder: (ctx) => [ ),
_buildPopupMenuItem( itemBuilder: (ctx) => [
groupsSnapshot.data![index], _buildPopupMenuItem(
context, groupsSnapshot.data![index],
appLocalization(context) context,
.share_group_title, appLocalization(context)
Icons.share, .share_group_title,
4), Icons.share,
_buildPopupMenuItem( 4),
groupsSnapshot.data![index], _buildPopupMenuItem(
context, groupsSnapshot.data![index],
appLocalization(context) context,
.change_group_infomation_title, appLocalization(context)
Icons.settings_backup_restore, .change_group_infomation_title,
2), Icons.settings_backup_restore,
_buildPopupMenuItem( 2),
groupsSnapshot.data![index], _buildPopupMenuItem(
context, groupsSnapshot.data![index],
appLocalization(context) context,
.delete_group_title, appLocalization(context)
Icons.delete_forever_rounded, .delete_group_title,
3), Icons.delete_forever_rounded,
], 3),
icon: const Icon(Icons.more_horiz), ],
) icon: const Icon(Icons.more_horiz),
: const SizedBox.shrink(), )
); : const SizedBox.shrink(),
}, );
), },
); ),
}); );
},
);
} else { } else {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }

View File

@@ -9,7 +9,7 @@ import 'groups_model.dart';
shareGroup(BuildContext context, Group group) { shareGroup(BuildContext context, Group group) {
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withValues(alpha: 0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
return Material( return Material(
child: Scaffold( child: Scaffold(

View File

@@ -2,8 +2,6 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:sfm_app/product/base/bloc/base_bloc.dart'; import 'package:sfm_app/product/base/bloc/base_bloc.dart';
import 'package:sfm_app/product/constant/enums/app_theme_enums.dart';
import '../bell/bell_model.dart'; import '../bell/bell_model.dart';
class MainBloc extends BlocBase { class MainBloc extends BlocBase {

View File

@@ -5,8 +5,9 @@ import 'dart:developer';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart'; // import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
import 'package:badges/badges.dart' as badges; import 'package:badges/badges.dart' as badges;
import 'package:persistent_bottom_nav_bar/persistent_bottom_nav_bar.dart';
import '../home/home_bloc.dart'; import '../home/home_bloc.dart';
import '../../product/constant/app/app_constants.dart'; import '../../product/constant/app/app_constants.dart';
import '../../product/constant/enums/app_route_enums.dart'; import '../../product/constant/enums/app_route_enums.dart';
@@ -336,11 +337,11 @@ class _MainScreenState extends State<MainScreen> with WidgetsBindingObserver {
controller: controller, controller: controller,
screens: _buildScreens(), screens: _buildScreens(),
items: _navBarsItems(), items: _navBarsItems(),
confineInSafeArea: true, // confineInSafeArea: true,
handleAndroidBackButtonPress: true, handleAndroidBackButtonPress: true,
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
stateManagement: true, stateManagement: true,
hideNavigationBarWhenKeyboardShows: true, // hideNavigationBarWhenKeyboardShows: true,
backgroundColor: backgroundColor:
themeModeSnapshot.data! ? Colors.white : Colors.black, themeModeSnapshot.data! ? Colors.white : Colors.black,
decoration: NavBarDecoration( decoration: NavBarDecoration(
@@ -348,16 +349,16 @@ class _MainScreenState extends State<MainScreen> with WidgetsBindingObserver {
colorBehindNavBar: colorBehindNavBar:
themeModeSnapshot.data! ? Colors.white : Colors.black, themeModeSnapshot.data! ? Colors.white : Colors.black,
), ),
popAllScreensOnTapOfSelectedTab: true, // popAllScreensOnTapOfSelectedTab: true,
itemAnimationProperties: const ItemAnimationProperties( // itemAnimationProperties: const ItemAnimationProperties(
duration: Duration(milliseconds: 200), // duration: Duration(milliseconds: 200),
curve: Curves.bounceInOut, // curve: Curves.bounceInOut,
), // ),
screenTransitionAnimation: const ScreenTransitionAnimation( // screenTransitionAnimation: const ScreenTransitionAnimation(
animateTabTransition: true, // animateTabTransition: true,
curve: Curves.linear, // curve: Curves.linear,
duration: Duration(milliseconds: 200), // duration: Duration(milliseconds: 200),
), // ),
navBarStyle: NavBarStyle.style4, navBarStyle: NavBarStyle.style4,
), ),
); );

View File

@@ -4,7 +4,7 @@ import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart'; import 'package:google_maps_cluster_manager_2/google_maps_cluster_manager_2.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:sfm_app/feature/devices/device_model.dart'; import 'package:sfm_app/feature/devices/device_model.dart';
import 'package:sfm_app/feature/map/map_bloc.dart'; import 'package:sfm_app/feature/map/map_bloc.dart';

View File

@@ -94,8 +94,8 @@ onTapMarker(
); );
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.blue), backgroundColor: WidgetStatePropertyAll(Colors.blue),
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
), ),
child: Row( child: Row(
children: [ children: [
@@ -127,8 +127,8 @@ onTapMarker(
); );
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.pink), backgroundColor: WidgetStatePropertyAll(Colors.pink),
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
), ),
icon: IconConstants.instance icon: IconConstants.instance
.getMaterialIcon(Icons.local_hospital), .getMaterialIcon(Icons.local_hospital),
@@ -156,8 +156,8 @@ onTapMarker(
); );
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.red), backgroundColor: WidgetStatePropertyAll(Colors.red),
foregroundColor: MaterialStatePropertyAll(Colors.white), foregroundColor: WidgetStatePropertyAll(Colors.white),
), ),
icon: IconConstants.instance icon: IconConstants.instance
.getMaterialIcon(Icons.fire_truck_outlined), .getMaterialIcon(Icons.fire_truck_outlined),
@@ -279,7 +279,7 @@ class DeviceSource extends DataTableSource {
String deviceState = String deviceState =
DeviceUtils.instance.checkStateDevice(context, device.state!); DeviceUtils.instance.checkStateDevice(context, device.state!);
return DataRow.byIndex( return DataRow.byIndex(
color: MaterialStatePropertyAll( color: WidgetStatePropertyAll(
DeviceUtils.instance.getTableRowColor(device.state ?? -1), DeviceUtils.instance.getTableRowColor(device.state ?? -1),
), ),
index: index, index: index,

View File

@@ -112,7 +112,7 @@ showDirections(
), ),
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStateProperty.all<Color>(Colors.blue[300]!), WidgetStateProperty.all<Color>(Colors.blue[300]!),
), ),
), ),
], ],

View File

@@ -158,9 +158,9 @@ showNearPlacesSideSheet(
child: ElevatedButton.icon( child: ElevatedButton.icon(
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll(Colors.blue), WidgetStatePropertyAll(Colors.blue),
foregroundColor: foregroundColor:
MaterialStatePropertyAll(Colors.white), WidgetStatePropertyAll(Colors.white),
), ),
onPressed: () async { onPressed: () async {
Navigator.pop(modalBottomSheetContext); Navigator.pop(modalBottomSheetContext);

View File

@@ -221,10 +221,10 @@ class _DeviceNotificationSettingsScreenState
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: backgroundColor:
MaterialStateProperty.all<Color>( WidgetStateProperty.all<Color>(
Colors.green), Colors.green),
foregroundColor: foregroundColor:
MaterialStateProperty.all<Color>( WidgetStateProperty.all<Color>(
Colors.white)), Colors.white)),
onPressed: () async { onPressed: () async {
updateDeviceNotification( updateDeviceNotification(

View File

@@ -238,9 +238,9 @@ changeUserInfomation(
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll(Colors.blue), WidgetStatePropertyAll(Colors.blue),
foregroundColor: foregroundColor:
MaterialStatePropertyAll(Colors.white), WidgetStatePropertyAll(Colors.white),
), ),
child: Text(appLocalization(context) child: Text(appLocalization(context)
.update_button_content), .update_button_content),
@@ -418,9 +418,9 @@ changeUserPassword(BuildContext context, SettingsBloc settingsBloc) {
}, },
style: const ButtonStyle( style: const ButtonStyle(
backgroundColor: backgroundColor:
MaterialStatePropertyAll(Colors.blue), WidgetStatePropertyAll(Colors.blue),
foregroundColor: foregroundColor:
MaterialStatePropertyAll(Colors.white), WidgetStatePropertyAll(Colors.white),
), ),
child: Text(appLocalization(context) child: Text(appLocalization(context)
.update_button_content), .update_button_content),

View File

@@ -1,6 +1,6 @@
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:sfm_app/product/services/theme_services.dart'; import 'product/services/theme_services.dart';
import 'product/services/language_services.dart'; import 'product/services/language_services.dart';
import 'feature/main/main_bloc.dart'; import 'feature/main/main_bloc.dart';
import 'product/base/bloc/base_bloc.dart'; import 'product/base/bloc/base_bloc.dart';

View File

@@ -78,6 +78,7 @@
"choose_date_start_datePicker": "Start from", "choose_date_start_datePicker": "Start from",
"choose_date_end_datePicker": "End", "choose_date_end_datePicker": "End",
"main_no_data": "No data yet.", "main_no_data": "No data yet.",
"event_tag_title": "Event",
"description_NOTUSE3": "This is english language in InterFamily", "description_NOTUSE3": "This is english language in InterFamily",
"interfamily_page_name": "InterFamily", "interfamily_page_name": "InterFamily",
"my_group_title": "My group", "my_group_title": "My group",

View File

@@ -78,6 +78,7 @@
"choose_date_start_datePicker": "Bắt đầu từ", "choose_date_start_datePicker": "Bắt đầu từ",
"choose_date_end_datePicker": "Kết thúc", "choose_date_end_datePicker": "Kết thúc",
"main_no_data": "Chưa có dữ liệu.", "main_no_data": "Chưa có dữ liệu.",
"event_tag_title": "Sự kiện",
"description_NOTUSE3": "This is vietnamese language in InterFamily", "description_NOTUSE3": "This is vietnamese language in InterFamily",
"interfamily_page_name": "Liên gia", "interfamily_page_name": "Liên gia",
"my_group_title": "Group của tôi", "my_group_title": "Group của tôi",

View File

@@ -381,6 +381,4 @@ class APIServices {
.getDataFromServerWithParams(APIPathConstants.DEVICE_LOGS_PATH, params); .getDataFromServerWithParams(APIPathConstants.DEVICE_LOGS_PATH, params);
return body; return body;
} }
} }

View File

@@ -151,7 +151,7 @@ class _NearBySearchSFMState
PlacesAutocompleteResponse subscriptionResponse = PlacesAutocompleteResponse subscriptionResponse =
PlacesAutocompleteResponse.fromJson(response.data); PlacesAutocompleteResponse.fromJson(response.data);
if (text.length == 0) { if (text.isEmpty) {
alPredictions.clear(); alPredictions.clear();
this._overlayEntry!.remove(); this._overlayEntry!.remove();
return; return;

View File

@@ -39,7 +39,7 @@ Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
), ),
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.grey.withOpacity(0.3), tooltipBgColor: Colors.grey.withValues(alpha: 0.3),
getTooltipItems: (List<LineBarSpot> touchedSpots) { getTooltipItems: (List<LineBarSpot> touchedSpots) {
return touchedSpots.map((spot) { return touchedSpots.map((spot) {
final index = spot.x.toInt(); final index = spot.x.toInt();
@@ -55,7 +55,7 @@ Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
), ),
lineBarsData: [ lineBarsData: [
LineChartBarData( LineChartBarData(
color: Colors.green.withOpacity(0.8), color: Colors.green.withValues(alpha: 0.8),
barWidth: 5, barWidth: 5,
curveSmoothness: 0.35, curveSmoothness: 0.35,
spots: sensors spots: sensors
@@ -74,7 +74,7 @@ Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
), ),
belowBarData: BarAreaData( belowBarData: BarAreaData(
show: true, show: true,
color: Colors.green.withOpacity(0.2), color: Colors.green.withValues(alpha: 0.2),
), ),
) )
], ],
@@ -85,7 +85,7 @@ Widget sharedLineChart(String chartName, List<SensorLogs> sensors) {
right: BorderSide.none, right: BorderSide.none,
left: BorderSide.none, left: BorderSide.none,
bottom: BorderSide( bottom: BorderSide(
color: Colors.black.withOpacity(0.7), color: Colors.black.withValues(alpha: 0.7),
), ),
), ),
), ),

View File

@@ -69,10 +69,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.1" version: "1.19.0"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@@ -149,10 +149,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.3"
file: file:
dependency: transitive dependency: transitive
description: description:
@@ -221,18 +221,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flex_color_scheme name: flex_color_scheme
sha256: "659cf59bd5ccaa1e7de9384342be8b666ff10b108ed57a7fd46c122fb8bf6aca" sha256: "09bea5d776f694c5a67f2229f2aa500cc7cce369322dc6500ab01cf9ad1b4e1a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.2.0" version: "8.1.0"
flex_seed_scheme: flex_seed_scheme:
dependency: transitive dependency: transitive
description: description:
name: flex_seed_scheme name: flex_seed_scheme
sha256: "29c12aba221eb8a368a119685371381f8035011d18de5ba277ad11d7dfb8657f" sha256: d3ba3c5c92d2d79d45e94b4c6c71d01fac3c15017da1545880c53864da5dfeb0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.4.0" version: "3.5.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -373,14 +373,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.3.0" version: "6.3.0"
google_maps_cluster_manager: google_maps_cluster_manager_2:
dependency: "direct main" dependency: "direct main"
description: description:
name: google_maps_cluster_manager name: google_maps_cluster_manager_2
sha256: "36e9a4b2d831c470fc85d692a6c9cec70e0f385d578b9697de5f4de347561b83" sha256: acf31c2bcc175c953c4f4085ef3be53d7e592f417106fb2067950e821da4fe75
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.1.0" version: "3.2.0"
google_maps_flutter: google_maps_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -409,10 +409,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: google_maps_flutter_platform_interface name: google_maps_flutter_platform_interface
sha256: "6060779f020638a8eedeb0fb14234818e5fa32ec45a4653d6428ab436e2bbc64" sha256: a951981c22d790848efb9f114f81794945bc5c06bc566238a419a92f110af6cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.3" version: "2.9.5"
google_maps_flutter_web: google_maps_flutter_web:
dependency: transitive dependency: transitive
description: description:
@@ -449,10 +449,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: intl name: intl
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.0" version: "0.19.0"
js: js:
dependency: transitive dependency: transitive
description: description:
@@ -469,6 +469,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.4" version: "0.7.4"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
@@ -497,34 +521,34 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.15" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "0.11.1"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.15.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@@ -589,14 +613,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.3" version: "0.1.3"
persistent_bottom_nav_bar_v2: persistent_bottom_nav_bar:
dependency: "direct main" dependency: "direct main"
description: description:
name: persistent_bottom_nav_bar_v2 name: persistent_bottom_nav_bar
sha256: "2fbaf1e8b18108d8a303304a306d68bcfb78abfd553295f489a8a315dff479e2" sha256: "6aa9b97ced1abd92c90cedd1997d34ea0b35c3ded762ac6063baccc299b0c4c5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.2.8" version: "6.2.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@@ -657,10 +681,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: search_choices name: search_choices
sha256: "10a50815c0190922dadae81cce723266bfc57d134911565c37c96d4527312bde" sha256: "44b0e00b45b72e69ee4e1350e2794134151d2a34ac668f2a7b6049b142d9b642"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.11" version: "2.3.1"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -729,15 +753,15 @@ packages:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.0"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.10.0"
sprintf: sprintf:
dependency: transitive dependency: transitive
description: description:
@@ -750,18 +774,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.12.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@@ -774,10 +798,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.3.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@@ -790,10 +814,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.1" version: "0.7.3"
timezone: timezone:
dependency: transitive dependency: transitive
description: description:
@@ -898,14 +922,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
win32: vm_service:
dependency: transitive dependency: transitive
description: description:
name: win32 name: vm_service
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.9" version: "14.3.0"
win32:
dependency: "direct main"
description:
name: win32
sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29"
url: "https://pub.dev"
source: hosted
version: "5.10.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@@ -923,5 +955,5 @@ packages:
source: hosted source: hosted
version: "6.3.0" version: "6.3.0"
sdks: sdks:
dart: ">=3.0.1 <4.0.0" dart: ">=3.5.0 <4.0.0"
flutter: ">=3.10.0" flutter: ">=3.27.0"

View File

@@ -36,23 +36,25 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
shared_preferences: ^2.2.2 shared_preferences: ^2.2.2
intl: ^0.18.0 intl: ^0.19.0
firebase_core: ^2.24.2 firebase_core: ^2.24.2
firebase_messaging: ^14.7.10 firebase_messaging: ^14.7.10
flutter_local_notifications: ^17.2.4 flutter_local_notifications: ^17.2.4
permission_handler: ^11.0.1 permission_handler: ^11.0.1
app_settings: ^5.1.1 app_settings: ^5.1.1
flex_color_scheme: ^7.2.0 # flex_color_scheme: ^7.2.0
flex_color_scheme: ^8.1.0
go_router: ^13.1.0 go_router: ^13.1.0
http: ^1.1.0 http: ^1.1.0
top_snackbar_flutter: ^3.1.0 top_snackbar_flutter: ^3.1.0
badges: ^3.1.2 badges: ^3.1.2
google_maps_cluster_manager: ^3.1.0 # google_maps_cluster_manager: ^3.1.0
google_maps_cluster_manager_2: ^3.2.0
google_maps_flutter: ^2.5.0 google_maps_flutter: ^2.5.0
dropdown_button2: ^2.3.9 dropdown_button2: ^2.3.9
maps_launcher: ^2.2.1 maps_launcher: ^2.2.1
flutter_barcode_scanner: ^2.0.0 flutter_barcode_scanner: ^2.0.0
search_choices: ^2.2.11 search_choices: ^2.3.1
dio: ^5.7.0 dio: ^5.7.0
rxdart: ^0.28.0 rxdart: ^0.28.0
geolocator: ^11.1.0 geolocator: ^11.1.0
@@ -60,7 +62,9 @@ dependencies:
flutter_polyline_points: ^2.0.0 flutter_polyline_points: ^2.0.0
simple_ripple_animation: ^0.1.0 simple_ripple_animation: ^0.1.0
fl_chart: ^0.64.0 fl_chart: ^0.64.0
persistent_bottom_nav_bar_v2: ^4.2.8 # persistent_bottom_nav_bar_v2: ^4.2.8
persistent_bottom_nav_bar: ^6.2.1
win32: ^5.10.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: