Cloud Functionsまで含めてDartに統一するFlutterアプリのアーキテクチャーについて、AIに相談した結果メモ(現時点では未検証):
Dart 3.5の Dart Workspaces をインフラの主軸とし、バックエンド(Cloud Functions)には公式の firebase_admin_sdk を採用。フロントエンドの「Feature-first(機能駆動)」と、バックエンドの「データグラフの集約」を完璧に両立させる構成です。
| import subprocess | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| # 1. Gitのコミット履歴を抽出 | |
| print("Extracting commit logs...") | |
| result = subprocess.run(['git', 'log', '--date=short', '--format=%ad'], capture_output=True, text=True, check=True) | |
| commits = result.stdout.strip().split('\n') | |
| # 2. データフレームの作成と集計 |
| targets: | |
| $default: | |
| builders: | |
| freezed: | |
| options: | |
| map: false | |
| map_or_null: false | |
| maybe_map: false | |
| when: false | |
| when_or_null: false |
| import * as logger from 'firebase-functions/logger' | |
| import { defineSecret } from 'firebase-functions/params' | |
| import { HttpsError, onRequest } from 'firebase-functions/v2/https' | |
| const secretKey = defineSecret('convertMapSecretKey') | |
| const googleMapsApiKey = defineSecret('convertMapGoogleMapsApiKey') | |
| async function getFtidFromShortUrl(shortUrl: string): Promise<string> { | |
| const response = await fetch(shortUrl, { | |
| method: 'GET', |
| import 'dart:collection'; | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_hooks/flutter_hooks.dart'; | |
| import 'package:intl/intl.dart'; | |
| void main() => runApp(const App()); |