Flutter Tutorials

Flutter app development tutorials


flutter – How to get AppBar height

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



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started