- You need to build the engine from source. Follow the steps at https://github.com/flutter/engine/blob/master/CONTRIBUTING.md#getting-the-code-and-configuring-your-environment
- You can skip the forking step if you don’t think you will be contributing changes to the engine.
- Once your environment is setup, build the engine in Release mode.
$ sky/tools/gn —release$ ninja -C out/Release -j12
- After the long build you will find a Mac application called
SkyShell.appinout/Release. This is the generic Flutter application runner. It does not know anything about your dart project yet. - Create a sample dart project
$ flutter init -o mac_hello
- From the command line, launch the SkyShell.app with command line flags telling it where your dart project resides and its package root. On my system I did this:
$ ./out/Release/SkyShell.app/Contents/MacOS/SkyShell PATH_TO_PROJECT/lib/main.dart --package-root=PATH_TO_PROJECT/packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val denom = arrayOf(1, 2, 5, 10, 20, 50, 100) | |
| val amount = arrayOf(5, 11, 53, 122, 155, 157, 210, 200) | |
| fun main(args: Array<String>) = amount.forEach { currentAmount -> | |
| val suggestions = mutableListOf<Int>() | |
| denom.forEach { | |
| if (it >= currentAmount) { | |
| suggestions += it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package id.bitcase.ocafe.utility; | |
| import android.bluetooth.BluetoothAdapter; | |
| import android.bluetooth.BluetoothDevice; | |
| import android.bluetooth.BluetoothSocket; | |
| import android.graphics.Bitmap; | |
| import android.os.AsyncTask; | |
| import android.util.Log; | |
| import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.github.putraxor | |
| /** | |
| * Feature Extraction using Zone Based | |
| */ | |
| object ZonaFE { | |
| /** | |
| * Extract feature from matrix | |
| * [z] number of zones |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| class Bubble extends StatelessWidget { | |
| Bubble({this.message, this.time, this.delivered, this.isMe}); | |
| final String message, time; | |
| final delivered, isMe; | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| class InfiniteScroll extends StatefulWidget { | |
| @override | |
| _InfiniteScrollState createState() => new _InfiniteScrollState(); | |
| } | |
| class _InfiniteScrollState extends State<InfiniteScroll> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:url_launcher/url_launcher.dart' as launcher; | |
| ///TODO: check performance impact bro !!! | |
| class LinkTextSpan extends TextSpan { | |
| LinkTextSpan({TextStyle style, String url, String text}) | |
| : super( | |
| style: style, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="aquarium"> | |
| <div class="aquarium__table"></div> | |
| <div class="aquarium__aquarium"> | |
| <div class="aquarium__water"></div> | |
| <div class="aquarium__bubble"></div> | |
| <div class="aquarium__bubble"></div> | |
| <div class="aquarium__bubble"></div> | |
| <div class="aquarium__bubble"></div> | |
| <div class="aquarium__bubble"></div> | |
| <div class="aquarium__bubble"></div> |
This is an ad-hoc Java-to-Dart translator originally written on two (admittedly long) evenings.
See http://sma.github.io/stuff/java2dartweb/java2dartweb.html for a demo.
Note: It doesn't support the complete Java grammar specification and cannot translate everything. It only translates syntax and does not attempt to translate Java library classes and methods to Dart equivalents (with the exception of String.charAt and StringBuffer.append). You will have to make changes to the resulting Dart code. It does not support anonymous inner classes.
However, I was able to successfully convert a 7000+ line command line application with only minimal fixes in 30 minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| /// Navigator.of(context).push(FadeRoute( | |
| /// builder: (context) { | |
| /// return NewPage(); | |
| /// } | |
| /// )); | |
| class FadeRoute extends PageRoute { | |
| FadeRoute({@required this.builder}); |