こんにちは、フラメルです。
今回はAndroidアプリのAppBar
タイトルを中央表示する方法を紹介します。
目次
対処法


AppBar
のタイトルを中央に表示させるにはcenterTitle
をtrue
にするだけです。
AppBar(
title: Text('Flutter'),
centerTitle: true,
),
サンプルコード
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Flutter'),
centerTitle: true,
),
),
);
}
}
以上です。