- name
SKILL.md
Tệp skill vẫn nằm trong kho mã của nhà phát hành.
Dán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add evanca/flutter-ai-rules --skill firebase-cloud-functions -a cursor -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add evanca/flutter-ai-rules --skill firebase-cloud-functions -a claude-code -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add evanca/flutter-ai-rules --skill firebase-cloud-functions -a codex -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add evanca/flutter-ai-rules --skill firebase-cloud-functions -a grok -yGửi tin nhắn đã sao chép trong cuộc trò chuyện Grok Bot. Bot sẽ lấy tệp SKILL.md này từ GitHub và thêm vào bộ skill mà mọi Bot của bạn dùng chung.
Install this skill: https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/firebase-cloud-functionsTừ nhà phát hành
This skill defines how to correctly call Firebase Cloud Functions from Flutter applications.
Use this skill when:
flutter pub add cloud_functions
import 'package:cloud_functions/cloud_functions.dart';
// After Firebase.initializeApp():
final functions = FirebaseFunctions.instance;
final functions = FirebaseFunctions.instanceFor(region: 'europe-west1');
Use httpsCallable to reference a function, then call to invoke it:
final result = await FirebaseFunctions.instance
.httpsCallable('functionName')
.call(data);
Map — it is automatically serialized to JSON:final result = await FirebaseFunctions.instance
.httpsCallable('addMessage')
.call({
"text": messageText,
"push": true,
});
data property — it is automatically deserialized from JSON:final responseData = result.data;
// Cast to expected type if needed:
final message = result.data as Map<String, dynamic>;
final status = message['status'] as String;
Always wrap function calls in try-catch and check for FirebaseFunctionsException:
try {
final result = await FirebaseFunctions.instance
.httpsCallable('functionName')
.call(data);
// Handle successful result
} on FirebaseFunctionsException catch (e) {
switch (e.code) {
case 'not-found':
// Function does not exist
break;
case 'permission-denied':
// User lacks permission
break;
case 'unavailable':
// Service temporarily unavailable — retry
break;
default:
debugPrint('Function error [${e.code}]: ${e.message}');
}
} catch (e) {
debugPrint('Unexpected error: $e');
}
unavailable, deadline-exceeded).Set a timeout appropriate to the expected execution time:
final callable = FirebaseFunctions.instance.httpsCallable(
'functionName',
options: HttpsCallableOptions(
timeout: const Duration(seconds: 30),
),
);
Use the Firebase Emulator Suite for local development and testing:
FirebaseFunctions.instance.useFunctionsEmulator('localhost', 5001);
Use when calling callable functions (httpsCallable), passing data to server-side logic, handling function errors/timeouts, configuring regions, or testing with the Emulator Suite.
---name: firebase-cloud-functionsdescription: Use when calling callable functions (httpsCallable), passing data to server-side logic, handling function…---# skills/firebase-cloud-functions/SKILL.mdCâu hỏi thường gặp
Tải skills/firebase-cloud-functions/SKILL.md từ nhà phát hành, hoặc sao chép đường dẫn và mở kho mã. PlugMCP chỉ liệt kê skill và không lưu trữ tệp này.
Nhà phát hành duy trì nó tại https://github.com/evanca/flutter-ai-rules.
Claude, Cursor, Codex và Grok Build có thể đọc tệp SKILL.md mà bạn thêm từ kho mã của nhà phát hành. Grok Bot cài đặt skill khi bạn gửi liên kết thư mục GitHub của skill trong cuộc trò chuyện.