mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
Bug fixes
This commit is contained in:
@ -32,15 +32,13 @@ class DraggableCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<RoutineBloc, RoutineState>(
|
||||
builder: (context, state) {
|
||||
final deviceFunctions =
|
||||
state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
|
||||
final deviceFunctions = state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
|
||||
|
||||
return Draggable<Map<String, dynamic>>(
|
||||
data: deviceData,
|
||||
feedback: Transform.rotate(
|
||||
angle: -0.1,
|
||||
child:
|
||||
_buildCardContent(context, deviceFunctions, padding: padding),
|
||||
child: _buildCardContent(context, deviceFunctions, padding: padding),
|
||||
),
|
||||
childWhenDragging: _buildGreyContainer(),
|
||||
child: _buildCardContent(context, deviceFunctions, padding: padding),
|
||||
@ -49,8 +47,7 @@ class DraggableCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCardContent(
|
||||
BuildContext context, List<DeviceFunctionData> deviceFunctions,
|
||||
Widget _buildCardContent(BuildContext context, List<DeviceFunctionData> deviceFunctions,
|
||||
{EdgeInsetsGeometry? padding}) {
|
||||
return Stack(
|
||||
children: [
|
||||
@ -79,17 +76,13 @@ class DraggableCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: imagePath.contains('.svg')
|
||||
? SvgPicture.asset(
|
||||
imagePath,
|
||||
child: deviceData['type'] == 'tap_to_run'
|
||||
? Image.memory(
|
||||
base64Decode(deviceData['icon']),
|
||||
)
|
||||
: imagePath.contains('.png')
|
||||
? Image.asset(
|
||||
imagePath,
|
||||
)
|
||||
: Image.memory(
|
||||
base64Decode(imagePath),
|
||||
),
|
||||
: SvgPicture.asset(
|
||||
imagePath,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Padding(
|
||||
@ -152,8 +145,7 @@ class DraggableCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
String _formatFunctionValue(DeviceFunctionData function) {
|
||||
if (function.functionCode == 'temp_set' ||
|
||||
function.functionCode == 'temp_current') {
|
||||
if (function.functionCode == 'temp_set' || function.functionCode == 'temp_current') {
|
||||
return '${(function.value / 10).toStringAsFixed(0)}°C';
|
||||
} else if (function.functionCode.contains('countdown')) {
|
||||
final seconds = function.value.toInt();
|
||||
|
Reference in New Issue
Block a user