Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkField #100

Closed
LucaGabi opened this issue Jul 25, 2019 · 3 comments
Closed

LinkField #100

LucaGabi opened this issue Jul 25, 2019 · 3 comments
Labels
invalid This doesn't seem right wontfix This will not be worked on

Comments

@LucaGabi
Copy link

Hi, if I need a link for the switch button to go to terms & conditions what should I use ?

@danvick
Copy link
Collaborator

danvick commented Jul 25, 2019

A link as an input sounds interesting.
You can try this:

FormBuilderCheckbox(
    attribute: 'accept_terms',
    initialValue: false,
    leadingInput: true,
    label: RichText(
        text: TextSpan(
           children: [
               TextSpan(
                    text: 'I have read and agree to the ',
                    style: TextStyle(color: Colors.black),
              ),
              TextSpan(
                   text: 'Terms and Conditions',
                   style: TextStyle(color: Colors.blue),
                   recognizer: TapGestureRecognizer()..onTap = () {print("launch url");},
              ),
           ],
        ),
    ),
    validators: [
        FormBuilderValidators.requiredTrue(
            errorText: "You must accept terms and conditions to continue",
        ),
   ],
),

@danvick
Copy link
Collaborator

danvick commented Jul 25, 2019

If you need a custom type of input then consider using a FormBuilderCustomField

@LucaGabi
Copy link
Author

Thanks! I'll look.

@danvick danvick added invalid This doesn't seem right wontfix This will not be worked on labels Aug 21, 2019
@danvick danvick closed this as completed Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants