public ImageFileFormSetField(
            string title = null,
            string lead  = "",
            FormFieldSetter <List <string> > onSaved = null,
            List <string> initialValue = null,
            bool autovalidate          = false,
            bool enabled = true
            ) : base(
                onSaved: onSaved,
                initialValue: initialValue,
                autovalidate: autovalidate,
                enabled: enabled,
                builder: state =>
        {
            var list = new List <Widget> {
                new Card(
                    child: new Container(
                        width: 64f,
                        height: 64f,
                        child: new ConstrainedBox(
                            constraints: BoxConstraints.expand(),
                            child: new FlatButton(
                                onPressed: () => {
                    var ret = DataUploader.OpenFile(
                        lead,
                        "",
                        "png, jpg"
                        );

                    if (state.value == null)
                    {
                        state.didChange(new List <string> { ret });
                    }
                    else
                    {
                        state.value.Add(ret);
                        state.didChange(state.value);
                    }
                },
                                padding: EdgeInsets.all(0f),
                                child: new Icon(Icons.add)
                                )
                            )
                        )
                    )
            };
            if (state.value != null)
            {
                list.AddRange(
                    state
                    .value
                    .Select((path, i) => new Card(
                                child: new Container(
                                    width: 64f,
                                    height: 64f,
                                    child: new ConstrainedBox(
                                        constraints: BoxConstraints.expand(),
                                        child: new FlatButton(
                                            onPressed: () => {
                    var ret = DataUploader.OpenFile(
                        lead,
                        "",
                        "png, jpg"
                        );
                    state.value[i] = ret;
                    state.didChange(state.value);
                },
                                            padding: EdgeInsets.all(0f),
                                            child: Image.file(path)
                                            )
                                        )
                                    )
                                )
                            )
                    );
            }

            return(new Column(
                       crossAxisAlignment: CrossAxisAlignment.start,
                       mainAxisSize: MainAxisSize.max,
                       children: new List <Widget> {
                new Container(
                    margin: EdgeInsets.only(top: 8f),
                    height: string.IsNullOrEmpty(title) ? new float?(0f) : null,
                    width: float.MaxValue,
                    child: string.IsNullOrEmpty(title) ? null : new Text(title)
                    ),
                new Container(
                    height: 72f,
                    child: new ListView(
                        scrollDirection: Axis.horizontal,
                        children: list
                        )
                    )
            }
                       ));
        },
                validator: value => {
            return(null);
        }
                ) {}
 public ImageFileFormField(
     string title = null,
     string lead  = "",
     FormFieldSetter <string> onSaved = null,
     string initialValue = "",
     bool autovalidate   = false,
     bool enabled        = true
     ) : base(
         onSaved: onSaved,
         initialValue: initialValue,
         autovalidate: autovalidate,
         enabled: enabled,
         builder: state => new Column(
             crossAxisAlignment: CrossAxisAlignment.start,
             mainAxisSize: MainAxisSize.max,
             children: new List <Widget> {
     new Container(
         margin: EdgeInsets.only(top: 8f),
         height: string.IsNullOrEmpty(title) ? new float?(0f) : null,
         child: string.IsNullOrEmpty(title) ? null : new Text(title)
         ),
     new Card(
         child: new Container(
             width: 128,
             height: 128,
             child: new ConstrainedBox(
                 constraints: BoxConstraints.expand(),
                 child: new FlatButton(
                     onPressed: () => {
         var ret = DataUploader.OpenFile(
             lead,
             "",
             "png, jpg"
             );
         state.didChange(ret);
     },
                     padding: EdgeInsets.all(0f),
                     child: string.IsNullOrEmpty(state.value) ?
                     (Widget)(new Icon(Icons.add)) :
                     (Widget)Image.file(state.value)
                     )
                 )
             )
         ),
     new Container(
         height: string.IsNullOrEmpty(state.errorText) ? new float?(0f) : null,
         padding: EdgeInsets.only(top: 4f),
         child: new Text(
             state.errorText ?? "",
             style: new TextStyle(
                 color: Theme.of(state.context).errorColor
                 )
             )
         )
 }
             ),
         validator: value => {
     if (string.IsNullOrEmpty(value))
     {
         return("Please select an image.");
     }
     return(null);
 }
         ) {}