79238904

Date: 2024-11-30 06:00:05
Score: 1
Natty:
Report link

I agree with @youssef and @user17726418 answer, just adding extension to it if you are working with multiple states.

 BlocBuilder<UploadPhotoBloc, UploadPhotoState>(
      builder: (context, state) {
        if (state is UploadPhotosLoading) {
          return const LoadingButton();
        }
        return BlocBuilder<UserProfileBloc, UserProfileState>(
            builder: (context, state) {
          if (state is UserProfileLoading) {
            return const LoadingButton();
          } else {
            return CustomButton(
              title: 'Submit',
              onTapCallBack: () async {
                 // your logic
                },
               ),
            }
           })
        }),
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @youssef
  • User mentioned (0): @user17726418
  • Low reputation (1):
Posted by: Priyanshi Pandya