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 'dart:async'; | |
class Router {} | |
final _controller = StreamController<Router>.broadcast(); | |
/// [Router]イベントを監視するmixin | |
mixin RouteEventObserver<R extends Router> { | |
StreamSubscription<Router>? _subscription; |
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
final logger = Logger( | |
output: CrashlyticsLogger(), | |
printer: PrettyPrinter( | |
methodCount: 1, | |
errorMethodCount: 5, | |
dateTimeFormat: DateTimeFormat.onlyTimeAndSinceStart, | |
), | |
); |
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/bash | |
# 以下のようなディレクトリ構成で作成されているプロジェクト用 | |
# pubspec.yaml | |
# lib/src/aaa/bbb.dart | |
if [ ! -f pubspec.yaml ]; then | |
echo "このスクリプトはDartパッケージのルートディレクトリで実行してください。pubspec.yamlが見つかりません。" | |
exit 1 | |
fi |
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/bash | |
# GraphQLの関数実装漏れをチェックするスクリプト | |
# | |
# 例えば、以下のようなスキーマファイルがある場合 | |
# | |
# // schema.graphql | |
# type Mutation { | |
# postUser(name: String!): User! | |
# } |
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
# based: https://stackoverflow.com/a/67000032 | |
# ghコマンドのセッションチェック | |
gh auth status >/dev/null | |
if [ $? -ne 0 ]; then | |
echo "Please login to GitHub with gh command." | |
exit 1 | |
fi | |
# org, repo を引数から取得する |
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
#!/usr/bin/env bash | |
PUBSPEC_FILE_NAME='pubspec.yaml' | |
echo '------------------------------------' | |
echo '-- flutter clean' | |
echo $(pwd) | |
# .dart_tool を除いたプロジェクトフォルダ内の $PUBSPEC_FILE_NAME が格納されているディレクトリ一覧を取得 | |
PUB_SPEC_DIRS=$(find "$(pwd)" \ |
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
@Suppress("DEPRECATION") | |
@SuppressLint("PackageManagerGetSignatures") | |
fun getSignature(algorithm: String): String { | |
fun byteArrayToReadableString(array: ByteArray, delimiter: String = ":"): String { | |
return array.joinToString(delimiter) { | |
var str = Integer.toHexString(it.toInt()) | |
str = (if (str.length == 1) "0$str" else str).replace("ff", "") | |
if (str.isEmpty()) str = "FF" | |
str.uppercase(Locale.getDefault()) | |
} |
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
fun Context.loadFileFromAssets(fileName: String): File { | |
return File(cacheDir, fileName) | |
.also { | |
if (it.exists()) it.delete() | |
it.outputStream().use { cache -> | |
assets.open(fileName).use { inputStream -> | |
inputStream.copyTo(cache) | |
} | |
} | |
} |
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
/** | |
* ここから始まる | |
* @param {string} appName - アプリ名 | |
* @param {string} fromAddress - 送信元アドレス | |
* @param {string} slackChannelName - 投稿先チャンネル名 | |
* @param {string} slackMessageIcon - 投稿メッセージアイコン | |
* @param {string} slackMessageUserName - 投稿者名 | |
* @param {string} webhookUrl - 投稿スペースのWebhookUrl | |
*/ |
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
/* | |
pubspec.yaml | |
dependencies: | |
flutter_inappwebview: 5.5.0 | |
http: ^0.13.5 | |
*/ | |
// https://developer.yahoo.co.jp/yconnect/v2/authorization_code/ |
NewerOlder