From 0e820517cbcc6d799cf7f23c7041f3f15b732dc0 Mon Sep 17 00:00:00 2001 From: Hritik Chouhan Date: Thu, 1 Sep 2022 21:47:45 +0200 Subject: Upload Flutter-Navigation app for IVI Flutter Navigation app which Shows current location, Route for destination, search for destination in search bar, turn by turn navigation,duration and distance for destination. Used Mapbox api and Flutter_map plugin and integrated with KUKSA.VAL for current location. Update UI ,Removed unused code and remove hard coded access token. Bug-AGL: SPEC-4548 Signed-off-by: Hritik Chouhan Change-Id: I7314285f7b9cdc6940175758761fcc8615c5ab0e --- lib/provider.dart | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 lib/provider.dart (limited to 'lib/provider.dart') diff --git a/lib/provider.dart b/lib/provider.dart new file mode 100644 index 0000000..228672f --- /dev/null +++ b/lib/provider.dart @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: Apache-2.0 + +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:latlong2/latlong.dart'; + +import 'kuksa/class.dart'; + + +final currlnglatProvider = StateNotifierProvider( + (ref)=> currentLngLat(), +); + +class currentLngLat extends StateNotifier{ + currentLngLat() : super( + LatLng(31.706964,76.933138), + ); + Future update(value) async{ + + state = value; + } + +} + +final destinationlnglatProvider = StateNotifierProvider( + (ref)=> distiLngLat(), +); + +class distiLngLat extends StateNotifier{ + distiLngLat() : super( + LatLng(0,0), + ); + Future update(value) async{ + state = value; + } + +} + +final CurrentAdressProvider = StateNotifierProvider( + (ref)=> currentAdress(), +); + +class currentAdress extends StateNotifier{ + currentAdress() : super( + '' + ); + Future update(value)async{ + state = value; + } +} + +final DestinationAdressProvider = StateNotifierProvider( + (ref)=> destiAdress(), +); + +class destiAdress extends StateNotifier{ + destiAdress() : super( + '' + ); + Future update(value)async{ + state = value; + } +} + +final polylineprovider = StateNotifierProvider>((ref) => PolyLine()); + +class PolyLine extends StateNotifier> { + + PolyLine() : super([]); + void update(List list) { + state = list; + } +} + +final Infoprovider = StateNotifierProvider((ref) => Info()); + +class Info extends StateNotifier { + + Info() : super(initial); + static final info initial = info(Duration: 0, Distance: 0, instruction: ''); + + void update({ + num? Duration, + num? Distance, + String? instruction, + + }){ + state = state.copywith( + Duration: Duration, + Distance: Distance, + instruction: instruction, + ); + + + } +} \ No newline at end of file -- cgit