Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

/// Configurable state of an input field.
class InputValue {
const InputValue({ this.text: '', this.selection });
/// The current text being edited.
String text;
/// The range of text that is currently selected.
TextSelection selection;
jackson-macpro:conditional jackson$ dart --version
Dart VM version: 1.15.0-dev.5.0 (Wed Mar 2 04:28:16 2016) on "macos_x64"
jackson-macpro:conditional jackson$ cat foo.dart
import 'bar.dart'
if (dart.library.js) 'baz.dart';
void main() => print("Hello $world!");
jackson-macpro:conditional jackson$ dart foo.dart
'file:///Users/jackson/flutter/conditional/foo.dart': error: line 1 pos 16: semicolon expected
import 'bar.dart'
jackson-macpro:firechat-flutter jackson$ ./tool/show_diff.sh
================= 0...1 =====================
4a5,6
> import 'dart:math' show Random;
>
9a12,15
> theme: new ThemeData(
> primarySwatch: Colors.purple,
> accentColor: Colors.orangeAccent[400]
> ),
(lldb) bt
* thread #1: tid = 0x579d4, 0x00000001098e3386 libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread', stop reason = signal SIGPIPE
* frame #0: 0x00000001098e3386 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x00000001098e27c7 libsystem_kernel.dylib`mach_msg + 55
frame #2: 0x000000010731eb64 CoreFoundation`__CFRunLoopServiceMachPort + 212
frame #3: 0x000000010731dfbf CoreFoundation`__CFRunLoopRun + 1295
frame #4: 0x000000010731d828 CoreFoundation`CFRunLoopRunSpecific + 488
frame #5: 0x0000000109465ad2 GraphicsServices`GSEventRunModal + 161
frame #6: 0x0000000105d96610 UIKit`UIApplicationMain + 171
frame #7: 0x00000001015e1b0a Runner`main(argc=4, argv=0x00007fff5e630538) + 250 at main_ios.mm:14
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new FrostedDemo()));
}
class FrostedDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
@collinjackson
collinjackson / main.dart
Last active August 17, 2023 20:06
PageView example with dots indicator
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. 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:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
jackson-macbookpro:paranoia2 jackson$ git log HEAD^...HEAD
commit 973304d5fbf737510ecc250b93d9ee2e872b563f (HEAD -> alpha)
Author: Collin Jackson <jackson@google.com>
Date: Thu May 18 17:31:57 2017 -0700
Fix sliver padding assertion failure that sometimes happens during startup because the app is temporarily built with zero size
jackson-macbookpro:paranoia2 jackson$ git pull --ff-only
Updating 973304d5f..e2f54df5a
Fast-forward
.analysis_options | 8 +-
@collinjackson
collinjackson / main.dart
Last active May 12, 2020 10:57
Test case for BackdropFilter bugs
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
home: new HomePage(),
));
}
@collinjackson
collinjackson / main.dart
Last active December 7, 2019 13:42
pomodoro timer example
import 'package:flutter/material.dart';
void main() {
runApp(new Container(
color: Colors.white,
));
runApp(new MaterialApp(
theme: new ThemeData(primarySwatch: Colors.red),
home: new HomePage(),
));
@collinjackson
collinjackson / main.dart
Last active June 23, 2017 18:42
Tab bug demo
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
home: new MyHomePage(),
));
}
class TabbedPage extends StatelessWidget {