0% found this document useful (0 votes)
9 views

Lecture 8

The document discusses the TextField, Drawer, and BottomNavigationBar classes in Flutter. It describes their properties and purposes, with TextField used for text input, Drawer for side navigation menus, and BottomNavigationBar for tab navigation at the bottom of screens.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lecture 8

The document discusses the TextField, Drawer, and BottomNavigationBar classes in Flutter. It describes their properties and purposes, with TextField used for text input, Drawer for side navigation menus, and BottomNavigationBar for tab navigation at the bottom of screens.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Software Engineering 2

Lecture 8
2023 2024

11/21/2023
Flutter
‫المرجع‬
Flutter documentation

11/21/2023
TextField class

• A text field lets the user enter text, either with hardware keyboard or
with an onscreen keyboard.
• The text field calls the onChanged callback whenever the user
changes the text in the field.
• To control the text that is displayed in the text field, use the controller.
For example, to set the initial value of the text field, use
a controller that already contains some text
• By default, a text field has a decoration that draws a divider below the
text field. You can use the decoration property to control the
decoration, for example by adding a label or an ico
11/21/2023
TextField class
Properties
• minLines The minimum number of lines to occupy when the content spans
fewer lines
• autofocus Whether this text field should focus itself if nothing else is
already focused.
• controller Controls the text being edited.
• decoration The decoration to show around the text field.
• maxLength The maximum number of characters (Unicode grapheme
clusters) to allow in the text field.
• maxLines The maximum number of lines to show at one time, wrapping if
necessary.
• keyboardType The type of keyboard to use for editing the text.

11/21/2023
Drawer class

• A Material Design panel that slides in horizontally from the edge of


a Scaffold to show navigation links in an application.
• Drawers are typically used with the Scaffold.drawer property. The
child of the drawer is usually a ListView whose first child is
a DrawerHeader that displays status information about the current
user. The remaining drawer children are often constructed
with ListTiles,
• The AppBar automatically displays an appropriate IconButton to show
the Drawer when a Drawer is available in the Scaffold.

11/21/2023
BottomNavigationBar class

• A material widget that's displayed at the bottom of an app for


selecting among a small number of views, typically between three
and five.
• The bottom navigation bar consists of multiple items in the form of
text labels, icons, or both, laid out on top of a piece of material. It
provides quick navigation between the top-level views of an app. For
larger screens, side navigation may be a better fit.
• A bottom navigation bar is usually used in conjunction with a Scaffold,
where it is provided as the Scaffold.bottomNavigationBar argument.

11/21/2023
BottomNavigationBar
Properties
• backgroundColor The color of the BottomNavigationBar itself.
• currentIndex The index into items for the current active
BottomNavigationBarItem.
• elevation The z-coordinate of this BottomNavigationBar.
• items Defines the appearance of the button items that are arrayed
within the bottom navigation bar.
• onTap Called when one of the items is tapped.
• selectedItemColor The color of the selected
BottomNavigationBarItem.icon and BottomNavigationBarItem.label.
• unselectedItemColor The color of the unselected
BottomNavigationBarItem.icon and BottomNavigationBarItem.labels.

11/21/2023

You might also like