Skip to content

Instantly share code, notes, and snippets.

@collinjackson
collinjackson / column_reduced_test_case.dart
Created August 26, 2015 19:57
Reduced test case for Column height issue
// Copyright 2015 The Chromium Authors. 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:async';
import 'package:sky/rendering/sky_binding.dart';
import 'package:sky/widgets.dart';
import 'package:sky/theme/colors.dart' as colors;
void main() {
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/widgets.dart';
class Circle extends Component {
Circle(this.color);
final Color color;
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/widgets.dart';
import 'package:sky/material.dart';
class BlockApp extends App {
Widget build() {
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/material.dart';
import 'package:sky/widgets.dart';
class ReducedTestCaseApp extends StatefulComponent {
ReducedTestCaseAppState createState() => new ReducedTestCaseAppState();
}
@collinjackson
collinjackson / flutter_ios.md
Last active October 16, 2015 21:50
Instructions for building Flutter for iOS

Instructions for building Flutter for iOS

Important notes:

  • These instructions are for building from source. Developer workflow for iOS will get a lot simpler once we publish the precompiled iOS binaries in the public Flutter SDK.

  • Dart precompilation for iOS is landing soon. This will make the builds much faster.

Getting the code

@collinjackson
collinjackson / main.dart
Last active October 21, 2015 00:20
Perf issue on OnePlus+; Android One doesn't do the clip oval at all
// Copy this over main.dart in Stocks
// Build app:
// adb uninstall org.domokit.stocks; ninja -C out/android_Release/; adb install -r out/android_Release/apks/Stocks.apk
// Get trace:
// ninja -C out/android_Release/; adb install -r out/android_Debug/apks/Stocks.apk; mkdir tmp; rm tmp/*; adb shell run-as org.domokit.stocks chmod -R 0777 /data/data/org.domokit.stocks/app_sky_shell; cd tmp; adb pull /data/data/org.domokit.stocks/app_sky_shell; cd ..; ~/Downloads/debugger.app/Contents/MacOS/debugger tmp
import 'package:flutter/material.dart';
@collinjackson
collinjackson / reduced_test_case.dart
Created November 23, 2015 22:58
Reduced test case
Widget build(BuildContext context) {
return new Scaffold(
toolBar: new ToolBar(
backgroundColor: const Color(0xFFFFFF00)
),
floatingActionButton: new FloatingActionButton(
onPressed: () => debugDumpRenderTree(),
child: new Container()
),
body:
@collinjackson
collinjackson / input_demo.dart
Created February 3, 2016 23:51
Reduced test case of input being covered by keyboard
import 'package:flutter/material.dart';
void main() {
runApp(
new MaterialApp(
title: "Input Demo",
routes: <String, RouteBuilder>{
'/': (RouteArguments args) => new FlutterDemo()
}
)
@collinjackson
collinjackson / input.dart
Last active February 8, 2016 22:32
New Input API example
import 'package:flutter/material.dart';
void main() {
runApp(
new MaterialApp(
title: "Input Demo",
routes: <String, RouteBuilder>{
'/': (RouteArguments args) => new FlutterDemo()
}
)
/// 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;