All constructer of Scaffold class in flutter

 import 'package:flutter/material.dart';


class practiingflutter extends StatefulWidget {
const practiingflutter({Key? key}) : super(key: key);

@override
State<practiingflutter> createState() => _practiingflutterState();
}

class _practiingflutterState extends State<practiingflutter> {
@override
Widget build(BuildContext context) {
int _selectedIndex = 0;
const List<Widget> _widgetOptions = <Widget>[
Text('Home Page', style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold)),
Text('Search Page', style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold)),
Text('Profile Page', style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold)),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}

return Scaffold(
// COnstructoer and properties of Scaffold
appBar: AppBar(
title: Text("hello world"),
),
drawer: Drawer(
elevation: 40.0,
child: Column(
children: [
UserAccountsDrawerHeader(accountName: Text("Minhaj"),
accountEmail: Text("minhajraza51694@gmail.com"),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.yellow,
child: Icon(Icons.account_circle_outlined,size: 70,color: Colors.black45,),)),

ListTile(
title: Text('Main Account'),
leading: Icon(Icons.account_circle_outlined),
),


ListTile(
title: Text('All mail inboxes'),
leading: Icon(Icons.mail),
),
Divider(
height: 0.2,
),
ListTile(
title: Text('Primary'),
leading: Icon(Icons.label_important_outlined),
),
ListTile(
title: Text('Social'),
leading: Icon(Icons.sensor_occupied_sharp),
),

],
),
),
floatingActionButton: FloatingActionButton(
elevation: 8.0,
child: Icon(Icons.add),
onPressed: (){
print("BUtton is clicked");
},

),
backgroundColor: Colors.yellow,
primary: true,// bu default bhi true hi rhta hai
// persistentFooterButtons: [
// ElevatedButton(onPressed: (){},
// child: Icon(Icons.add,color: Colors.white,)),
// ElevatedButton(onPressed: (){},
// child: Icon(Icons.clear,color: Colors.white,)),
// ],
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: "Home",
backgroundColor: Colors.green
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
label: "Search",
backgroundColor: Colors.yellow
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: "Profile",
backgroundColor: Colors.blue,
),
],
type: BottomNavigationBarType.shifting,
currentIndex: _selectedIndex,
selectedItemColor: Colors.black,
iconSize: 30,
onTap: _onItemTapped,
elevation: 5
),

);
}
}

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

c++ basic question

Learning stage | c++ programs