title: How to manage form state with BLoC pattern?
body: <p>I am currently working on a side project to learn about Rx and BLoC pattern.</p>
  
  <p>I would like to manage the form state without using any <code>setState()</code>.</p>
  
  <p>I already have a BLoC that manage my 'events' which are stored in a SQLite db and added after validating this form.</p>
  
  <p>Do I need to create a need BLoC specifically for this UI part, and how ? Is it OK to keep a code like that ? Should I change my actual BLoC ?</p>
  
  <p>You can find my current code here :</p>
  
  <pre><code>class _EventsAddEditScreenState extends State&lt;EventsAddEditScreen&gt; {
    bool hasDescription = false;
    bool hasLocation = false;  
    bool hasChecklist = false;
  
    DateTime eventDate;
    TextEditingController eventNameController =  new TextEditingController();
    TextEditingController descriptionController =  new TextEditingController();
  
    @override
    Widget build(BuildContext context) {
      final eventBloc = BlocProvider.of&lt;EventsBloc&gt;(context);
      return BlocBuilder(
        bloc: eventBloc,
        builder: (BuildContext context, EventsState state) {
          return Scaffold(
            body: Stack(
              children: &lt;Widget&gt;[
                Column(children: &lt;Widget&gt;[
                  Expanded(
                      child: ListView(
                    shrinkWrap: true,
                    children: &lt;Widget&gt;[
                      _buildEventImage(context),
                      hasDescription ? _buildDescriptionSection(context) : _buildAddSection('description'),
                      _buildAddSection('location'),
                      _buildAddSection('checklist'),
                      //_buildDescriptionSection(context),
                    ],
                  ))
                ]),
                new Positioned(
                  //Place it at the top, and not use the entire screen
                  top: 0.0,
                  left: 0.0,
                  right: 0.0,
                  child: AppBar(
                    actions: &lt;Widget&gt;[
                      IconButton(icon: Icon(Icons.check), onPressed: () async{
                        if(this._checkAllField()){
                          String description = hasDescription ? this.descriptionController.text : null;
                          await eventBloc.dispatch(AddEvent(Event(this.eventNameController.text, this.eventDate,"balbla", description: description)));
                          print('Saving ${this.eventDate} ${eventNameController.text}');
                        }
                      },)
                    ],
                    backgroundColor: Colors.transparent, //No more green
                    elevation: 0.0, //Shadow gone
                  ),
                ),
              ],
            ),
          );
        },
      );
    }
  
    Widget _buildAddSection(String sectionName) {
      TextStyle textStyle = TextStyle(
          color: Colors.black87, fontSize: 18.0, fontWeight: FontWeight.w700);
      return Container(
        alignment: Alignment.topLeft,
        padding:
            EdgeInsets.only(top: 20.0, left: 40.0, right: 40.0, bottom: 20.0),
        child: FlatButton(
          onPressed: () {
            switch(sectionName){
              case('description'):{
                this.setState((){hasDescription = true;});
              }
              break;
              case('checklist'):{
                this.setState((){hasChecklist = true;});
              }
              break;
              case('location'):{
                this.setState((){hasLocation=true;});
              }
              break;
              default:{
  
              }
              break;
            }
          },
          padding: EdgeInsets.only(top: 0.0, left: 0.0),
          child: Text(
            '+ Add $sectionName',
            style: textStyle,
          ),
        ),
      );
    }
  </code></pre>