Skip to content

Instantly share code, notes, and snippets.

@rodydavis
rodydavis / dottedBorder.dart
Created December 27, 2019 00:28 — forked from PlugFox/dottedBorder.dart
Flutter Web simple file upload
import 'package:flutter_web/material.dart';
import 'dart:math' as math;
class DottedBorder extends StatelessWidget {
final Color color;
final double strokeWidth;
final double gap;
final Widget child;
final EdgeInsets padding;
@rodydavis
rodydavis / stream_widget.dart
Created February 13, 2020 08:29 — forked from rafa-js/stream_widget.dart
[Flutter] Reusable Widget to handle the common flows working with Streams
import 'package:flutter/material.dart';
class StreamWidget<T> extends StatelessWidget {
final Stream<T> stream;
final Widget Function() onLoading;
final Widget Function(T) onData;
final Widget Function(dynamic) onError;
const StreamWidget({
@required this.stream,
@rodydavis
rodydavis / dropzone.dart
Created February 13, 2020 19:35 — forked from mosheduminer/dropzone.dart
Implementation of a drag-and-drop zone for flutter web. Inspired by https://gist.github.com/PlugFox/ffe83a91ce50f9c78a5b1d6674e36d1b
import 'dart:async';
import 'dart:html';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
enum _DragState {
dragging,
notDragging,
}
@rodydavis
rodydavis / gist:8a819c292b39826382f242415dc19b21
Created July 24, 2022 03:58 — forked from jampajeen/gist:d19f36a7309d0ead0e1f9735a26d66f3
Disable/Enable Mac OSX sleep on lid closed
# disable sleep
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0
@rodydavis
rodydavis / ltxml.js
Created April 5, 2023 17:26 — forked from xndcn/ltxml.js
/***************************************************************************
Copyright (c) Microsoft Corporation 2013.
This code is licensed using the Microsoft Public License (Ms-PL). You can find the text of the license here:
http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
Published at http://OpenXmlDeveloper.org
Resource Center and Documentation: http://openxmldeveloper.org/wiki/w/wiki/open-xml-sdk-for-javascript.aspx