Skip to content

Instantly share code, notes, and snippets.

:octocat:
Working From Home

Rody Davis rodydavis

:octocat:
Working From Home
View GitHub Profile
@rodydavis
rodydavis / tracked_stream_controller.dart
Created Aug 3, 2020
Dart Tracked Stream Controller
View tracked_stream_controller.dart
@@ -1,102 +0,0 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:undo/undo.dart';
class TrackedStreamController<T> implements StreamSink<T> {
TrackedStreamController(this._value,
{int maxUndoStack,
@rodydavis
rodydavis / tracked_value_notifer.dart
Created Aug 3, 2020
Tracked Flutter ValueNotifer
View tracked_value_notifer.dart
@@ -1,94 +0,0 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:undo/undo.dart';
class TrackedValueNotifier<T> extends ChangeNotifier
implements ValueListenable<T> {
/// Creates a [ChangeNotifier] that wraps this value.
@rodydavis
rodydavis / tracked_value_notifer.dart
Created Aug 3, 2020
Tracked Flutter ValueNotifer
View tracked_value_notifer.dart
@@ -1,94 +0,0 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:undo/undo.dart';
class TrackedValueNotifier<T> extends ChangeNotifier
implements ValueListenable<T> {
/// Creates a [ChangeNotifier] that wraps this value.
@rodydavis
rodydavis / flutter_all_fastlane.sh
Created Jun 17, 2020
Using Fastlane for Flutter to deploy iOS, Mac, Android and Web
View flutter_all_fastlane.sh
# 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
View flutter_device_utils.dart
import 'package:flutter/foundation.dart';
import 'dart:io';
bool get isWeb => kIsWeb;
bool get isMobile => !isWeb && (Platform.isIOS || Platform.isAndroid);
bool get isDesktop =>
!isWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux);
bool get isApple => !isWeb && (Platform.isIOS || Platform.isMacOS);
bool get isGoogle => !isWeb && (Platform.isAndroid || Platform.isFuchsia);
View flutter_gmail_clone.dart
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@rodydavis
rodydavis / flutter_device_breakpoint.dart
Created May 5, 2020
Flutter Device Based On BoxConstraints
View flutter_device_breakpoint.dart
import 'package:flutter/material.dart';
const kTabletSize = Size(500, 700);
const kListWidthSize = 300.0;
const kTabletBreakpoint = 720.0;
const kDesktopBreakpoint = 1200.0;
enum DeviceSize { mobile, tablet, desktop }
extension LayoutUtils on BoxConstraints {
@rodydavis
rodydavis / flutter_web_firebase_messaging.dart
Created May 1, 2020
Firebase Messaging on Flutter Web
View flutter_web_firebase_messaging.dart
import 'dart:async';
import 'package:firebase/firebase.dart' as firebase;
class FBMessaging {
FBMessaging._();
static FBMessaging _instance = FBMessaging._();
static FBMessaging get instance => _instance;
firebase.Messaging _mc;
String _token;
View firebase_messaging_sw.js
importScripts("https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js");
importScripts("https://www.gstatic.com/firebasejs/7.5.0/firebase-messaging.js");
firebase.initializeApp({
apiKey: "API_KEY",
authDomain: "AUTH_DOMAIN",
databaseURL: "DATABASE_URL",
projectId: "PROJECT_ID",
storageBucket: "STORAGE_BUCKET",
messagingSenderId: "MESSAGING_SENDER_ID",
appId: "APP_ID",
View flutter_calculator.dart
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
You can’t perform that action at this time.