Skip to content

Instantly share code, notes, and snippets.

View austinevick's full-sized avatar
🎯
Focusing

Augustine Victor austinevick

🎯
Focusing
View GitHub Profile
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:location/location.dart';
final landingViewProvider =
StateNotifierProvider<LandingViewModel, bool>((ref) => LandingViewModel());
class LandingViewModel extends StateNotifier<bool> {
LandingViewModel() : super(false);
Future<bool> getUserLocation() async {
@austinevick
austinevick / .dart
Last active September 8, 2022 11:58
final weatherServiceProvider = Provider((ref) => WeatherServiceImpl());
abstract class WeatherService {
Future getWeather(WeatherModel model);
}
class WeatherServiceImpl extends WeatherService {
final _client = Client();
const baseUrl = "https://api.openweathermap.org/data/";
const version = '2.5/';
class WeatherModel {
final double latitude;
final double longitude;
WeatherModel({
required this.latitude,
required this.longitude,
});
}
class WeatherResponseModel {
@austinevick
austinevick / search_and_pop_result.dart
Created August 19, 2022 00:20
A code snippet to search through a list and return result from another page.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
class CreateTransactionPin extends StatefulWidget {
const CreateTransactionPin({Key? key}) : super(key: key);
@override
State<CreateTransactionPin> createState() => _CreateTransactionPinState();
}
class _CreateTransactionPinState extends State<CreateTransactionPin> {
String field1 = '';
String field2 = '';