super_form 1.0.0 copy "super_form: ^1.0.0" to clipboard
super_form: ^1.0.0 copied to clipboard

outdated

Quick, familiar and extensible forms in Flutter. No magical configuration required. Comes with form widgets, error text and many validation rules.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:super_form_example/sign_up/sign_up.dart';
import 'package:super_form_example/survey/survey.dart';

import 'burritox/burritox.dart';

void main() {
  runApp(ExamplesApp());
}

/// Entrypoint for the super SuperForm examples.
///
/// Visit https://superform.dev
class ExamplesApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      restorationScopeId: "example_app",
      title: 'Super Form Demo',
      onGenerateRoute: (routeSettings) {
        switch (routeSettings.name) {
          case "sign_up":
            return MaterialPageRoute(builder: (_) => const SignUpPage());
          case "burritox":
            return MaterialPageRoute(
              builder: (_) => Theme(
                data: ThemeData(primarySwatch: Colors.deepOrange),
                child: const Burritox(),
              ),
            );
          case "survey":
            return MaterialPageRoute(
              builder: (_) => Theme(
                data: ThemeData(primarySwatch: Colors.green),
                child: const SurveyPage(),
              ),
            );
        }
      },
      home: Scaffold(
        appBar: AppBar(
          title: const Text(
            "SuperForm examples library 📕",
          ),
        ),
        body: Builder(
          builder: (context) => ListView(
            children: [
              ListTile(
                title: const Text("Sign Up"),
                subtitle:
                    const Text("Classic sign up form with gradual validation"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("sign_up");
                },
              ),
              ListTile(
                title: const Text("Survey"),
                subtitle: const Text(
                    "Survey with sliders, dynamic email field, navigation block and loading state"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("survey");
                },
              ),
              ListTile(
                title: const Text("Burritox"),
                subtitle: const Text(
                    "Takeaway order with checkboxes, dynamic rules and editing"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("burritox");
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
32
likes
0
points
58
downloads

Publisher

verified publisherpr0gramista.pl

Weekly Downloads

Quick, familiar and extensible forms in Flutter. No magical configuration required. Comes with form widgets, error text and many validation rules.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

equatable, flutter

More

Packages that depend on super_form