main.dart
import 'package:flutter/material.dart';
void main(){
var height = AppBar().preferredSize.height;
runApp(
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text("Flutter - AppBar Get Height")
),
body: Center(
child: Text(
"AppBar Height : $height",
style: const TextStyle(fontSize: 24)
),
),
),
)
);
}
More flutter tutorials
- flutter – How to change AppBar height
- flutter – How to remove AppBar drop shadow
- flutter – How to change AppBar color
- flutter – MaterialApp theme
- flutter – Container padding and margin
- flutter – Container full width
- flutter – How to align Text
- flutter – How to change Text underline thickness
- flutter – Space between Text and underline
- flutter – How to add shadow to the Text
- flutter – How to add a border to Text
- flutter – How to add stroke to Text
- flutter – Text decoration
- flutter – Text gradient background
- flutter – How to set Text letter spacing