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 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
import 'dart:math'; | |
// CustomColorは適宜置き換えてください | |
double degreeToRadian(double degree) => degree * pi / 180; | |
class GradientCircularProgressIndicator extends HookConsumerWidget { |
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
Show hidden characters
{ | |
"FlutterHookConsumerWidget": { | |
"scope": "dart", | |
"prefix": "hkw", | |
"body": [ | |
"import 'package:flutter/material.dart';", | |
"import 'package:hooks_riverpod/hooks_riverpod.dart';", | |
"", | |
"class ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/} extends HookConsumerWidget {", | |
"\tconst ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}({super.key});", |
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
// firebase authを使って、ログインユーザーが変わった時に何か取得する | |
export const Sample1: VFC = () => { | |
const [authState, setAuthState] = useState() | |
useEffect(() => { | |
if (!process.browser) return | |
let cancel = false | |
const unsubscribe = auth.onAuthStateChanged( | |
async firebaseUser => { |
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
// 元サイト: https://stripe.com/docs/error-codes | |
// ForkしたものをTypeScript形式にしただけ。エラーコードは足りてないものはあるはずなので元サイトを参考に追記が必要。 | |
const messsages = { | |
account_already_exists: 'アカウントがすでに存在します', | |
account_country_invalid_address: 'アカウントの国籍とビジネスを行う国籍が異なります', | |
account_invalid: 'アカウントが不正です', | |
account_number_invalid: '口座番号が不正です', | |
alipay_upgrade_required: 'Alipayのアップデートが必要です', | |
amount_too_large: '金額が多すぎます', | |
amount_too_small: '金額が少なすぎます', |
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
service cloud.firestore { | |
match /databases/{database}/documents { | |
match /groups/{groupID} { | |
allow get, update: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid); | |
match /users/{userID} { | |
allow read: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid); | |
} | |
match /boards/{boardID} { |
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
function getName(event){ | |
var queryString = event.queryString; | |
if(queryString && queryString.lastName){ | |
return queryString.lastName; | |
} | |
var body = JSON.parse(event.body); | |
if(body && body.firstName){ |