Home > Back-end >  Need to add spacing between the two row values
Need to add spacing between the two row values

Time:10-02

BlocBuilder<VoiceChatCubit, VoiceChatState>(
        buildWhen: (previous, current) =>
            previous.myClientRole != current.myClientRole,
        builder: (context, state) {
          return Row(
            children: [
              if (state.myClientRole == ClientRole.Broadcaster)
                InkWell(
                  onTap: context.read<VoiceChatCubit>().toggleMute,
                    child: 
                    Container(
                    decoration: BoxDecoration(
                      boxShadow: [
                        BoxShadow(
                          color: Colors.grey,
                          offset: const Offset(
                            0,
                            3.0,
                          ),
                          blurRadius: 1.0,
                          spreadRadius: 1.0,
                        ),
                   
                  

Need to add spacing between the two values in the row over here. Tried mainaxisalignment didn't work, also Space() in case I could add spacing between the two values but don't know where to add them.

CodePudding user response:

You can use

Padding(padding: EdgeInsets.all(10)) 

where you want the spacing to appear.

CodePudding user response:

Can you try the below code?

return  Container(
            width: MediaQuery.of(context).size.width;
    child:Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           children: [
              if (state.myClientRole == ClientRole.Broadcaster)
                InkWell(
                  onTap: context.read<VoiceChatCubit>().toggleMute,
                    child: 
                    Container(
                    decoration: BoxDecoration(
                      boxShadow: [
                        BoxShadow(
                          color: Colors.grey,
                          offset: const Offset(
                            0,
                            3.0,
                          ),
                          blurRadius: 1.0,
                          spreadRadius: 1.0,
                        ),
  • Related