Compare commits

..

14 Commits

Author SHA1 Message Date
7109f3712a Update pr-check.yml 2025-06-12 14:50:50 +03:00
88480142e1 Very good analysis (#245)
<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Description

Migrated lints to use `very_good_analysis`.

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [x] 🗑️ Chore
2025-06-12 14:39:46 +03:00
e867c29086 use very_good_analysis lints. 2025-06-12 14:31:08 +03:00
a3b427c570 fix the save button by removing deleted items from spaces then return… (#244)
… all other elements status to unchanged

<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Jira Ticket

[SP-1735](https://syncrow.atlassian.net/browse/SP-1735?atlOrigin=eyJpIjoiZTI5OTQ5NzNkYWIyNDQ5OTg5YWFkYjRhMTg5NmYxMDkiLCJwIjoiamlyYS1zbGFjay1pbnQifQ)

## Description

now whenever u save then save button vanish until u make another chages

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore 


[SP-1735]:
https://syncrow.atlassian.net/browse/SP-1735?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2025-06-12 14:27:06 +03:00
0b0e235f26 fix the save button by removing deleted items from spaces then return all other elements status to unchanged 2025-06-12 14:13:25 +03:00
c250fb4469 Sp 1702 fe when we click on edit button for a space and click ok without editing the save button is appearing (#243)
<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Jira Ticket
[sp:1702 fix Bug](https://syncrow.atlassian.net/browse/SP-1702)

## Description

fix the issue when nothing edited save button not appears
## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore
2025-06-11 16:58:34 +03:00
59ac1bd74d Disable tap action on Community Structure when in specific states (#242)
<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->


## Description

<!--- Describe your changes in detail -->
Disable tap action on Community Structure when in specific states
## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore
2025-06-11 16:48:10 +03:00
bac1450c2b User can't Add a space if he adds a device with a tag manually/1689 (#240)
<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Jira Ticket

(https://syncrow.atlassian.net/browse/SP-0000)](https://syncrow.atlassian.net/browse/SP-1689)](https://syncrow.atlassian.net/browse/SP-1689)

## Description

when adding device and assign new manual tag (without uuid) ok button
doesnt response

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore
2025-06-11 16:47:15 +03:00
889461db7d Enhance device management UI with improved padding and SVG icon integ… (#241)
…ration

<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->



## Description

<!--- Describe your changes in detail -->

Enhance device setting ui 

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore
2025-06-11 16:47:00 +03:00
27dbcb26f1 use function to fix bug 2025-06-11 16:35:34 +03:00
0c5db9dfeb add bool function to space model if no changes made on object 2025-06-11 16:35:19 +03:00
1393a15eca Disable tap action on Community Structure when in specific states 2025-06-11 16:02:40 +03:00
cd6bf32aed fix bug /non uuid assign tag to be accepted 2025-06-11 14:00:15 +03:00
f7f3843fa7 Enhance device management UI with improved padding and SVG icon integration 2025-06-10 16:29:14 +03:00
11 changed files with 157 additions and 111 deletions

View File

@ -20,7 +20,7 @@ jobs:
- name: Set up Flutter - name: Set up Flutter
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
flutter-version: '3.27.3' flutter-version: '3.32.1'
- name: Install dependencies - name: Install dependencies
run: flutter pub get run: flutter pub get

View File

@ -1,33 +1,27 @@
# This file configures the analyzer, which statically analyzes Dart code to include: package:very_good_analysis/analysis_options.yaml
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer: analyzer:
errors: errors:
constant_identifier_names: ignore strict_raw_type: warning
overridden_fields: ignore argument_type_not_assignable: warning
include: package:flutter_lints/flutter.yaml invalid_assignment: warning
return_of_invalid_type: warning
return_of_invalid_type_from_closure: warning
list_element_type_not_assignable: warning
for_in_of_invalid_type: warning
cast_nullable_to_non_nullable: warning
non_bool_condition: warning
field_initializer_not_assignable: warning
non_bool_negation_expression: warning
non_bool_operand: warning
linter: linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules: rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule prefer_single_quotes: true
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule avoid_print: false
prefer_const_constructors: true public_member_api_docs: false
sort_pub_dependencies: false
# Additional information about this file can be found at one_member_abstracts: false
# https://dart.dev/guides/language/analysis-options prefer_int_literals: false
sort_constructors_first: false
avoid_redundant_argument_values: false

View File

@ -1,10 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/pages/device_managment/device_setting/settings_model/device_info_model.dart'; import 'package:syncrow_web/pages/device_managment/device_setting/settings_model/device_info_model.dart';
import 'package:syncrow_web/pages/device_managment/device_setting/settings_model/sub_space_model.dart'; import 'package:syncrow_web/pages/device_managment/device_setting/settings_model/sub_space_model.dart';
import 'package:syncrow_web/pages/device_managment/device_setting/sub_space_dialog.dart'; import 'package:syncrow_web/pages/device_managment/device_setting/sub_space_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/web_layout/default_container.dart'; import 'package:syncrow_web/web_layout/default_container.dart';
@ -28,7 +30,7 @@ class DeviceManagementContent extends StatelessWidget {
Widget? trailing, Widget? trailing,
required Color? valueColor}) { required Color? valueColor}) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 6.0), padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -39,6 +41,7 @@ class DeviceManagementContent extends StatelessWidget {
color: ColorsManager.grayColor, color: ColorsManager.grayColor,
), ),
), ),
const SizedBox(width: 15),
Expanded( Expanded(
child: Text( child: Text(
value, value,
@ -48,7 +51,7 @@ class DeviceManagementContent extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 12),
trailing ?? const SizedBox.shrink(), trailing ?? const SizedBox.shrink(),
], ],
), ),
@ -73,15 +76,15 @@ class DeviceManagementContent extends StatelessWidget {
); );
}, },
child: infoRow( child: infoRow(
label: 'Sub-Space:', label: 'Sub-Space:',
value: deviceInfo.subspace.subspaceName, value: deviceInfo.subspace.subspaceName,
valueColor: ColorsManager.textGray, valueColor: ColorsManager.blackColor,
trailing: const Icon( trailing: SvgPicture.asset(
Icons.arrow_forward_ios, Assets.arrowDown,
size: 16, width: 10,
color: ColorsManager.greyColor, height: 10,
), color: ColorsManager.greyColor,
), )),
), ),
), ),
const Divider(color: ColorsManager.dividerColor), const Divider(color: ColorsManager.dividerColor),
@ -104,7 +107,7 @@ class DeviceManagementContent extends StatelessWidget {
}, },
child: const Icon( child: const Icon(
Icons.copy, Icons.copy,
size: 16, size: 15,
color: ColorsManager.greyColor, color: ColorsManager.greyColor,
), ),
), ),

