Skip to content

Commit

Permalink
feat: use Arc component for Lock Widget
Browse files Browse the repository at this point in the history
  • Loading branch information
ses110 committed May 18, 2021
1 parent d9c626f commit 12dba33
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/components/lock_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:device_widgets/components/arc.dart';
import 'package:device_widgets/providers/lock_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
Expand All @@ -6,6 +7,7 @@ class LockWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final lockProvider = Provider.of<LockProvider>(context, listen: true);

return Column(mainAxisAlignment: MainAxisAlignment.start, children: [
Row(
children: <Widget>[
Expand All @@ -19,7 +21,19 @@ class LockWidget extends StatelessWidget {
height: 80,
),
Center(
child: Text("Lock component will go here"),
child: Arc(
centerWidget: Text(
lockProvider.isLocked ? "Locked" : "Unlocked",
style: Theme.of(context).textTheme.headline2,
),
initialValue: 0.0,
onFinalSetPoint: (double value) {
bool setLock = value != 0;
lockProvider.setLockUnlockAction(
lockProvider?.deviceDetail?.id, setLock);
},
maxValue: 1,
),
),
]);
}
Expand Down

0 comments on commit 12dba33

Please sign in to comment.