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

A form package in conversation format.

Form Conversation #

Pub dev Coverage Status

Overview #

A package to create forms in conversation format.

Screenshots #

print screen print screen

Usage #

To use it, just create a widget and implement FormConversation passing a controller FormController and the form Items.

import 'package:form_conversation/form_conversation.dart';

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

  final FormController controller = FormController();

  @override
  Widget build(BuildContext context) {
    return FormConversation(
        controller: controller,
        formItems: [
            FormMessage(
                text: 'Olá! 😃',
                delay: 1000,
            ),
            FormMessage(
                text: 'Que bom ver você aqui!',
            ),
            FormAction(
                tag: 'name',
                name: 'Nome',
                text: 'Digite seu nome',
                edit: true,
                builder: (context, tag, edit) {
                    return FormTextFieldAndButton(
                        tag: tag,
                        edit: edit,
                        hintText: 'Digite seu nome',
                        autovalidateMode: AutovalidateMode.onUserInteraction,
                        validator: (value) {
                            if (value != null && value.length <= 3) {
                            return '';
                            }
                            return null;
                        },
                        formController: controller,
                    );
                },
            ),
        ]
    );
  }
}

5
likes
70
pub points
23%
popularity

Publisher

verified publisherfelipe.li

A form package in conversation format.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on form_conversation