mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 04:42:27 +00:00
@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/bloc/setting_bloc_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/bloc/setting_bloc_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/device_icon_type_helper.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/device_management_content.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/remove_device_widget.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/bloc/setting_bloc_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/bloc/setting_bloc_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/device_setting/settings_model/sub_space_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
@ -38,7 +38,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
builder: (context) {
|
||||
return BlocBuilder<SettingDeviceBloc, DeviceSettingsState>(
|
||||
builder: (context, state) {
|
||||
final bloc = context.read<SettingDeviceBloc>();
|
||||
final _bloc = context.read<SettingDeviceBloc>();
|
||||
final iconPath = DeviceIconTypeHelper.getDeviceIconByTypeCode(
|
||||
device.productType);
|
||||
final deviceInfo = state is DeviceSettingsUpdate
|
||||
@ -73,7 +73,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.vividBlue
|
||||
.withValues(alpha: 0.7),
|
||||
.withOpacity(0.7),
|
||||
fontSize: 24),
|
||||
),
|
||||
],
|
||||
@ -87,8 +87,8 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: CircleAvatar(
|
||||
radius: 38,
|
||||
backgroundColor: ColorsManager.grayBorder
|
||||
.withValues(alpha: 0.5),
|
||||
backgroundColor:
|
||||
ColorsManager.grayBorder.withOpacity(0.5),
|
||||
child: CircleAvatar(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
radius: 36,
|
||||
@ -128,14 +128,14 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
fontSize: 16,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
focusNode: bloc.focusNode,
|
||||
controller: bloc.nameController,
|
||||
enabled: bloc.editName,
|
||||
focusNode: _bloc.focusNode,
|
||||
controller: _bloc.nameController,
|
||||
enabled: _bloc.editName,
|
||||
onFieldSubmitted: (value) {
|
||||
bloc.add(const ChangeNameEvent(
|
||||
_bloc.add(const ChangeNameEvent(
|
||||
value: false));
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
border: InputBorder.none,
|
||||
@ -151,11 +151,11 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
height: 25,
|
||||
child: Visibility(
|
||||
visible:
|
||||
bloc.editName != true,
|
||||
_bloc.editName != true,
|
||||
replacement: const SizedBox(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
bloc.add(
|
||||
_bloc.add(
|
||||
const ChangeNameEvent(
|
||||
value: true));
|
||||
},
|
||||
@ -192,14 +192,14 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
deviceInfo: deviceInfo,
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
RemoveDeviceWidget(bloc: bloc),
|
||||
RemoveDeviceWidget(bloc: _bloc),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (state is DeviceSettingsLoading)
|
||||
Positioned.fill(
|
||||
child: ColoredBox(
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
child: Container(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: ColorsManager.primaryColor,
|
||||
|
Reference in New Issue
Block a user