View File

@ -51,8 +51,7 @@ class DeviceSettingsPanel extends StatelessWidget {
Container( Container(
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.3,
color: ColorsManager.grey25, color: ColorsManager.grey25,
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(10),
horizontal: 20, vertical: 24),
child: ListView( child: ListView(
children: [ children: [
Row( Row(
@ -70,37 +69,43 @@ class DeviceSettingsPanel extends StatelessWidget {
children: [ children: [
Text( Text(
'Device Settings', 'Device Settings',
style: style: context.theme.textTheme.titleLarge!
context.theme.textTheme.titleLarge!.copyWith( .copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.w700,
color: ColorsManager.primaryColor, color: ColorsManager.vividBlue
), .withOpacity(0.7),
fontSize: 24),
), ),
], ],
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
DefaultContainer( DefaultContainer(
borderRadius: BorderRadius.circular(15),
child: Row( child: Row(
children: [ children: [
CircleAvatar( Padding(
radius: 40, padding: const EdgeInsets.only(left: 15),
backgroundColor:
const Color.fromARGB(177, 213, 213, 213),
child: CircleAvatar( child: CircleAvatar(
backgroundColor: ColorsManager.whiteColors, radius: 38,
radius: 36, backgroundColor:
child: SvgPicture.asset( ColorsManager.grayBorder.withOpacity(0.5),
iconPath, child: CircleAvatar(
fit: BoxFit.cover, backgroundColor: ColorsManager.whiteColors,
radius: 36,
child: SvgPicture.asset(
iconPath,
fit: BoxFit.cover,
),
), ),
), ),
), ),
const SizedBox(width: 12), const SizedBox(width: 25),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const SizedBox(height: 15),
Text( Text(
'Device Name:', 'Device Name:',
style: context.textTheme.bodyMedium! style: context.textTheme.bodyMedium!
@ -108,50 +113,79 @@ class DeviceSettingsPanel extends StatelessWidget {
color: ColorsManager.grayColor, color: ColorsManager.grayColor,
), ),
), ),
TextFormField( SizedBox(
maxLength: 30, height: 35,
style: const TextStyle( child: Row(
color: ColorsManager.blackColor, children: [
), SizedBox(
textAlign: TextAlign.start, height: 50,
focusNode: _bloc.focusNode, width: 190,
controller: _bloc.nameController, child: TextFormField(
enabled: _bloc.editName, scrollPadding: EdgeInsets.zero,
onFieldSubmitted: (value) { maxLength: 30,
_bloc.add(const ChangeNameEvent( style: const TextStyle(
value: false)); color: ColorsManager.blackColor,
}, fontSize: 16,
decoration: const InputDecoration( ),
border: InputBorder.none, textAlign: TextAlign.start,
fillColor: Colors.white10, focusNode: _bloc.focusNode,
counterText: '', controller: _bloc.nameController,
enabled: _bloc.editName,
onFieldSubmitted: (value) {
_bloc.add(const ChangeNameEvent(
value: false));
},
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
fillColor: Colors.white10,
counterText: '',
),
),
),
Column(
children: [
SizedBox(
width: 15,
height: 25,
child: Visibility(
visible:
_bloc.editName != true,
replacement: const SizedBox(),
child: InkWell(
onTap: () {
_bloc.add(
const ChangeNameEvent(
value: true));
},
child: SvgPicture.asset(
Assets
.editNameIconSettings,
color: ColorsManager
.lightGrayBorderColor,
height: 15,
width: 15,
),
),
),
),
],
),
],
), ),
), ),
], ],
), ),
), ),
const SizedBox(width: 8),
Visibility(
visible: _bloc.editName != true,
replacement: const SizedBox(),
child: GestureDetector(
onTap: () {
_bloc.add(
const ChangeNameEvent(value: true));
},
child: SvgPicture.asset(
Assets.editNameIconSettings,
color: ColorsManager.grayColor,
height: 20,
width: 20,
),
),
)
], ],
), ),
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
Text('Device Management', style: sectionTitle), Padding(
padding: const EdgeInsets.only(left: 10),
child: Text('Device Management', style: sectionTitle),
),
DeviceManagementContent( DeviceManagementContent(
device: device, device: device,
subSpaces: subSpaces.cast<SubSpaceModel>(), subSpaces: subSpaces.cast<SubSpaceModel>(),

View File

@ -491,6 +491,12 @@ class SpaceManagementBloc
event.communityUuid, event.communityUuid,
emit, emit,
); );
event.spaces.removeWhere(
(space) => space.status == SpaceStatus.deleted,
);
event.spaces.forEach(
(space) => space.status = SpaceStatus.unchanged,
);
} }
} catch (e) { } catch (e) {
// emit(SpaceManagementError('Error saving spaces: $e')); // emit(SpaceManagementError('Error saving spaces: $e'));

View File

@ -171,4 +171,13 @@ extension SpaceExtensions on SpaceModel {
return tagValues; return tagValues;
} }
bool isNoChangesSubmited(String name, icon, SpaceTemplateModel? spaceModel,
List<SubspaceModel>? subspaces, List<Tag>? tags) {
return (name == this.name &&
icon == this.icon &&
spaceModel == this.spaceModel &&
subspaces == this.subspaces &&
tags == this.tags);
}
} }

