Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Building a Web runtime for Flutter: http://bit.ly/flutter-web

Yegor yjbanov

💭
Building a Web runtime for Flutter: http://bit.ly/flutter-web
View GitHub Profile
View main.dart
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class Foo {
Foo({this.x, this.y});
final int x;
final int y;
toString() => '($x, $y)';
@yjbanov
yjbanov / main.dart
Created May 15, 2020
async puzzler
View main.dart
Future<void> foo() => Future<void>.delayed(
Duration.zero,
() { print('foo'); }
);
void bar() async {
await foo();
print('bar');
}
View build-workers.log
4 workers:
[INFO] Running build completed, took 3m 57s
[INFO] Caching finalized dependency graph completed, took 210ms
[INFO] Reading manifest at build/.build.manifest completed, took 1ms
[INFO] Deleting previous outputs in `build` completed, took 119ms
[INFO] Creating merged output dir `build` completed, took 685ms
[INFO] Writing asset manifest completed, took 8ms
[INFO] Succeeded after 3m 58s with 824 outputs (414 actions)
View chromedriver_error.txt
INFO: chrome version in use Google Chrome 80.0.3987.132
downloading file from https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip
lib/chrome_driver_command.dart:50:45: Error: No named parameter with the name 'alwaysInstall'.
await chromeDriverInstaller.install(alwaysInstall: alwaysInstall);
^^^^^^^^^^^^^
lib/chrome_driver_command.dart:52:43: Error: No named parameter with the name 'alwaysInstall'.
await chromeDriverInstaller.start(alwaysInstall: alwaysInstall);
^^^^^^^^^^^^^
lib/chrome_driver_command.dart:66:53: Error: Method not found: 'ChromeDriverInstaller.withVersion'.
View invoker_timeout.log
dart --enable-asserts ./dev/bots/test.dart
Running task: web_tests-0-linux
════════════════════════════════════════════════════════════════════════════════
Running smoketests...
▌21:31:29▐ RUNNING: cd dev/automated_tests; ../../bin/flutter test test_smoke_test/pass_test.dart
▌21:31:39▐ ELAPSED TIME: 10.229s for ../../bin/flutter test test_smoke_test/pass_test.dart in dev/automated_tests
▌21:31:39▐ RUNNING: cd dev/automated_tests; ../../bin/flutter test test_smoke_test/fail_test.dart
▌21:31:42▐ ELAPSED TIME: 3.148s for ../../bin/flutter test test_smoke_test/fail_test.dart in dev/automated_tests
▌21:31:42▐ RUNNING: cd dev/automated_tests; ../../bin/flutter test test_smoke_test/timeout_pass_test.dart
▌21:31:48▐ ELAPSED TIME: 5.831s for ../../bin/flutter test test_smoke_test/timeout_pass_test.dart in dev/automated_tests
@yjbanov
yjbanov / wrap_unwrap.dart
Last active Jun 28, 2018
Conditional wrapping operator for Dart
View wrap_unwrap.dart
// This build method attempts to conditionally insert a
// DecoratedBox widget into the widget hierarchy. Roughly
// speaking we want the widget tree to be like this:
//
// if (someCondition) {
// Container > DecoratedBox > Container
// } else {
// Container > Container
// }
build(_) {
@yjbanov
yjbanov / widget.dart
Last active Jun 6, 2018
A Darty widget declaration syntax
View widget.dart
// Stateless widget:
//
// - no `extends StatelessWidget`
// - fields are `final` by default
// - `@override`, `Widget` return type and `BuildContext context` parameter are implied
widget MyApp {
String title;
build {
}
@yjbanov
yjbanov / repaint_boundary.dart
Created Mar 23, 2018
Flutter: using RepaintBoundary
View repaint_boundary.dart
new RepaintBoundary(
child: new SizedBox(
height: 72.0,
child: new Hundreds(stopwatch),
),
)
@yjbanov
yjbanov / main.dart
Created Mar 23, 2018
Flutter: enabling repaint rainbow
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'timer_page.dart';
void main() {
debugRepaintRainbowEnabled = true;
runApp(new MyApp());
}
@yjbanov
yjbanov / hundreds.dart
Created Mar 23, 2018
The Hundreds widget
View hundreds.dart
class Hundreds extends StatefulWidget {
Hundreds(this.stopwatch);
final Stopwatch stopwatch;
HundredsState createState() => new HundredsState(stopwatch);
}
class HundredsState extends State<Hundreds> {
final Stopwatch stopwatch;
You can’t perform that action at this time.