Flutterのサード・ステップ2
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>Flutter]]
--...[[Flutterの5thステップ]]
--[[Flutterのファースト・ステップ2]]
--[[Flutterのセカンド・ステップ2]]
--Flutterのサード・ステップ2
*目次 [#g1dc9c7a]
#contents
*概要 [#mc2d02da]
OAuth系認証・認可処理を実装し、序にReduxっぽい仕組みを導...
*詳細 [#u588d16a]
[[以前のバージョンではAppAuthで認証処理を実装していたが>F...
Windowsデスクトップ版を実装するにあたり問題が発生して、自...
**カスタムURLスキーム [#ud464fdb]
Windowsデスクトップ版でというのがポイント
***EXEの位置 [#r0b5cb7c]
以下の辺りにEXEがある。
\flutter_template\build\windows\x64\runner\Debug
***レジストリ登録 [#f47c687f]
-登録内容~
myapp.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\myapp]
@="URL:myapp Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\myapp\shell\open\command]
@="\"(絶対パスを記入)\\FrontendTemplates\\UI\\XPlat\\flu...
-各処理(PowerShell)
--登録~
myapp.regをダブルクリック
--テスト
start myapp://test
--解除
reg delete "HKEY_CLASSES_ROOT\myapp" /f
***ハンドラ [#he5a0ec1]
**インストール [#haf755e2]
***shared_preferences [#d55cba80]
Flutterでローカルストレージ的な機能を使用する。
flutter pub add shared_preferences
※ 既出だが、再掲。
***flutter_secure_storage [#xc302598]
Flutterでセキュアなローカルストレージ的な機能を使用する。
flutter pub add flutter_secure_storage
※ 一度、shared_preferences で提案されたコードを置き換える。
***crypto [#rc46caba]
認可リクエストでSHA256が必要になる。
dart pub add crypto
***url_launcher [#ke0fdd66]
Flutterからブラウザを起動する。
flutter pub add url_launcher
***app_links [#te3a3dfa]
FlutterからカスタムURLスキームを処理する。
flutter pub add app_links
**スクラッチ実装へ移行 [#e2b04299]
***共通関数 [#fe64fb92]
結局、まるッと移行した(AppAuthからスクラッチ実装に変更し...
-移行元
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
-移行先
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
***認証リクエスト [#m116730d]
方式としては、Reactと同じ様に、ヘッダーのSignIn要素定義フ...
-移行元:https://github.com/OpenTouryoProject/FrontendTem...
-移行先:https://github.com/OpenTouryoProject/FrontendTem...
***認証レスポンス [#i90ae3b5]
方式としては、カスタムURLスキームなのでmain.dartに処理を...
-移行元:https://github.com/OpenTouryoProject/FrontendTem...
-移行先:https://github.com/OpenTouryoProject/FrontendTem...
-追加:https://github.com/OpenTouryoProject/FrontendTempl...
※ ポイントとしては、
-Windowsのシングル・インスタンス対応
-Router・RedirectOfAuthを使用せず
-トークン取得完了をSignInウィジェットへ通知する処理を追加。
**Redux風 [#t9f36cac]
通知処理の実装でRedux対応を思い出した。Flutterの選択肢は...
***インストール [#hd96017e]
ValueNotifierはプリミティブ型のみだが、NotifierProviderは...
flutter pub add flutter_riverpod
***追加の定義 [#j945e514]
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
***処理の変更 [#da3b7f18]
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
*参考 [#v0d77f1a]
-FrontendTemplates/UI/XPlat at develop · OpenTouryoProjec...
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
終了行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>Flutter]]
--...[[Flutterの5thステップ]]
--[[Flutterのファースト・ステップ2]]
--[[Flutterのセカンド・ステップ2]]
--Flutterのサード・ステップ2
*目次 [#g1dc9c7a]
#contents
*概要 [#mc2d02da]
OAuth系認証・認可処理を実装し、序にReduxっぽい仕組みを導...
*詳細 [#u588d16a]
[[以前のバージョンではAppAuthで認証処理を実装していたが>F...
Windowsデスクトップ版を実装するにあたり問題が発生して、自...
**カスタムURLスキーム [#ud464fdb]
Windowsデスクトップ版でというのがポイント
***EXEの位置 [#r0b5cb7c]
以下の辺りにEXEがある。
\flutter_template\build\windows\x64\runner\Debug
***レジストリ登録 [#f47c687f]
-登録内容~
myapp.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\myapp]
@="URL:myapp Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\myapp\shell\open\command]
@="\"(絶対パスを記入)\\FrontendTemplates\\UI\\XPlat\\flu...
-各処理(PowerShell)
--登録~
myapp.regをダブルクリック
--テスト
start myapp://test
--解除
reg delete "HKEY_CLASSES_ROOT\myapp" /f
***ハンドラ [#he5a0ec1]
**インストール [#haf755e2]
***shared_preferences [#d55cba80]
Flutterでローカルストレージ的な機能を使用する。
flutter pub add shared_preferences
※ 既出だが、再掲。
***flutter_secure_storage [#xc302598]
Flutterでセキュアなローカルストレージ的な機能を使用する。
flutter pub add flutter_secure_storage
※ 一度、shared_preferences で提案されたコードを置き換える。
***crypto [#rc46caba]
認可リクエストでSHA256が必要になる。
dart pub add crypto
***url_launcher [#ke0fdd66]
Flutterからブラウザを起動する。
flutter pub add url_launcher
***app_links [#te3a3dfa]
FlutterからカスタムURLスキームを処理する。
flutter pub add app_links
**スクラッチ実装へ移行 [#e2b04299]
***共通関数 [#fe64fb92]
結局、まるッと移行した(AppAuthからスクラッチ実装に変更し...
-移行元
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
-移行先
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
***認証リクエスト [#m116730d]
方式としては、Reactと同じ様に、ヘッダーのSignIn要素定義フ...
-移行元:https://github.com/OpenTouryoProject/FrontendTem...
-移行先:https://github.com/OpenTouryoProject/FrontendTem...
***認証レスポンス [#i90ae3b5]
方式としては、カスタムURLスキームなのでmain.dartに処理を...
-移行元:https://github.com/OpenTouryoProject/FrontendTem...
-移行先:https://github.com/OpenTouryoProject/FrontendTem...
-追加:https://github.com/OpenTouryoProject/FrontendTempl...
※ ポイントとしては、
-Windowsのシングル・インスタンス対応
-Router・RedirectOfAuthを使用せず
-トークン取得完了をSignInウィジェットへ通知する処理を追加。
**Redux風 [#t9f36cac]
通知処理の実装でRedux対応を思い出した。Flutterの選択肢は...
***インストール [#hd96017e]
ValueNotifierはプリミティブ型のみだが、NotifierProviderは...
flutter pub add flutter_riverpod
***追加の定義 [#j945e514]
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
***処理の変更 [#da3b7f18]
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
-https://github.com/OpenTouryoProject/FrontendTemplates/b...
*参考 [#v0d77f1a]
-FrontendTemplates/UI/XPlat at develop · OpenTouryoProjec...
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
ページ名: