This file contains 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
// MIT License | |
// | |
// Copyright (c) 2019 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
// MIT License | |
// | |
// Copyright (c) 2019 Lukasz Wisniewski | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
class SuspendedVariable<T>(var scope: CoroutineScope? = GlobalScope) { | |
private var actor = scope?.actor<Op<T>> { | |
var value : T? = null | |
val deferrals = mutableListOf<CompletableDeferred<T>>() | |
try { | |
for (message in channel) { | |
when (message) { | |
is Op.Set -> { |
This file contains 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
// Copyright 2016 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart' show SyntaxHighlighter; | |
import 'package:string_scanner/string_scanner.dart'; | |
class SyntaxHighlighterStyle { | |
SyntaxHighlighterStyle( |
This file contains 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 me.vishna.kdebounce | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
import android.widget.TextView | |
import kotlinx.coroutines.experimental.* | |
import kotlinx.coroutines.experimental.android.UI |
This file contains 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 android.annotation.TargetApi; | |
import android.app.AlertDialog; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.res.Resources; | |
import android.graphics.Canvas; | |
import android.media.AudioManager; | |
import android.media.MediaFormat; | |
import android.media.MediaPlayer; | |
import android.net.Uri; |
This file contains 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
/// found nothing better than this | |
/// https://github.com/flutter/flutter/blob/master/packages/flutter/test/widgets/hyperlink_test.dart#L47 | |
/// sooo... | |
extension WidgetTesterRichEditExtension on WidgetTester { | |
Iterable<InlineSpan> findTextSpans( | |
Finder richTextFinder, bool Function(InlineSpan) predicate) { | |
final richText = widget<RichText>(richTextFinder); | |
expect(richText.text, isInstanceOf<TextSpan>()); | |
final TextSpan innerText = richText.text; | |
return innerText.children.where(predicate); |
This file contains 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 io.flutter.embedding.android.FlutterActivity // there are two FlutterActivities :| | |
import io.flutter.plugins.GeneratedPluginRegistrant // this is not seen by IntelliJ by works ¯\_(ツ)_/¯ | |
typealias FlutterCallback = (methodCall: MethodCall, result: MethodChannel.Result) -> Unit | |
class FlutterPathActivity : FlutterActivity() { | |
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { | |
infix fun String.handles(callHandler: FlutterCallback) { | |
MethodChannel(flutterEngine.dartExecutor, this).setMethodCallHandler(callHandler) | |
} |
This file contains 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
#!/bin/sh | |
# Makes the bash script to print out every command before it is executed except echo | |
trap '[[ $BASH_COMMAND != echo* ]] && echo $BASH_COMMAND' DEBUG | |
echo "Executing steps to repro issue #37852" | |
echo "https://github.com/flutter/flutter/issues/37852" | |
echo "MAKE SURE YOU'RE ON MASTER CHANNEL!" | |
echo "MAKE SURE YOU HAVE iOS SIMULATOR RUNNING" |
NewerOlder