Skip to content

Instantly share code, notes, and snippets.

View yjbanov's full-sized 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
/*
Flutter crash report; please file at https://github.com/flutter/flutter/issues.
## command
flutter doctor
## exception
FileSystemException: FileSystemException: Cannot open file, path = '/home/linux2/.cocoon/flutter/bin/cache/downloads/https@c@@s@@s@storage.googleapis.com@s@flutter_infra@s@flutter@s@6a724f0d3e22d41246baf3447d7ba2c9ff886765@s@android-arm-profile@s@linux-x64.zip.zip' (OS Error: File name too long, errno = 36)
@yjbanov
yjbanov / hundreds.dart
Created March 23, 2018 01:58
The Hundreds widget
class Hundreds extends StatefulWidget {
Hundreds(this.stopwatch);
final Stopwatch stopwatch;
HundredsState createState() => new HundredsState(stopwatch);
}
class HundredsState extends State<Hundreds> {
final Stopwatch stopwatch;
@yjbanov
yjbanov / repaint_boundary.dart
Created March 23, 2018 03:50
Flutter: using RepaintBoundary
new RepaintBoundary(
child: new SizedBox(
height: 72.0,
child: new Hundreds(stopwatch),
),
)
@yjbanov
yjbanov / widget.dart
Last active June 6, 2018 05:08
A Darty widget declaration syntax
// 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 / wrap_unwrap.dart
Last active June 28, 2018 16:27
Conditional wrapping operator for 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 / .travis.yml
Created May 26, 2017 04:16
Fast Flutter build
matrix:
# This causes the build to complete immediately upon first failure or once
# required jobs are green.
fast_finish: true
# Building APK/IPA takes a long time; do not wait for them to finish.
allow_failures:
- env: JOB=APK
- env: JOB=IPA
@yjbanov
yjbanov / .travis.yml
Created May 26, 2017 03:55
Continuously build Flutter IPAs
os: osx
language: generic
osx_image: xcode8.3
before_script:
- pip install six
- brew update
- brew install --HEAD libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- git clone https://github.com/flutter/flutter.git -b alpha --depth 1
@yjbanov
yjbanov / .travis.yml
Created May 26, 2017 03:46
Continuously build Flutter APKs
os: linux
language: android
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
android:
components:
- tools
- platform-tools
@yjbanov
yjbanov / main.dart
Created March 23, 2018 03:12
Flutter: enabling repaint rainbow
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'timer_page.dart';
void main() {
debugRepaintRainbowEnabled = true;
runApp(new MyApp());
}
@yjbanov
yjbanov / .travis.yml
Last active August 6, 2019 17:31
.travis.yml for Flutter
os:
- linux
sudo: false
addons:
apt:
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
sources:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- libstdc++6