بنقرة واحدة
flutter-video-app
橘子剧场 Flutter 视频应用开发规范。Invoke when: 1) 创建新的视频相关页面或组件 2) 处理视频播放功能 3) 实现视频列表/详情/筛选功能 4) 添加广告或会员功能
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
橘子剧场 Flutter 视频应用开发规范。Invoke when: 1) 创建新的视频相关页面或组件 2) 处理视频播放功能 3) 实现视频列表/详情/筛选功能 4) 添加广告或会员功能
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create or update minimal AGENTS.md files in the repository root and nested module directories using progressive disclosure. Works across heterogeneous projects without assuming any fixed agent folder structure.
Code review excellence guidelines and best practices. Invoke when reviewing code, ensuring code quality, identifying bugs, improving performance, and maintaining code standards.
Complete guide for using drift database library in Dart applications (CLI, server-side, non-Flutter). Use when building Dart apps that need local SQLite database storage or PostgreSQL connection with type-safe queries, reactive streams, migrations, and efficient CRUD operations. Includes setup with sqlite3 package, PostgreSQL support with drift_postgres, connection pooling, and server-side patterns.
Build adaptive and responsive Flutter UIs that work beautifully across all platforms and screen sizes. Use when creating Flutter apps that need to adapt layouts based on screen size, support multiple platforms including mobile tablet desktop and web, handle different input devices like touch mouse and keyboard, implement responsive navigation patterns, optimize for large screens and foldables, or use Capability and Policy patterns for platform-specific behavior.
Comprehensive guide for implementing animations in Flutter. Use when adding motion and visual effects to Flutter apps: implicit animations (AnimatedContainer, AnimatedOpacity, TweenAnimationBuilder), explicit animations (AnimationController, Tween, AnimatedWidget/AnimatedBuilder), hero animations (shared element transitions), staggered animations (sequential/overlapping), and physics-based animations. Includes workflow for choosing the right animation type, implementation patterns, and best practices for performance and user experience.
Flutter HTTP API 集成规范。Invoke when: 1) 添加新的 API 接口 2) 处理网络请求 3) 实现数据缓存 4) 处理请求错误
| name | flutter-video-app |
| description | 橘子剧场 Flutter 视频应用开发规范。Invoke when: 1) 创建新的视频相关页面或组件 2) 处理视频播放功能 3) 实现视频列表/详情/筛选功能 4) 添加广告或会员功能 |
dio: ^5.8.0+1 # HTTP 请求
video_player: ^2.9.3 # 视频播放
fplayer: ^1.1.3 # 播放器
provider: ^6.1.5 # 状态管理
get: ^4.7.2 # 路由管理
shared_preferences: ^2.5.3 # 本地存储
sqlite3: ^2.7.5 # 数据库
event_bus: ^2.0.1 # 事件总线
flutter_unionad: ^2.1.12 # 广告 SDK
tdesign_flutter: ^0.2.4 # UI 组件库
lib/
├── main.dart # 应用入口
├── api/ # API 接口定义
├── components/ # 公共组件
│ ├── common/ # 通用组件
│ ├── video_*.dart # 视频相关组件
│ └── banner_ads.dart # 广告组件
├── db/ # 数据库
│ ├── entity/ # 数据实体
│ └── manager/ # 数据库管理
├── entity/ # 业务实体
├── generated/json/ # JSON 序列化
├── http/ # HTTP 拦截器
├── services/ # 服务层
├── style/ # 样式定义
├── utils/ # 工具类
│ └── store/ # 状态存储
└── views/ # 页面视图
snake_case.dart (如: video_detail.dart)snake_case.dart (如: video_player.dart)snake_case_entity.dart (如: video_entity.dart)snake_case.dart (如: date_util.dart)PascalCase + 后缀 (如: VideoDetailPage, HomePage)PascalCase (如: VideoPlayerWidget)PascalCase + Entity (如: VideoEntity)PascalCase + Util (如: DateUtil)使用 Provider + GetX 混合模式:
// 状态定义
class UserState extends ChangeNotifier {
UserEntity? _user;
UserEntity? get user => _user;
void setUser(UserEntity user) {
_user = user;
notifyListeners();
}
}
// 页面使用
class MyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (_) => UserState(),
child: _MyPageContent(),
);
}
}
// 统一使用封装的 Request 类
import 'package:flutter_app/http/request.dart';
class VideoApi {
static Future<VideoEntity> getVideoDetail(int id) async {
final response = await Request.get('/video/detail', params: {'id': id});
return VideoEntity.fromJson(response.data);
}
}
// 视频播放组件
class VideoPlayerWidget extends StatefulWidget {
final String url;
final bool autoPlay;
const VideoPlayerWidget({
Key? key,
required this.url,
this.autoPlay = false,
}) : super(key: key);
@override
State<VideoPlayerWidget> createState() => _VideoPlayerWidgetState();
}
// 使用 flutter_unionad
import 'package:flutter_unionad/flutter_unionad.dart';
class BannerAdsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlutterUnionadBannerView(
androidCodeId: AdsConfig.bannerId,
iosCodeId: AdsConfig.bannerId,
width: 300,
height: 150,
);
}
}
// 使用 sqlite3
class VideoHistoryHelper {
static final VideoHistoryHelper _instance = VideoHistoryHelper._internal();
factory VideoHistoryHelper() => _instance;
VideoHistoryHelper._internal();
Future<void> insertHistory(VideoEntity video) async {
final db = await DBManager().database;
// 实现插入逻辑
}
}
import 'package:flutter/material.dart';
import 'package:flutter_app/style/color_styles.dart';
import 'package:flutter_app/style/layout.dart';
import 'package:flutter_app/components/loading.dart';
class NewPage extends StatefulWidget {
const NewPage({Key? key}) : super(key: key);
@override
State<NewPage> createState() => _NewPageState();
}
class _NewPageState extends State<NewPage> {
bool _isLoading = true;
@override
void initState() {
super.initState();
_initData();
}
Future<void> _initData() async {
// 初始化数据
setState(() => _isLoading = false);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorStyles.background,
appBar: AppBar(
title: Text('页面标题'),
backgroundColor: ColorStyles.primary,
),
body: _isLoading
? LoadingWidget()
: _buildContent(),
);
}
Widget _buildContent() {
return Container();
}
}
ColorStyles 定义的颜色assets/images/ 目录