Skip to content

Instantly share code, notes, and snippets.

View johngorithm's full-sized avatar
🏠
Working from home

Johngorithm johngorithm

🏠
Working from home
View GitHub Profile
@johngorithm
johngorithm / issues.md
Created February 22, 2023 09:25
Set Env Setup Issues and Fixes

22 Feb 2023

Error: flutter The method 'File.create' has fewer named arguments than those of overridden method 'File.create'

StackOverflow: For me the packages in my pubspec.yaml were all up to date, but the following fixed it:

Delete pubspec.lock.
Run flutter pub get again.

Link: StackOverflow

@johngorithm
johngorithm / revert_commits
Created June 6, 2022 10:42 — forked from eliza-abraham/revert_commits
Reverting Commits
Clean way to revert a commit by also leaving a log of the revert
$ git revert --strategy resolve <commit>
@johngorithm
johngorithm / dart_http_rapper.dart
Last active August 22, 2021 16:33
This Rapper essentially makes it easy to test out code using the http dart library. It is plainly an abstraction to enhance testability
import 'dart:typed_data';
import 'package:http/http.dart' as http;
class HttpService {
Duration timeOutLimit = Duration(seconds: 15);
Future<http.Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) {
return http.delete(url, headers: headers, body: body, encoding: encoding).timeout(timeOutLimit);
@johngorithm
johngorithm / countries.json
Created August 17, 2021 09:40 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@johngorithm
johngorithm / loading_and_displaying_pages_of_data.dart
Last active August 26, 2020 09:27
Comment/Code - How to load and display pages of network data.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
https://stackoverflow.com/questions/46377667/docker-for-mac-mkmf-rb-cant-find-header-files-for-ruby

Command for deleting flutter lock file.

This is essentially useful when one is blocked on Waiting for another flutter command to release the startup lock...

On the flutter root folder, run: rm ./flutter/bin/cache/lockfile

First

git fetch --all

Next

git reset --hard origin/<feature-branch>