loading_indicator icon indicating copy to clipboard operation
loading_indicator copied to clipboard

Color change does't work with BlocBuilder

Open ADeVNooN opened this issue 4 years ago • 1 comments

BlocBuilder<UnitsCalculationsManagementCubit, UnitsCalculationManagementModel>(
                                  builder: (context, state) {
                                    print(state.instanceState == UnitsCalculationManagementStates.error);
                                    if(state.instanceState == UnitsCalculationManagementStates.textEmpty || state.instanceState == UnitsCalculationManagementStates.error) {
                                      return LoadingIndicator(
                                        indicatorType: Indicator.ballBeat,
                                        // COLOR CHANGE DOESN'T CHANGE
                                        colors: state.instanceState == UnitsCalculationManagementStates.textEmpty ? [Theme.of(context).primaryColor.withOpacity(0.3)] : [Colors.red],
                                        // BACKGROUNDCOLOR CHANGES
                                        backgroundColor: state.instanceState == UnitsCalculationManagementStates.textEmpty ? Theme.of(context).primaryColor.withOpacity(0.3) : Colors.red,
                                      );
                                    } else {
                                      return Container();
                                    }
                                  }
                              ),

I don't excatly why it happens. Background color works with custom rebuilder. I don't have too much time to analyse the source code of the extension but I assume the Widget already rebuilds itself that's why there's a problem.

ADeVNooN avatar May 11 '22 01:05 ADeVNooN

fixed in 3.0.4

TinoGuo avatar May 12 '22 15:05 TinoGuo