Home > Enterprise >  How can I achieve this task in flutter? [closed]
How can I achieve this task in flutter? [closed]

Time:10-09

I am new in flutter and trying to achieve this task by Row() but not able to complete it.

Please check screenshot

CodePudding user response:

This can be achieved by using a Stack widget. The Stack widget basically places all its children over each other. The code can look something like this:

Stack(
  children: [
    Divider(),
    Container(
      color: Colors.white,
      child: Text('or sign in with'),
    ),
  ],
);

CodePudding user response:

You can use a row and Expanded around the Dividers to avoid overflowing.

Row(
      children: [
        Expanded(child: Divider()),
        Text('Some Text'),
        Expanded(child: Divider()),
      ],
    );
  • Related