Skip to content

Instantly share code, notes, and snippets.

View jonahwilliams's full-sized avatar

Jonah Williams jonahwilliams

View GitHub Profile
@jonahwilliams
jonahwilliams / main.dart
Created March 12, 2018 19:54
FutureBuilder
// 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:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
@jonahwilliams
jonahwilliams / main.dart
Last active December 10, 2021 01:37
Material changing
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
@jonahwilliams
jonahwilliams / file.txt
Created March 18, 2018 23:10
red2black
Material(type: canvas, elevation: 8.0, shadowColor: MaterialColor(primary value: Color(0xfff44336)), state: _MaterialState#fdf47)
│ │ └AnimatedPhysicalModel(duration: 200ms, shape: rectangle, borderRadius: BorderRadius.zero, elevation: 8.0, color: Color(0xfffafafa), animateColor: false, shadowColor: MaterialColor(primary value: Color(0xfff44336)), animateShadowColor: true, state: _AnimatedPhysicalModelState#ed69f(ticker inactive))
│ │ └PhysicalModel(shape: rectangle, borderRadius: BorderRadius.zero, elevation: 8.0, color: Color(0xfffafafa), shadowColor: MaterialColor(primary value: Color(0xfff44336)), renderObject: RenderPhysicalModel#b50e5)
│ │ └NotificationListener<LayoutChangedNotification>
│ │ └_InkFeatures-[GlobalKey#467f1 ink renderer](renderObject: _RenderInkFeatures#d7632)
│ │ └AnimatedDefaultTextStyle(duration: 200ms, debugLabel: (englishLike body1).merge(blackCupertino body1), inherit: false, color: C
# Original command
../flutter/bin/flutter run --local-engine-src-path /usr/local/google/home/jonahwilliams/Documents/engine/src --local-engine=android_debug_unopt
## command
flutter --local-engine android_debug_unopt --local-engine-src-path /usr/local/google/home/jonahwilliams/Documents/engine/src build flx --suppress-analytics --target /usr/local/google/home/jonahwilliams/Documents/examplo/lib/main.dart --preview-dart-2 --output-file /usr/local/google/home/jonahwilliams/Documents/examplo/build/app/intermediates/flutter/debug/app.flx --depfile /usr/local/google/home/jonahwilliams/Documents/examplo/build/app/intermediates/flutter/debug/snapshot_blob.bin.d --working-dir /usr/local/google/home/jonahwilliams/Documents/examplo/build/app/intermediates/flutter/debug/flutter_assets
## exception
ArgumentError: Invalid argument(s): Cannot find executable for /usr/local/google/home/jonahwilliams/Documents/engine/src/out/host_debug_unopt/dart-sdk/bin/dart.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
void main() {
final controller = new StreamController(sync: true);
controller.add(2);
new Future.delayed(const Duration(seconds: 1)).then((_) {
controller.add(3);
@jonahwilliams
jonahwilliams / analysis_options.yaml
Created April 16, 2018 16:38
Example new analysis options
# Specify analysis options.
#
# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
#
# There are three similar analysis options files in the flutter repo:
import 'dart:async';
class PositionTracker {
PositionTracker(this._currentLat, this._currentLong, [this.minimumDelta = 100.0]);
final double minimumDelta;
final StreamController<void> _onUpdate = new StreamController<void>();
double _currentLat;
double _currentLatDelta = 0.0;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(new Center(child: new Example()));
}
class Ancestor extends SingleChildRenderObjectWidget {
const Ancestor({Widget child, Key key}): super(child: child, key: key);
// 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:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'dart:async';
//void main() => runApp(const Center(child: const Text('Hello, world!', textDirection: TextDirection.ltr)));
@jonahwilliams
jonahwilliams / timeline.json
Created October 12, 2018 00:21
gallery_bench
{
type:_Timeline,
traceEvents:[
{
name:thread_name,
ph:M,
pid:3,
tid:63753544031024,
args:{
name:Dart ThreadPool Worker (63753544031024),