This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
test('testing future callback', () { | |
int number = 10; | |
Future<int> futureNumber = Future.value(number); | |
futureNumber.then((val) { | |
expect(val, 10); | |
}); | |
}); |
final expectedWeatherModel = WeatherModel(20, 'Sydney', 'Sunny', Icons.cloud, []); | |
final mapCoordinate = MapCoordinate(1.0, -1.0); | |
when(mockLocationRepository.getCurrentLocation()) | |
.thenAnswer((_) { | |
return Future.value(mapCoordinate); | |
}); | |
when(mockWeatherRepository.getWeatherWithLocation(mapCoordinate)) | |
.thenAnswer((_) { | |
return Future.value(expectedWeatherModel); | |
}); |
import 'package:flutter/material.dart'; | |
import 'package:flutter_unit_testing/bloc/weather_model.dart'; | |
import 'package:intl/intl.dart'; | |
import 'package:weather_icons/weather_icons.dart'; | |
class MetaweatherUtil { | |
String jsonToLocationId(List<dynamic> jsonList) { | |
return jsonList[0]['woeid'].toString(); | |
} | |
} |
import 'package:flutter_test/flutter_test.dart'; | |
void main() { | |
group('This list of numbers', () { | |
List numberList = [1, 2, 3, 4, 5]; | |
test('should have the right length', () { | |
expect(numberList.length, equals(5)); | |
}); | |
test('should have the correct order', () { |
when(mockGeolocator.getCurrentPosition( | |
desiredAccuracy: anyNamed('desiredAccuracy'), | |
locationPermissionLevel: anyNamed('locationPermissionLevel'))) | |
.thenAnswer((_) { | |
return Future<Position>.value(Position(latitude: 20, longitude: 30)); | |
}); |
dev_dependencies: | |
flutter_test: | |
sdk: flutter | |
mockito: 4.1.1 |
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.