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

outdated

A Flutter plugin for easy form building.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  GlobalKey scaffoldKey = GlobalKey();
  @override
  Widget build(BuildContext context) {
    _submit(formData) async {
      showDialog(
        context: scaffoldKey.currentState.context,
        builder: (BuildContext context) {
          return AlertDialog(
            title: Text("Form Data"),
            content: Text(formData.toString()),
            actions: <Widget>[
              FlatButton(
                child: Text("Close"),
                onPressed: () {
                  Navigator.of(context).pop();
                },
              ),
            ],
          );
        },
      );
    }

    return MaterialApp(
      home: Scaffold(
        key: scaffoldKey,
        appBar: AppBar(
          title: const Text('XForm'),
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: XForm(submit: _submit, children: <Widget>[
            ListView(children: <Widget>[
              XTextField(
                name: "name",
                label: "Name",
              ),
              XTextField(
                name: "value",
                label: "Value",
              ),
            ]),
          ]),
        ),
      ),
    );
  }
}
4
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Flutter plugin for easy form building.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, intl, validate

More

Packages that depend on xform