diff options
Diffstat (limited to 'lib/screen/widgets/left_signal.dart')
-rw-r--r-- | lib/screen/widgets/left_signal.dart | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/screen/widgets/left_signal.dart b/lib/screen/widgets/left_signal.dart new file mode 100644 index 0000000..693c762 --- /dev/null +++ b/lib/screen/widgets/left_signal.dart @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0
+
+import 'package:flutter/material.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+
+class LeftSignal extends HookConsumerWidget {
+ final double screenHeight;
+ const LeftSignal({Key? key, required this.screenHeight}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ final animationController = useAnimationController(
+ lowerBound: 0.9,
+ upperBound: 1.1,
+ duration: const Duration(milliseconds: 1000),
+ )..repeat();
+ return AnimatedBuilder(
+ animation: animationController,
+ builder: (context, child) {
+ return Image.asset(
+ "images/left.png",
+ color: Color.lerp(
+ Colors.black,
+ const Color.fromARGB(255, 99, 251, 104),
+ animationController.value.floorToDouble()),
+ width: 0.125 * screenHeight,
+ );
+ });
+ }
+}
|