diff --git a/README.md b/README.md index e6fef581..745fe6f0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # syncrow_web -A new Flutter project. - ## Getting Started This project is a starting point for a Flutter application. diff --git a/lib/pages/common/buttons/default_button.dart b/lib/pages/common/buttons/default_button.dart index 77eb9bd7..4ff89d74 100644 --- a/lib/pages/common/buttons/default_button.dart +++ b/lib/pages/common/buttons/default_button.dart @@ -42,39 +42,36 @@ class DefaultButton extends StatelessWidget { ? null : customButtonStyle ?? ButtonStyle( - textStyle: MaterialStateProperty.all( + textStyle: WidgetStateProperty.all( customTextStyle ?? Theme.of(context).textTheme.bodySmall!.copyWith( - fontSize: 13, - color: foregroundColor, - fontWeight: FontWeight.normal), + fontSize: 13, color: foregroundColor, fontWeight: FontWeight.normal), ), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( isSecondary ? Colors.black : enabled ? foregroundColor ?? Colors.white : Colors.black, ), - backgroundColor: MaterialStateProperty.resolveWith( - (Set states) { + backgroundColor: WidgetStateProperty.resolveWith((Set states) { return enabled ? backgroundColor ?? ColorsManager.primaryColor : Colors.black.withOpacity(0.2); }), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( side: BorderSide(color: borderColor ?? Colors.transparent), borderRadius: BorderRadius.circular(borderRadius ?? 20), ), ), - fixedSize: MaterialStateProperty.all( + fixedSize: WidgetStateProperty.all( const Size.fromHeight(50), ), - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( EdgeInsets.all(padding ?? 10), ), - minimumSize: MaterialStateProperty.all( + minimumSize: WidgetStateProperty.all( const Size.fromHeight(50), ), ), diff --git a/lib/pages/device_managment/all_devices/widgets/device_managment_body.dart b/lib/pages/device_managment/all_devices/widgets/device_managment_body.dart index 884927e4..55e4e291 100644 --- a/lib/pages/device_managment/all_devices/widgets/device_managment_body.dart +++ b/lib/pages/device_managment/all_devices/widgets/device_managment_body.dart @@ -37,8 +37,8 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { offlineCount = state.offlineCount; lowBatteryCount = state.lowBatteryCount; isControlButtonEnabled = state.isControlButtonEnabled; - selectedDevices = state.selectedDevice ?? - context.read().selectedDevices; + selectedDevices = + state.selectedDevice ?? context.read().selectedDevices; } else if (state is DeviceManagementFiltered) { devicesToShow = state.filteredDevices; selectedIndex = state.selectedIndex; @@ -46,8 +46,8 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { offlineCount = state.offlineCount; lowBatteryCount = state.lowBatteryCount; isControlButtonEnabled = state.isControlButtonEnabled; - selectedDevices = state.selectedDevice ?? - context.read().selectedDevices; + selectedDevices = + state.selectedDevice ?? context.read().selectedDevices; } else if (state is DeviceManagementInitial) { devicesToShow = []; selectedIndex = 0; @@ -61,15 +61,13 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { 'Low Battery ($lowBatteryCount)', ]; - final buttonLabel = - (selectedDevices.length > 1) ? 'Batch Control' : 'Control'; + final buttonLabel = (selectedDevices.length > 1) ? 'Batch Control' : 'Control'; return Column( children: [ Container( - padding: isLargeScreenSize(context) - ? const EdgeInsets.all(30) - : const EdgeInsets.all(15), + padding: + isLargeScreenSize(context) ? const EdgeInsets.all(30) : const EdgeInsets.all(15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -78,9 +76,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { tabs: tabs, selectedIndex: selectedIndex, onTabChanged: (index) { - context - .read() - .add(SelectedFilterChanged(index)); + context.read().add(SelectedFilterChanged(index)); }, ), const SizedBox(height: 20), @@ -88,7 +84,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { const SizedBox(height: 12), Container( height: 45, - width: 100, + width: 125, decoration: containerDecoration, child: Center( child: DefaultButton( @@ -102,14 +98,12 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { ), ); } else if (selectedDevices.length > 1) { - final productTypes = selectedDevices - .map((device) => device.productType) - .toSet(); + final productTypes = + selectedDevices.map((device) => device.productType).toSet(); if (productTypes.length == 1) { showDialog( context: context, - builder: (context) => - DeviceBatchControlDialog( + builder: (context) => DeviceBatchControlDialog( devices: selectedDevices, ), ); @@ -123,9 +117,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { textAlign: TextAlign.center, style: TextStyle( fontSize: 12, - color: isControlButtonEnabled - ? Colors.white - : Colors.grey, + color: isControlButtonEnabled ? Colors.white : Colors.grey, ), ), ), @@ -144,9 +136,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { cellDecoration: containerDecoration, onRowSelected: (index, isSelected, row) { final selectedDevice = devicesToShow[index]; - context - .read() - .add(SelectDevice(selectedDevice)); + context.read().add(SelectDevice(selectedDevice)); }, withCheckBox: true, size: context.screenSize, @@ -169,20 +159,16 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout { device.uuid ?? '', device.unit?.name ?? '', device.room?.name ?? '', - device.batteryLevel != null - ? '${device.batteryLevel}%' - : '-', - formatDateTime(DateTime.fromMillisecondsSinceEpoch( - (device.createTime ?? 0) * 1000)), + device.batteryLevel != null ? '${device.batteryLevel}%' : '-', + formatDateTime( + DateTime.fromMillisecondsSinceEpoch((device.createTime ?? 0) * 1000)), device.online == true ? 'Online' : 'Offline', - formatDateTime(DateTime.fromMillisecondsSinceEpoch( - (device.updateTime ?? 0) * 1000)), + formatDateTime( + DateTime.fromMillisecondsSinceEpoch((device.updateTime ?? 0) * 1000)), ]; }).toList(), onSelectionChanged: (selectedRows) { - context - .read() - .add(UpdateSelection(selectedRows)); + context.read().add(UpdateSelection(selectedRows)); }, initialSelectedIds: context .read() diff --git a/pubspec.yaml b/pubspec.yaml index 8b327340..dfeb1ff9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: syncrow_web -description: "A new Flutter project." +description: "Smart Home Solutions" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev diff --git a/web/favicon.png b/web/favicon.png index 8aaa46ac..7bf7ebbf 100644 Binary files a/web/favicon.png and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png index b749bfef..5170aa47 100644 Binary files a/web/icons/Icon-192.png and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png index 88cfd48d..c58953df 100644 Binary files a/web/icons/Icon-512.png and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png index eb9b4d76..5170aa47 100644 Binary files a/web/icons/Icon-maskable-192.png and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png index d69c5669..c58953df 100644 Binary files a/web/icons/Icon-maskable-512.png and b/web/icons/Icon-maskable-512.png differ diff --git a/web/index.html b/web/index.html index b3fc8dfc..a8b2aa25 100644 --- a/web/index.html +++ b/web/index.html @@ -18,7 +18,7 @@ - + diff --git a/web/manifest.json b/web/manifest.json index dc91e8ad..b037b66b 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -5,7 +5,7 @@ "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", - "description": "A new Flutter project.", + "description": "Smart Home Solutions", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [