test('2 multiply 3 is equal to 6', (int a, int b) {
// Arrange
const a = 2;
const b = 3;
// Act
final answer = multiply(a, b);
// Assert
- Android Studio
- XCode (Optional)
- Text Editor, Visual Studio Code
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 'dart:convert'; | |
import 'dart:isolate'; | |
void _runner(SendPort toMainPort) { | |
final ReceivePort fromMainPort = ReceivePort(); | |
toMainPort.send(fromMainPort.sendPort); | |
fromMainPort.listen((final message) { | |
if (message == 'kill') fromMainPort.close(); | |
if (message is! Map<String, dynamic>) return; |
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:convert'; | |
import 'dart:isolate'; | |
void main() async { | |
const jsonStr = '{' | |
'"name": "alif",' | |
'"age": 26,' | |
'"gender": "male",' | |
'"office": "work from home"' | |
'}'; |
data class State (
val coffee: CoffeeCup = EmptyCoffeeCup()
)
sealed class Intent(val state: State) {
class CheckCupContent(state: State) : Intent(state)
class Refill(state: State) : Intent(state)
}
interface RefillProvider {
fun refill()
}
class PersonPresenter {
var coffee = EmptyCoffeeCup()
val shopper = ShopController() // si OB
val person = PersonController() // otak si Bos
/**
* Money dan Coffee adalah Model
* ShopController adalah Si OB "Controller"
* ConsumerView adalah Si Bos "View"
*/
class CustomerView {
var coffee = EmptyCoffeeCup()
val shopper = ShopController() // si OB
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
### prerequisite: python 3.6+ | |
### pip install pyyaml | |
### pip install beautifulsoup4 | |
### | |
### use this script to check your flutter deps to find out lates deps | |
### and check whether it is compatible to your platform target | |
### it will create a table in markdown file (compability_deps.md) | |
import urllib.request | |
import yaml |