title: Flutter Bloc How to update Widget in BlocBuilder from the Widget itself?
body: <p>How can to update a Bloc widget from the bloc Widget itself with the Slider?</p>
  <p>The Event for the Chart Data is executed from another Widget.
  When the data is fetched this Widget is opened.
  When I change the Slider I want the chart to be updated withe the date but keep the other data.
  Would be too much to fetch all the Data again.</p>
  <p>How can I get access only the data changed from the same widget?</p>
  <p>I have the following Bloc Builder Widget, bloc_event, bloc and bloc_state</p>
  <p>The Widget:</p>
  <pre><code>class ChartWidget extends StatelessWidget {
  ChartWidget({Key key}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
  
  double valueSliderDate;
  return BlocBuilder&lt;ChartDataBloc, ChartDataState&gt;(
    builder: (context, state) {
      if (state is ChartDataLoadInProgress) {
        return LoadingIndicator();
      } else if (state is ChartDataLoadSuccess) {
        final chartData = state.chartData;
        final maxValueAll = getMaxValueAll(chartData);
        final List&lt;double&gt; dates = getValuesDate(chartData);
        valueSliderDate = dates.first;
  
        return Column(children: &lt;Widget&gt;[
          
          Expanded(
            child: MyFancyChart(chartData, valueSliderDate),
          ),
          Slider(
            min: dates.first,
            max: dates.last,
             divisions: dates.length,
             value: valueSliderDate,
            onChanged: (value) {
              context.read&lt;ChartDataBloc&gt;().add(DateSliderSet(value));
            },
          ),
        ]);
      } else {
        return Container();
      }
    },
  );
  }
  </code></pre>
  <p>This is the bloc_event with two events:</p>
  <pre><code>abstract class ChartDataEvent {
  const ChartDataEvent();
  @override
  List&lt;Object&gt; get props =&gt; [];  }
  
  class SpecificIndicatorIdSet extends ChartDataEvent {
  const SpecificIndicatorIdSet(this.indicator);
  final Indicator indicator;
  
  @override
  List&lt;Object&gt; get props =&gt; [indicator];  }
  
  class DateSliderSet extends ChartDataEvent {
  const DateSliderSet(this.dateSlider);
  final double dateSlider;
  
  @override
  List&lt;Object&gt; get props =&gt; [dateSlider];  }
  </code></pre>
  <p>This is the bloc itself:</p>
  <pre><code>class ChartDataBloc extends Bloc&lt;ChartDataEvent, ChartDataState&gt; {
  final ChartDataRepository chartDataRepository;
  ChartDataBloc({@required this.chartDataRepository}) : super(ChartDataLoadInProgress());
  
  @override
  Stream&lt;ChartDataState&gt; mapEventToState(ChartDataEvent event) async* {
  if (event is SpecificIndicatorIdSet) {
  yield* _mapIndicatorsLoadedToState(event);
  } else if (event is DateSliderSet) {
  yield* _mapDateSliderToState(event);  }    }
  
  Stream&lt;ChartDataState&gt; _mapDateSliderToState(
    DateSliderSet event
    ) async* {
  try {
    final dateSlider = event.dateSlider;
    yield DateSliderLoadSuccess(
      dateSlider,
    );
  } catch (_) {
    yield DateSliderLoadFailure();  }   }
  
  Stream&lt;ChartDataState&gt; _mapIndicatorsLoadedToState(
    SpecificIndicatorIdSet event
    ) async* {
  try {
    final chartData = await this.chartDataRepository.loadChartData(event.indicator.id);
    yield ChartDataLoadSuccess(
      sortToListOfLists(chartData),
      event.indicator.name
    );
  } catch (_) {
    yield ChartDataLoadFailure();  }  }  }
  </code></pre>
  <p>This is the bloc_state:</p>
  <pre><code>abstract class ChartDataState {
  const ChartDataState();
  @override
  List&lt;Object&gt; get props =&gt; [];  }
  
  class ChartDataLoadInProgress extends ChartDataState {}
  
  class ChartDataLoadSuccess extends ChartDataState {
  final List&lt;List&lt;ChartData&gt;&gt; chartData;
  final String titleIndicator;
  const ChartDataLoadSuccess(this.chartData,this.titleIndicator);
  
  @override
  List&lt;Object&gt; get props =&gt; [chartData, titleIndicator];
  
  @override
  String toString() =&gt; 'ChartDataLoadSuccess { topics: ' + chartData + ' }';  }
  
  class ChartDataLoadFailure extends ChartDataState {}
  
  class DateSliderLoadSuccess extends ChartDataState {
  final double dateSlider;
  const DateSliderLoadSuccess(this.dateSlider);
  
  @override
  List&lt;Object&gt; get props =&gt; [dateSlider];
  
  @override
  String toString() =&gt; 'DateSliderLoadSuccess { dateSlider: ' + dateSlider.toString() + ' }';  
  }
  
  class DateSliderLoadFailure extends ChartDataState {}
  </code></pre>
  <p>Thanks in advance</p>