summaryrefslogtreecommitdiffstats
path: root/lib/Buttons
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-12-24 15:30:10 -0500
committerScott Murray <scott.murray@konsulko.com>2022-12-29 01:22:55 -0500
commitfe23ca5ecdabd698917c4e84915151fc32cb335e (patch)
treee9cad647d01f546107dfa820363a80c48e33c6e2 /lib/Buttons
parent467221c592123125d6439871f02ef5e9ca0fe777 (diff)
Rework temperature controls
Rework the temperature controls to use NumberPicker widgets so they function more like a user would expect. The associated Riverpod providers have been updated to track the temperature value directly, and some minor layout tweaks have also been made. Bug-AGL: SPEC-4644 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I069e0bd53c79d73cc7a60045309efdfeb9409fbc
Diffstat (limited to 'lib/Buttons')
-rw-r--r--lib/Buttons/auto.dart33
1 files changed, 13 insertions, 20 deletions
diff --git a/lib/Buttons/auto.dart b/lib/Buttons/auto.dart
index 536a117..1bdb045 100644
--- a/lib/Buttons/auto.dart
+++ b/lib/Buttons/auto.dart
@@ -21,7 +21,8 @@ class Auto extends ConsumerStatefulWidget {
_AutoState createState() => _AutoState();
}
-class _AutoState extends ConsumerState<Auto> with SingleTickerProviderStateMixin {
+class _AutoState extends ConsumerState<Auto>
+ with SingleTickerProviderStateMixin {
late AnimationController _controller;
late bool isAutoActive;
late Animation<Color?> _colorAnimation;
@@ -39,11 +40,7 @@ class _AutoState extends ConsumerState<Auto> with SingleTickerProviderStateMixin
ColorTween(begin: Colors.lightBlueAccent, end: Colors.green)
.animate(_controller);
- _controller.addListener(() {
-
- });
-
-
+ _controller.addListener(() {});
}
// dismiss the animation when widget exits screen
@@ -62,33 +59,30 @@ class _AutoState extends ConsumerState<Auto> with SingleTickerProviderStateMixin
return InkWell(
child: AnimatedContainer(
constraints: BoxConstraints(
- maxHeight: SizeConfig.screenHeight*0.10,
- maxWidth: SizeConfig.screenWidth*0.15,
+ maxHeight: SizeConfig.screenHeight * 0.10,
+ maxWidth: SizeConfig.screenWidth * 0.15,
),
-
-
decoration: BoxDecoration(
gradient: isAutoActive
? RadialGradient(
- colors: [Colors.black, Colors.lightBlue],
- radius: 2,
- )
+ colors: [Colors.black, Colors.lightBlue],
+ radius: 2,
+ )
: null,
-
-
border: Border.all(
color: Colors.white,
width: 2,
),
- borderRadius: BorderRadius.circular(SizeConfig.safeBlockVertical*2),
+ borderRadius:
+ BorderRadius.circular(SizeConfig.safeBlockVertical * 2),
),
duration: Duration(seconds: 1),
child: AnimatedContainer(
duration: Duration(milliseconds: 100),
- margin: EdgeInsets.all(SizeConfig.blockSizeVertical*2),
+ margin: EdgeInsets.all(SizeConfig.blockSizeVertical * 2),
child: Container(
- width: SizeConfig.screenWidth*0.15,
- height: SizeConfig.screenHeight*0.10,
+ width: SizeConfig.screenWidth * 0.15,
+ height: SizeConfig.screenHeight * 0.10,
child: FittedBox(
fit: BoxFit.fill,
child: Text(
@@ -110,7 +104,6 @@ class _AutoState extends ConsumerState<Auto> with SingleTickerProviderStateMixin
.update(isAutoActive: !isAutoActive);
},
);
-
});
}
}