-1
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Center(
              child: CircleAvatar(
                radius: 40.0,
                child: Image.asset('images/pic.jpg'),
              ),
            ),
            Text(
              "michael dub",
            ),
            Text("FLUTTER DEVELOPER"),
            Container(
                width: 350.0,
                height: 70.0,
                child: Card(
                    child: Row(
                  children: <Widget>[
                    Icon(
                      Icons.phone,
                    ),
                    Text(
                      "+12-345-678-910",
                      textAlign: TextAlign.center,
                    ),
                  ],
                )))
          ],
        ),
      ),
    );
  }
}
Viren V Varasadiya
  • 25,492
  • 9
  • 45
  • 61

2 Answers2

0

in your column, try crossAxisAlignment: CrossAxisAlignment.stretch

EDIT: if you're trying to do what I think you're trying to do, try adding

mainAxisAlignment: MainAxisAlignment.center

to your row

milesau
  • 85
  • 1
  • 7
  • Oh hold on, I missed the Row widget that your text is in. In that case I'm not actually sure I understand what you're trying to do here – milesau Apr 03 '20 at 18:29
0

you need to wrap your text widget with Expanded widget. Default Row Widget will not take full width and it is creating issue.

Check out following code.

Expanded(
     child: Text(
      "+12-345-678-910",
      textAlign: TextAlign.center,
     ),
),
Viren V Varasadiya
  • 25,492
  • 9
  • 45
  • 61