Skip to content

Instantly share code, notes, and snippets.

View sachin-darde's full-sized avatar

Sachin Darde sachin-darde

View GitHub Profile
import 'package:http/http.dart' as http;
Future<String> getIdToken({bool? force}) async {
// fetch update token
String token = "abc*******"; // we can used saved token
if (force != null && force) {
// If forced we can try to obtain new token
// Eg if we are using firebase we can request toke with it's force method
// Or for customer server we can use our logic to obtain with refreshtoken
token = "new_abc*******";
@sachin-darde
sachin-darde / p1.dart
Last active May 2, 2023 10:43
Statement 1
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
class CountController extends StateNotifier<AsyncValue<int>> {
CountController() : super(const AsyncData<int>(0));
@sachin-darde
sachin-darde / project-1
Last active May 2, 2023 10:37
Problem 1
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
class CountController extends StateNotifier<AsyncValue<int>> {
CountController() : super(const AsyncData<int>(0));