summaryrefslogtreecommitdiffstats
path: root/lib/presentation/screens/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'lib/presentation/screens/dashboard')
-rw-r--r--lib/presentation/screens/dashboard/widgets/dashboard_content.dart1
-rw-r--r--lib/presentation/screens/dashboard/widgets/hybrid/hybrid.dart16
-rw-r--r--lib/presentation/screens/dashboard/widgets/hybrid_mode.dart3
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/presentation/screens/dashboard/widgets/dashboard_content.dart b/lib/presentation/screens/dashboard/widgets/dashboard_content.dart
index 28cf944..7e4c469 100644
--- a/lib/presentation/screens/dashboard/widgets/dashboard_content.dart
+++ b/lib/presentation/screens/dashboard/widgets/dashboard_content.dart
@@ -39,6 +39,7 @@ class DashBoardState extends ConsumerState<DashBoard>
});
}
+ bool randomHybridAnimation = ref.read(appConfigProvider).randomHybridAnimation;
if (randomHybridAnimation) {
timer = Timer.periodic(const Duration(seconds: 5), (timer) {
Random random = Random();
diff --git a/lib/presentation/screens/dashboard/widgets/hybrid/hybrid.dart b/lib/presentation/screens/dashboard/widgets/hybrid/hybrid.dart
index 6badf62..24eabd6 100644
--- a/lib/presentation/screens/dashboard/widgets/hybrid/hybrid.dart
+++ b/lib/presentation/screens/dashboard/widgets/hybrid/hybrid.dart
@@ -1,7 +1,7 @@
import 'package:flutter_ics_homescreen/export.dart';
-class HybridBackround extends StatelessWidget {
- const HybridBackround({
+class HybridBackground extends StatelessWidget {
+ const HybridBackground({
super.key,
});
@@ -21,9 +21,9 @@ class TopArrow extends StatelessWidget {
return Align(
alignment: const Alignment(0, -0.75),
child: Consumer(builder: (context, ref, child) {
- final state = ref.watch(hybridStateProvider.select((hybrid) => hybrid));
+ final arrowState = ref.watch(hybridStateProvider.select((hybrid) => hybrid.topArrowState));
Widget? widget;
- switch (state.topArrowState) {
+ switch (arrowState) {
case ArrowState.blue:
widget = SvgPicture.asset(
'animations/hybrid_model/top_blue.svg',
@@ -56,9 +56,9 @@ class LeftArrow extends StatelessWidget {
return Align(
alignment: const Alignment(-0.7, 0.5),
child: Consumer(builder: (context, ref, child) {
- final state = ref.watch(hybridStateProvider.select((hybrid) => hybrid));
+ final arrowState = ref.watch(hybridStateProvider.select((hybrid) => hybrid.leftArrowState));
Widget? widget;
- switch (state.leftArrowState) {
+ switch (arrowState) {
case ArrowState.blue:
widget = SvgPicture.asset(
'animations/hybrid_model/left_blue.svg',
@@ -92,10 +92,10 @@ class RightArrow extends StatelessWidget {
return Align(
alignment: const Alignment(0.70, 0.5),
child: Consumer(builder: (context, ref, child) {
- final state = ref.watch(hybridStateProvider.select((hybrid) => hybrid));
+ final arrowState = ref.watch(hybridStateProvider.select((hybrid) => hybrid.rightArrowState));
Widget? widget;
- switch (state.rightArrowState) {
+ switch (arrowState) {
case ArrowState.blue:
widget = SvgPicture.asset(
'animations/hybrid_model/right_blue.svg',
diff --git a/lib/presentation/screens/dashboard/widgets/hybrid_mode.dart b/lib/presentation/screens/dashboard/widgets/hybrid_mode.dart
index f5f1286..01fb981 100644
--- a/lib/presentation/screens/dashboard/widgets/hybrid_mode.dart
+++ b/lib/presentation/screens/dashboard/widgets/hybrid_mode.dart
@@ -11,6 +11,7 @@ class HybridModelState extends ConsumerState<HybridModel> {
@override
Widget build(BuildContext context) {
+ bool randomHybridAnimation = ref.watch(appConfigProvider).randomHybridAnimation;
if (!randomHybridAnimation) {
ref.listen<Vehicle>(vehicleProvider, (Vehicle? previous, Vehicle next) {
ref.watch(hybridStateProvider.notifier).updateHybridState(
@@ -25,7 +26,7 @@ class HybridModelState extends ConsumerState<HybridModel> {
height: 500,
child: Stack(
children: [
- HybridBackround(),
+ HybridBackground(),
TopArrow(),
LeftArrow(),
RightArrow(),