Skip to content

Instantly share code, notes, and snippets.

View jogboms's full-sized avatar
💙
Building Awesome w/ Dart & Flutter

Jeremiah Ogbomo jogboms

💙
Building Awesome w/ Dart & Flutter
View GitHub Profile
@humblerookie
humblerookie / json_decoder.dart
Last active February 13, 2022 02:15
Dio Built Value Json Decoder/Transformer for Dart/Flutter
import 'dart:convert';
import 'package:my_app/data_model/serializers.dart';
import 'package:flutter/foundation.dart';
Future<T> decodeJson<T>(String res) async {
var list = List();
list.add(res);
list.add(T);
//Replace compute with spawning any other isolate, compute is simpler abstraction of isolate api.
@slightfoot
slightfoot / number_input.dart
Last active August 25, 2023 14:51
Number Input Widget - For entering pins and other such things - #HumpDayQandA - 24th April 2019
// MIT License
//
// Copyright (c) 2023 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@slightfoot
slightfoot / run_logged.dart
Created April 11, 2019 11:02
Logging your app's print statements to a local file for later processing.
import 'dart:async';
import 'dart:core';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
void main() => runLoggedApp(App());
import 'package:flutter/material.dart';
@immutable
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
ClipShadowPath({
@required this.shadow,
@dru
dru / upload_progress.dart
Created December 26, 2018 12:53
Upload progress with Dart and Streams
import "dart:io";
import "dart:async";
main() async {
HttpClientRequest request =
await HttpClient().post('some.host', 8000, '/upload');
request.headers.contentType = ContentType.binary;
final file = File('/some/big/file');
@slightfoot
slightfoot / card_deck.dart
Last active March 30, 2019 22:54
Play Card Deck with Picking Animation - https://i.imgur.com/JKiNoJP.png
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'dart:convert' show base64;
import 'card_images.dart';
final Map<String, Uint8List> cardImages = {};
void main() async {
@rodydavis
rodydavis / Fastfile
Last active August 18, 2022 14:44
Top-level Fastfile for Flutter
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@bostrot
bostrot / CustomShowDialog.dart
Last active October 25, 2022 09:25
showDialog with rounded corners
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
@slightfoot
slightfoot / splash_intro.dart
Last active September 28, 2018 18:09
Splash Intro Slider Thing
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'dart:convert' show base64;
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(