flutter_flunt 0.1.0+1 copy "flutter_flunt: ^0.1.0+1" to clipboard
flutter_flunt: ^0.1.0+1 copied to clipboard

Library that provides widgets to make it easier to use Flunt-dart in the flutter.

example/example.dart

import 'package:flutter/material.dart';
import 'package:flutter_flunt/flutter_flunt.dart';
import 'package:flunt_dart/flunt_dart.dart';

class NameContract extends Contract<String> {
  NameContract(String value, String name) : super(value, name) {
      isNotEmpty("not should be empty");
      hasMaxLen(40, "should have no more than 40 chars");
      hasMinLen(3, "should have at least 3 chars");
  }
}

class FormExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
     body: Form(
       child: Column(children: <Widget>[
         FluntTextFormField(
           contract: (String value) => NameContract(value, "Name"),
         ),
       ],)
     ),
    );
  }
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Library that provides widgets to make it easier to use Flunt-dart in the flutter.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flunt_dart, flutter

More

Packages that depend on flutter_flunt