Skip to content

Instantly share code, notes, and snippets.

@vidarrrr
vidarrrr / project_network_manager.dart
Created October 13, 2022 09:44
Singleton Dio - ProjectNetworkManager
import 'package:dio/dio.dart';
abstract class IMovieService {
Future<List<MovieModel>?> getMovies(Function(String?) onError);
}
//origin //https://github.com/VB10/base_response_flutter/blob/7c7c4d7360d9c55ee91f357c8710b67d129dcdf8/lib/core/network/project_network_manager.dart
class DioService implements IMovieService {
@override
@vidarrrr
vidarrrr / sharedpreferences_helper.dart
Last active October 13, 2022 09:42
Singleton SharedPreferences Flutter
class SharedPreferenceHelper {
static late final SharedPreferences _preferences;
SharedPreferenceHelper._();
static Future<SharedPreferences> init() async =>
_preferences = await SharedPreferences.getInstance();
static String getString(String key) {
return _preferences.getString(key) ?? "";
}
@vidarrrr
vidarrrr / curl.md
Created February 10, 2018 12:57 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.