我想將我的文本集中在我的容器中間,但他們只將它們集中在容器的頂部中間。這是我的代碼:
import 'package:flutter/material.dart';
class Homepage extends StatefulWidget {
const Homepage({Key? key}) : super(key: key);
@override
_HomepageState createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Homepage'),
backgroundColor: Colors.green,
),
body: SafeArea(
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(75, 100, 75, 100),
height: 100,
width: 300,
color: Colors.green,
child: const Text('BLE & Data'),
),
//const SizedBox(height: 10),
Container(
margin: EdgeInsets.fromLTRB(75, 25, 75, 100),
height: 100,
width: 300,
color: Colors.green,
child: const Text('Statistiken',
textAlign: TextAlign.center,),
),
const SizedBox(height: 10),
Container(
//padding: EdgeInsets.all(50),
margin: EdgeInsets.fromLTRB(75, 25, 75, 100),
height: 100,
width: 300,
color: Colors.green,
child: const Text('Personal Data',
textAlign: TextAlign.center,
),
),
],
),
));
}
}
這就是我的輸出:
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/375656.html
