Skip to content

Instantly share code, notes, and snippets.

allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}
Execution failed for task ':mylibrary:javadocRelease'.
> Javadoc generation failed. Generated Javadoc options file
@plateaukao
plateaukao / flutter_load_image_fast.dart
Created July 29, 2019 13:47
flutter_load_image_fast.dart
@override
void initState() {
super.initState();
downloadWhenNecessary();
}
downloadWhenNecessary({Function action}) {
_downloadImage().then((bytes) async {
if(!mounted) return;
@plateaukao
plateaukao / flutter_load_image_slow.dart
Last active July 29, 2019 13:03
flutter_load_image_slow.dart
@override
void initState() {
super.initState();
downloadWhenNecessary();
}
downloadWhenNecessary({Function action}) {
_downloadImage().then((bytes) async {
if(!mounted) return;
@plateaukao
plateaukao / flickr_verifier.dart
Created July 25, 2019 15:41
flickr_verifier.dart
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
class _MyHomePageState extends State<MyHomePage> {
FlutterWebviewPlugin _flutterWebviewPlugin;
@override
void initState() {
super.initState();
...
_flutterWebviewPlugin = FlutterWebviewPlugin()..onUrlChanged.listen((url) {
@plateaukao
plateaukao / flickr_request_token.dart
Created July 23, 2019 14:56
flickr_request_token.dart
TextEditingController _textFieldController = TextEditingController();
@override
Widget build(BuildContext context) {
...
...
AlertDialog(
title: Text('Input verification code'),
@plateaukao
plateaukao / flickr_launch_url.dart
Last active July 23, 2019 14:45
flickr_launch_url.dart
import 'package:url_launcher/url_launcher.dart';
RaisedButton(
onPressed: () => client.getRequestTokenUrl().then((url){
launch(url);
// other handlings.
}
),
@plateaukao
plateaukao / oauth1_init.dart
Last active July 23, 2019 14:53
oauth1_init.dart
import 'package:oauth1/oauth1.dart' as oauth1;
const String FLICKR_API_URL_OAUTH_BASE="https://www.flickr.com/services/oauth";
const String FLICKR_API_URL_REQUEST_TOKEN ="$FLICKR_API_URL_OAUTH_BASE/request_token";
const String FLICKR_API_URL_AUTHORIZE="$FLICKR_API_URL_OAUTH_BASE/authorize";
const String FLICKR_API_URL_ACCESS_TOKEN="$FLICKR_API_URL_OAUTH_BASE/access_token";
class FlickrApiClient {
final platform = new oauth1.Platform(
@plateaukao
plateaukao / calliplus_image_process_flow.puml
Created July 4, 2019 01:35
calliplus image process flow
@startuml
alt case: no local cache
autonumber "<font color=red><b>[0]"
CalliImage -> http: get (image file)
http --> CalliImage: image file with white background
CalliImage -> ImageProcessing: compute(removeWhiteBackground, bytes)
ImageProcessing --> CalliImage: processed image
CalliImage -> CalliImage: save file to local storage
CalliImage -> CalliImage: in build(), Image.memory(processed image)
else case: local cache exists
static Image processImage(Image srcImage) {
return srcImage.replaceColor(Colors.white, Colors.transparent);
}
Image _getTransparentBackgroundImage(Image srcImage) async {
Image resultImage = await compute(processImage, srcImage);
return resultImae;
}