Skip to content

Commit

Permalink
feat: show center lock or unlock icon depending on state
Browse files Browse the repository at this point in the history
  • Loading branch information
ses110 committed May 18, 2021
1 parent 91afcc7 commit a7fdb76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/components/lock_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:device_widgets/assets/traits/device_item_icon.dart';
import 'package:device_widgets/components/arc.dart';
import 'package:device_widgets/providers/lock_provider.dart';
import 'package:flutter/material.dart';
Expand All @@ -22,17 +23,16 @@ class LockWidget extends StatelessWidget {
),
Center(
child: Arc(
centerWidget: Text(
lockProvider.isLocked ? "Locked" : "Unlocked",
style: Theme.of(context).textTheme.headline2,
),
centerWidget: (lockProvider.isLocked)
? DeviceItemIcon.getLockIcon(100)
: DeviceItemIcon.getUnlockIcon(100),
initialValue: 0.0,
onFinalSetPoint: (double value) {
bool setLock = value != 0;
lockProvider.setLockUnlockAction(
lockProvider?.deviceDetail?.id, setLock);
},
maxValue: 1,
maxValue: 1.0,
),
),
]);
Expand Down

0 comments on commit a7fdb76

Please sign in to comment.