View File

@ -384,6 +384,15 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
SpaceTemplateModel? spaceModel, SpaceTemplateModel? spaceModel,
List<SubspaceModel>? subspaces, List<SubspaceModel>? subspaces,
List<Tag>? tags) { List<Tag>? tags) {
if (widget.selectedSpace!.isNoChangesSubmited(
name,
icon,
spaceModel,
subspaces,
tags,
)) {
return;
}
setState(() { setState(() {
// Update the space's properties // Update the space's properties
widget.selectedSpace!.name = name; widget.selectedSpace!.name = name;

View File

@ -302,13 +302,6 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
? enteredName ? enteredName
: (widget.name ?? ''); : (widget.name ?? '');
if (newName.isNotEmpty) { if (newName.isNotEmpty) {
if (tags != null && tags!.isNotEmpty) {
if (tags!.any(
(tag) => tag.uuid == null || tag.uuid!.isEmpty,
)) {
return;
}
}
widget.onCreateSpace( widget.onCreateSpace(
newName, newName,
selectedIcon, selectedIcon,

View File

@ -30,11 +30,14 @@ class CenterBodyWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: state is CommunityStructureState ||
context state is CommunitySelectedState
.read<CenterBodyBloc>() ? null
.add(CommunityStructureSelectedEvent()); : () {
}, context
.read<CenterBodyBloc>()
.add(CommunityStructureSelectedEvent());
},
child: Text( child: Text(
'Community Structure', 'Community Structure',
style: Theme.of(context).textTheme.bodyLarge!.copyWith( style: Theme.of(context).textTheme.bodyLarge!.copyWith(

View File

@ -15,7 +15,7 @@ import shared_preferences_foundation
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin")) FirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FirebaseAnalyticsPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin")) FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin"))

View File

@ -69,12 +69,7 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to very_good_analysis: ^9.0.0
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec