I am very new to Flutter. I want to display two text with Column in middle of the screen.
But when I tried Center, it looks like this. It displays texts in top of the screen. Why this happens?
My code:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build (BuildContext context) {
return MaterialApp(
title: "Flutter Demo",
theme: ThemeData(
primarySwatch: Colors.pink,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Hello world"),
),
body: Center(
child: Column(
children: [
Text(
"Hello"
),
Text(
"World"
)
],
)
)
);
}
}
Also, when I use Container instead of Column, it displays in center of screen like this.
What's the problem
I'm using Windows 10. Thanks.