Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Make Hello + first name + last name in the same line – Flutter

I don’t know what is wrong here, it’s pretty easy to solve but you already know stupid things happened while coding ..

I’m trying to make the Hello First name Last name in the same line, but can’t think anymore, what shall i do please? and thanks in advance.

code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

@override
  Widget build(BuildContext context) {
    return NefertitiSheetView(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            S.of(context).welcome_hello,
            style: Theme.of(context).textTheme.titleMedium,
          ),
          BlocBuilder<RiderProfileCubit, GetCurrentOrder$Query$Rider?>(
            builder: (context, state) {
              return Text(
                "${state?.firstName != null ? " ${state!.firstName!} ${state!.lastName!}" : ""}!",
                style: Theme.of(context).textTheme.labelMedium,
              );
            },
          ).pOnly(bottom: 2),

Photo:
enter image description here

>Solution :

Wrap both elements inside a Row. They are just in a Column right now.

Row(
children: [
Text(
            S.of(context).welcome_hello,
            style: Theme.of(context).textTheme.titleMedium,
          ),
          BlocBuilder<RiderProfileCubit, GetCurrentOrder$Query$Rider?>(
            builder: (context, state) {
              return Text(
                "${state?.firstName != null ? " ${state!.firstName!} ${state!.lastName!}" : ""}!",
                style: Theme.of(context).textTheme.labelMedium,
              );
            },
          ).pOnly(bottom: 2),
],
),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading