Skip to content

Instantly share code, notes, and snippets.

View GroovinChip's full-sized avatar
🍪

Reuben Turner GroovinChip

🍪
View GitHub Profile
@lukepighetti
lukepighetti / database.dart
Last active March 25, 2021 18:43
A dead simple JSON based key/value store that is unbelievably useful for scripts and tools
import 'dart:convert';
import 'dart:io';
class Database {
/// A simple JSON file database
Database(String path) : file = File(path);
final File file;
var _store = <String, dynamic>{};
@lukepighetti
lukepighetti / example.dart
Last active March 27, 2021 00:54
Simple route generator that exposes arguments and query params to route builders
main() {
BuildContext context;
final router = NavigationService(context);
return MaterialApp(
onGenerateRoute: (settings) => router.handleGenerateRoute(
settings,
routes: {
'/': (params, context) => HomeView(),
for f in $(find ./ -name '*.dart')
do
(echo "// @dart=2.9" && cat $f) > filename1 && mv filename1 $f
done
@lukepighetti
lukepighetti / rounded_rectangle.dart
Created May 4, 2023 20:07
Boring RoundedRectangle with platform aware superellipse corners
import 'dart:io';
import 'package:figma_squircle/figma_squircle.dart';
import 'package:flutter/widgets.dart';
class RoundedRectangle extends StatelessWidget {
const RoundedRectangle({
super.key,
this.radius = 10,
this.height,