flutter_ai_forms 1.0.1
flutter_ai_forms: ^1.0.1 copied to clipboard
A provider-agnostic, schema-driven Flutter dynamic form engine for AI-generated interfaces, validation, conditional fields, and extensible widgets.
example/example.dart
import 'package:flutter/material.dart';
import 'package:flutter_ai_forms/flutter_ai_forms.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
final schema = FormSchema.fromJson({
"title": "Example Form",
"fields": [
{"id": "name", "type": "text", "label": "Full Name", "required": true},
{"id": "email", "type": "email", "label": "Email", "required": true}
]
});
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('flutter_ai_forms Example')),
body: AiForm(
schema: schema,
onSubmit: (result) => print(result.values),
),
),
);
}
}