form_builder_image_picker 0.1.1 copy "form_builder_image_picker: ^0.1.1" to clipboard
form_builder_image_picker: ^0.1.1 copied to clipboard

outdated

Field for picking image(s) from Gallery or Camera for flutter_form_builder package

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:form_builder_image_picker/form_builder_image_picker.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  final _formKey = GlobalKey<FormBuilderState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('FormBuilderImagePicker Example'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Center(
          child: FormBuilder(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                FormBuilderImagePicker(
                  name: 'photos',
                  decoration: const InputDecoration(labelText: 'Pick Photos'),
                  maxImages: 1,
                ),
                const SizedBox(height: 15),
                RaisedButton(onPressed: () {
                  if (_formKey.currentState.saveAndValidate()) {
                    print(_formKey.currentState.value);
                  }
                })
              ],
            ),
          ),
        ),
      ),
    );
  }
}
78
likes
0
points
2.96k
downloads

Publisher

verified publisherflutterformbuilderecosystem.com

Weekly Downloads

Field for picking image(s) from Gallery or Camera for flutter_form_builder package

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_form_builder, image_picker, image_picker_for_web

More

Packages that depend on form_builder_image_picker