axon_form_flutter 0.0.1 copy "axon_form_flutter: ^0.0.1" to clipboard
axon_form_flutter: ^0.0.1 copied to clipboard

A cross-platform Flutter plugin for building and rendering dynamic forms with configurable fields, validation, and file uploads.

example/lib/main.dart

import 'dart:convert';

import 'package:axon_form_flutter/axon_form_flutter.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Builder(
      builder: (context) {
        return MaterialApp(
          title: 'Axon Form Flutter Example App',
          home: const MyHomePage(),
        );
      },
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FutureBuilder<String>(
        future: DefaultAssetBundle.of(
          context,
        ).loadString('assets/example.json'),
        builder: (context, snapshot) {
          if (snapshot.connectionState != ConnectionState.done) {
            return const Center(child: CircularProgressIndicator());
          }
          if (snapshot.hasError || !snapshot.hasData) {
            return const Center(child: Text('Error loading form JSON'));
          }
          final formJson = jsonDecode(snapshot.data!);
          return SafeArea(
            bottom: false,
            child: AxonForm.json(
              formJson,
              onSubmit: (result) {},
              pageBuilder: (context, page, nodes, fieldBuilder) {
                return null;
              },
              pageNavigatorBuilder:
                  (context, pages, currentPage, pageCount, nextPage, prevPage) {
                    return null;
                  },
              fieldBuilder: (context, node) {
                return null;
              },
            ),
          );
        },
      ),
    );
  }
}
1
likes
140
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A cross-platform Flutter plugin for building and rendering dynamic forms with configurable fields, validation, and file uploads.

Homepage
Repository (GitHub)

License

unknown (license)

Dependencies

ffi, file_picker, flutter, flutter_web_plugins, intl, plugin_platform_interface, provider, web

More

Packages that depend on axon_form_flutter

Packages that implement axon_form_flutter