一键导入
widget-tester-scaffolder
Automatically generates a baseline Widget Test file for a given UI screen, wrapping it in a MaterialApp to prevent context errors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automatically generates a baseline Widget Test file for a given UI screen, wrapping it in a MaterialApp to prevent context errors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Sweeps the `assets/` folder and registers them in `pubspec.yaml`, preventing runtime "Asset not found" crashes.
Executes `dart run build_runner build -d` to generate code for packages like Freezed, JSON Serializable, and Riverpod.
Applies Dart fixes and formats Dart code according to standard guidelines.
Generates a standard Domain-Driven Design (DDD) feature-first directory structure inside the `lib` folder.
Configures and runs the `flutter_launcher_icons` package to generate native app icons for iOS and Android.
Safely modifies `AndroidManifest.xml` and `Info.plist` to add native permissions (e.g., Camera, Location, Storage).
| name | widget-tester-scaffolder |
| description | Automatically generates a baseline Widget Test file for a given UI screen, wrapping it in a MaterialApp to prevent context errors. |
When the developer asks to test a widget or screen (e.g., "Create a test for the LoginScreen"):
test/ directory matching the source path.testWidgets block.MaterialApp and a Scaffold (if it doesn't already have one) when calling tester.pumpWidget() to avoid "No Material widget found" or "No MediaQuery found" errors.Example Template:
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
// Import the widget to test here
void main() {
testWidgets('Renders MyWidget correctly', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: MyWidget(),
),
),
);
// Add expectations here
expect(find.byType(MyWidget), findsOneWidget);
});
}
Inform the user where the test was created and remind them to add their specific mock dependencies or expectations.