Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working From Home

Rody Davis rodydavis

:octocat:
Working From Home
View GitHub Profile
@rodydavis
rodydavis / flutter_github_ci.yml
Last active Sep 23, 2020
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
View flutter_github_ci.yml
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@rodydavis
rodydavis / flutter_analyzer_ast.dart
Created Sep 19, 2020
Flutter File Analyzer in Dart
View flutter_analyzer_ast.dart
import 'dart:convert';
import 'package:analyzer/dart/analysis/utilities.dart';
// import 'package:analyzer/dart/ast/syntactic_entity.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
const kTestFlutterData = '''
import 'package:flutter/material.dart';
@rodydavis
rodydavis / dart_enum_description.dart
Created Sep 6, 2020
Add Descriptions to Enums in Dart
View dart_enum_description.dart
enum MyEnum {
simple,
special,
complex,
}
extension MyEnumUtils on MyEnum {
String get description {
switch (this) {
case MyEnum.simple:
@rodydavis
rodydavis / tracked_stream_controller.dart
Last active Sep 14, 2020
Dart Tracked Stream Controller
View tracked_stream_controller.dart
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 / flutter_model_notification.dart
Created Sep 13, 2020
Inherited Widget + Notifications
View flutter_model_notification.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@rodydavis
rodydavis / animated_indexed_stack.dart
Last active Sep 11, 2020
Flutter Animated IndexedStack
View animated_indexed_stack.dart
import 'package:flutter/material.dart';
class AnimatedIndexedStack extends StatelessWidget {
const AnimatedIndexedStack({
Key key,
@required this.index,
@required this.children,
@required this.duration,
}) : super(key: key);
View lit-consumer.ts
const Consumer = (Base: any) =>
class extends Base {
requestInstance = (key: any) => {
const event = new CustomEvent("request-instance", {
detail: {key} as any,
bubbles: true,
cancelable: true,
});
this.dispatchEvent(event);
@rodydavis
rodydavis / material-library.js
Last active Aug 13, 2020
MWC + MDC Material Bundle for Static Sites
View material-library.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
@rodydavis
rodydavis / material-bundle.js
Created Aug 12, 2020
MWC + MDC Material Bundle for Static Sites
View material-bundle.js
This file has been truncated, but you can view the full file.
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
@rodydavis
rodydavis / flutter_slider_limit.dart
Created Aug 12, 2020
Flutter Slider Limit Min/Max
View flutter_slider_limit.dart
// Flutter code sample for Slider
// ![A slider widget, consisting of 5 divisions and showing the default value
// indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/slider.png)
//
// The Sliders value is part of the Stateful widget subclass to change the value
// setState was called.
// Docs: https://api.flutter.dev/flutter/material/Slider-class.html
You can’t perform that action at this time.