How can i increase flutter appbar size in iphone 11,12,13 ? What kind of changes i can do in order to fix this (i have added my appbar code below)

Viewed 29
import 'package:flutter/material.dart';
import 'package:flutter_1/widgets/drawer.dart';

class Homepage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(

      drawer: const Mydrawer(),
      appBar: AppBar(
        title: const Text("ASUS",
        style: TextStyle(
          color: Colors.black
        ),),
          backgroundColor: Colors.white,
        iconTheme: const IconThemeData(color:Colors.black),
        elevation: 0.0,

        ),


        floatingActionButton: IconButton(
        onPressed: (){},
    icon: const Icon(Icons.laptop),
        ),

    );
  }
}
1 Answers

To increase Flutter AppBar size you can use PreferredSize() Widget To set Appbar custom Size here is the example of preferredsize Appbar

  Widget build(BuildContext context) {
return Scaffold(
  appBar: PreferredSize(
    preferredSize: const Size(340, 150),
    child: Container(
      height: 150,
      color: Colors.blue,
      child: Padding(
        padding: const EdgeInsets.only(top: 58.0),
        child: Row(
          children: [
            BackButton(),
            Text(widget.title),
          ],
        ),
      ),
    ),
  ),

Here is the Result of code :- PreferredSize appbar

Related