loading_indicator
loading_indicator copied to clipboard
Color change does't work with BlocBuilder
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.
fixed in 3.0.4