Paul
Paul

Reputation: 197

Flutter || Add text below AppBar

There is an application page that is responsible for displaying devices. There is a code that returns AppBar, Body, Drawer. Question: how do I put the description "List of devices" between AppBar and Body (as in the photo)

sample of output

      @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        automaticallyImplyLeading: true,
        backgroundColor: Colors.black,
        title: const Text('IT', style: TextStyle(fontSize: 45,
                                   fontWeight: FontWeight.w800,
                                    color: Colors.white)),
        centerTitle: true,
        actions: [
          IconButton(
            icon: const Icon(Icons.filter_alt,
                             size: 30.0,),
            color: Colors.white,
            onPressed: () {
              showDialog<Filter>(context: context, builder: (_) {
                return FilterDialog(onApplyFilters: _filter,);
              });
            },
          ),
        ],
      ),

      body: PhonesList(phones: filteredPhones),

      drawer: Drawer(.....),
            
    );

Upvotes: 0

Views: 2893

Answers (3)

Jamirul islam
Jamirul islam

Reputation: 856

you use appbar bottom ... and customization

 bottom: PreferredSize(
             child: Container(
               color: Colors.white,
               child: row(

                ),
             ),
         preferredSize: Size.fromHeight(kToolbarHeight)
      ),

Upvotes: 1

Ujjawal Maurya
Ujjawal Maurya

Reputation: 616

Use bottom property of AppBar and add text inside it

Text will be shown at the bottom of AppBar

enter image description here

Upvotes: 1

use a column widget below appbar or introduce a column widget on Body.

Column(
          children:<Widget>[
            Container(
              decoration:BoxDecoration(
                borderRadius:BorderRadius.circular(10),
                color:Colors.green
              ),
              child: Column(
                children:<Widget>[
                     Text("iphone 11 ",style: TextStyle(color:Colors.white,fontSize:25),),
                        Text("ios 15")
                ])
            ),
            Container(
              decoration:BoxDecoration(
                borderRadius:BorderRadius.circular(10),
                color:Colors.green
              ),
              child: Column(
                children:<Widget>[
                     Text("iphone 13 ",style: TextStyle(color:Colors.white,fontSize:25),),
                        Text("ios 13")
                ])
            ),
           
          ]
        ),

Upvotes: 0

Related Questions