Skip to content

Instantly share code, notes, and snippets.

@jmolins
jmolins / main.dart
Created May 14, 2018 21:07 — forked from slightfoot/main.dart
RotatedWidget example
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:meta/meta.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@jmolins
jmolins / error_capture.dart
Created May 14, 2018 19:55 — forked from slightfoot/error_capture.dart
Crash Reporting / Error Capture for Flutter
///
/// Flutter Captured Error Reporting
/// Created by Simon Lightfoot
///
/// Copyright (C) DevAngels Limited 2018
/// License: APACHE 2.0 - https://www.apache.org/licenses/LICENSE-2.0
///
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui show window;
@jmolins
jmolins / curves_simulation.dart
Last active April 4, 2018 17:39 — forked from nhancv/demo2.dart
Curves simulation
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class DemoPage extends StatefulWidget {
@override
_DemoPageState createState() => new _DemoPageState();
@jmolins
jmolins / fill_viewport.dart
Created February 18, 2018 23:31 — forked from slightfoot/fill_viewport.dart
"Android Fill Viewport" style of content for Flutter, where even when the keyboard appears the content flows behind.
class SomeWidgetState extends State<SomeWidget> {
@override
Widget build(BuildContext context) {
return new Scaffold(body: new LayoutBuilder(builder: _buildContent));
}
Widget _buildContent(BuildContext context, BoxConstraints constraints) {
if (constraints.hasBoundedHeight) {
constraints = constraints.copyWith(maxHeight: constraints.maxHeight +
@jmolins
jmolins / bottom_sheet.dart
Created February 18, 2018 23:30 — forked from slightfoot/bottom_sheet.dart
Modal Bottom Sheet with Input Fields fix for Flutter
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
Future<T> showModalBottomSheetApp<T>({
@required BuildContext context,
@required WidgetBuilder builder,
}) {
@jmolins
jmolins / speed_dial_floating_action_button.dart
Created December 25, 2017 15:56 — forked from Simple-Complexity/speed_dial_floating_action_button.dart
A speed dial fab implementation for Flutter
import 'package:flutter/material.dart';
import 'dart:math';
import 'package:hone/common/defaults.dart';
enum ExpandDirection {
UP,
DOWN,
}