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,
                    );
                },
            ),
        ]
    );
  }
}

Libraries

form_conversation