Skip to content

Instantly share code, notes, and snippets.

View MrHallows's full-sized avatar
🎯
Still waiting for my fellow Americans to wake the fuck up before it's too late.

MrHallows MrHallows

🎯
Still waiting for my fellow Americans to wake the fuck up before it's too late.
View GitHub Profile
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
@lamarmarshall
lamarmarshall / AppLocalizations.dart
Created June 24, 2019 03:05
flutter, localization, internationalization, translate
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class AppLocalizations {
final Locale locale;
AppLocalizations(this.locale);
@mneedham
mneedham / 00_install.sh
Last active April 1, 2025 16:55
Getting Neo4j Tweets
pip install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
pip install confluent-kafka[avro]
@brucevang
brucevang / ListViewJSONLocal.dart
Created March 26, 2019 20:20
ListViewJSONLocal.dart
import 'package:flutter/material.dart';
// Needed for JSON from URL
import 'dart:async';
import 'package:http/http.dart' as http;
// Needed to Conver JSON Network and Local file
import 'dart:convert';
// Needed for JSON from local
@slightfoot
slightfoot / always_scrollbar.dart
Created March 4, 2019 18:20
Always Visible Scrollbar for Flutter - 4th March 2019
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.indigo,
@mnikn
mnikn / array.js
Last active September 30, 2023 03:17
[array] array utils #utils
function duplicate(arr){
let set = new Set();
let result = [];
for(let i = 0;i < arr.length; ++i) {
if(!set.has(arr[i])) result.push(arr[i]);
set.add(arr[i]);
}
return result;
}
@killants
killants / findPaths.js
Last active November 10, 2022 04:34
Sharing knowledge
/**
* searches deep into an object recursively...
* @param {Object} obj object to be searched
* @param {any} searchValue the value/key to search for
* @param {Object} [options]
* @param {boolean} options.[searchKeys] whether to search object keys as well as values. Defaults to `true` if `serchValue` is a string, `false` otherwise.
* @param {number} options.[maxDepth=20] maximum recursion depth (to avoid "Maximum call stack size exceeded")
* @returns {string[]} Paths on the object to the matching results
*/
const findPaths = (
@boformer
boformer / 0_main.dart
Last active September 3, 2023 19:40
Flutter Service Architecture
import 'package:architecture_playground/home_page.dart';
import 'package:architecture_playground/services.dart';
import 'package:flutter/material.dart';
void main() async {
// perform long-running tasks before "runApp" to display the native splash screen
final services = await Services.initialize();
runApp(ServicesProvider(
services: services,
import 'package:flutter/widgets.dart';
abstract class Bloc {
void dispose();
}
class BlocProvider<BlocType extends Bloc> extends StatefulWidget {
final WidgetBuilder builder;
final BlocType Function() creator;
@muddassirm
muddassirm / LoadJson3.dart
Created August 24, 2018 18:30
Display JSON data in Flutter : Using a FutureBuilder
import 'package:flutter/material.dart';
import 'dart:convert';
import 'dart:async' show Future;
import 'package:flutter/services.dart' show rootBundle;
class Student {
String studentId;
String studentName;
int studentScores;