FlutterFlutter · Chapterبەش 6 · Lectureوانە 6.4

Drawers, Bottom Bars and Sheetsلیستە لاتەنیشتەکان، شریتەکانی خوارەوە و پەڕەی خوارەوە

The rest of the Scaffold: where the floating action button can sit, drawers and end drawers (and Material 3's NavigationDrawer), working bottom navigation bars with state (and NavigationBar), footer buttons, the page colour, bottom sheets and what happens when the keyboard opens.

بەشەکانی تری Scaffold: لە کوێ دادەنرێت، drawer و endDrawer (و NavigationDrawerـی ⁦Material 3⁩)، کارپێکراو بە (و NavigationBar)، دوگمەکانی خوارەوە، ڕەنگی پەڕە، و ئەوەی کاتی کرانەوەی ڕوو دەدات.

25 min read23 خولەک خوێندنەوە · 17 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Place a floating action button with floatingActionButtonLocation and explain float, docked, start and end.
  • Build a drawer and an end drawer with a header and items that close the drawer, and know NavigationDrawer.
  • Make a bottom navigation bar switch pages with state and setState, with BottomNavigationBar or NavigationBar.
  • Use persistentFooterButtons, backgroundColor, bottomSheet, showModalBottomSheet and resizeToAvoidBottomInset correctly.
  • بە floatingActionButtonLocation دابنێیت و float، docked، start و end ڕوون بکەیتەوە.
  • drawer و endDrawer بە سەردێڕ و بڕگەی داخەرەوە دروست بکەیت و NavigationDrawer بناسیت.
  • بە و setState پەڕەکان بگۆڕێت، بە BottomNavigationBar یان NavigationBar.
  • persistentFooterButtons، backgroundColor، bottomSheet، showModalBottomSheet و resizeToAvoidBottomInset بە دروستی بەکار بهێنیت.

The rest of the Scaffoldشوێنەکانی تری Scaffold

In MaterialApp and Scaffold you met the Scaffold and three of its slots: appBar, body and floatingActionButton. This lesson fills in the rest of the screen: where else the floating button can sit, the panels that slide in from the side, the bars at the bottom, buttons and sheets that stay at the bottom, the page colour and what happens when the keyboard opens.

لە وانەی MaterialApp و Scaffoldدا Scaffoldت ناسی لەگەڵ سێ شوێنی ناوی: appBar، body و floatingActionButton. ئەم وانەیە بەشەکانی تری شاشەکە پڕ دەکاتەوە: لە کوێی تر دادەنرێت، ئەو پانێڵانەی لە لاتەنیشتەوە دێنە ناوەوە، شریتەکانی خوارەوە، ئەو دوگمە و پەڕانەی لە خوارەوە دەمێننەوە، ڕەنگی پەڕەکە و ئەوەی کاتی کرانەوەی ڕوو دەدات.

The Scaffold properties in this lesson Scaffold لەم وانەیەدا
Scaffold property ScaffoldWhat it gives the screenچی دەدات بە شاشەکە
floatingActionButtonLocationWhere the floating action button sits. لە کوێ دادەنرێت.
drawer, endDrawerPanels that slide in from the side.ئەو پانێڵانەی لە لاتەنیشتەوە دێنە ناوەوە.
bottomNavigationBarA bar with the app's main sections.شریتێک بە بەشە سەرەکییەکانی .
persistentFooterButtonsButtons that never scroll away.ئەو دوگمانەی هەرگیز بە ون نابن.
backgroundColorThe colour of the whole page.ڕەنگی هەموو پەڕەکە.
bottomSheetExtra information fixed at the bottom.زانیاریی زیادە کە لە خوارەوە جێگیرە.
resizeToAvoidBottomInsetWhether the body shrinks when the keyboard opens.ئایا body بچووک دەبێتەوە کاتێک دەکرێتەوە.

Every one of these properties is optional. You add only the parts a screen really needs; a simple screen may use none of them.

هەموو ئەم ئارەزوومەندانەن. تەنها ئەو بەشانە زیاد دەکەیت کە شاشەکە بەڕاستی پێویستی پێیانە؛ دەکرێت شاشەیەکی سادە هیچیان بەکار نەهێنێت.

Quick checkپشکنینی خێراWhich of these is not a property of Scaffold?کامیان Scaffold نییە؟

Where the floating button sitsدوگمەی کردەوەی سەرەکی لە کوێ دادەنرێت

floatingActionButtonLocation decides where the Scaffold puts its floating action button. You do not give it numbers; you choose one of the ready-made constants of the class FloatingActionButtonLocation. The course names four:

floatingActionButtonLocation دیاری دەکات Scaffold لە کوێ دابنێت. ژمارەی پێ نادەیت؛ یەکێک لە نرخە ئامادەکراوەکانی FloatingActionButtonLocation هەڵدەبژێریت. وانەکە چواریان دەژمێرێت:

  1. endFloat — the default: it floats in the bottom end corner, above any bottom bar.
  2. endDocked — at the end, with its centre sitting on the top edge of the bottom bar.
  3. centerFloat — it floats in the middle at the bottom of the screen.
  4. centerDocked — in the middle, sitting on the bottom bar's top edge.
  1. endFloat — بنەڕەتە: لە گۆشەی خوارەوەی کۆتایی و لە سەرووی هەر شریتێکی خوارەوە دەوەستێت.
  2. endDocked — لە لای کۆتایی، ناوەڕاستەکەی لەسەر لێواری سەرەوەی شریتی خوارەوەیە.
  3. centerFloat — لە ناوەڕاستی خوارەوەی شاشەکەدا دەوەستێت.
  4. centerDocked — لە ناوەڕاستدا، لەسەر لێواری سەرەوەی شریتی خوارەوە.
Four frames of the same phone screen titled 'This is Homepage' with a bottom bar. The + button moves: endFloat, bottom end corner above the bar; endDocked, at the end with its centre on the bar's top edge; centerFloat, in the middle above the bar; centerDocked, in the middle on the bar's edge. A small map beside the phone highlights the current spot of the four.
Four frames of the same phone screen titled 'This is Homepage' with a bottom bar. The + button moves: endFloat, bottom end corner above the bar; endDocked, at the end with its centre on the bar's top edge; centerFloat, in the middle above the bar; centerDocked, in the middle on the bar's edge. A small map beside the phone highlights the current spot of the four.
float = above the bar; docked = on the bar's top edge; end = right in English apps, left in Kurdish apps.float = لە سەرووی شریتەکە؛ docked = لەسەر لێواری سەرەوەی شریتەکە؛ end = لە ئینگلیزییەکاندا ڕاست، لە کوردییەکاندا چەپ.CêIT

Float means the button hovers 16 pixels above the bottom bar (or above the bottom of the screen). Docked means the button's centre lies on the top edge of the bottomNavigationBar, so it looks fixed to the bar. Docked places are made for screens that have a bottom bar; without one, the button just sits against the bottom edge.

Float واتە ١٦ لە سەرووی شریتی خوارەوە (یان لە سەرووی خوارەوەی شاشەکە) ڕادەوەستێت. Docked واتە ناوەڕاستی دەکەوێتە سەر لێواری سەرەوەی bottomNavigationBar، بۆیە وا دەردەکەوێت کە بە شریتەکەوە نووساوە. شوێنە dockedـەکان بۆ ئەو شاشانەن کە شریتی خوارەوەیان هەیە؛ بەبێ شریت تەنها بە لێواری خوارەوەی شاشەکەوە دەنووسێت.

A FAB docked in the middle of a BottomAppBarدوگمەی کردەوەی سەرەکی لە ناوەڕاستی BottomAppBar نووساوەDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class FabLocationDemo extends StatelessWidget {
  const FabLocationDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('This is Homepage')),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: const Icon(Icons.add),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: const BottomAppBar(
        child: Row(
          children: [Icon(Icons.home), Spacer(), Icon(Icons.settings)],
        ),
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 10

The button itself, as in the previous lesson.

خودی ، وەک وانەی پێشوو.

Lineدێڕی 14

The course's line: one constant chooses the place.

دێڕەکەی وانەکە: یەک نرخی جێگیر شوێنەکە هەڵدەبژێرێت.

Lineدێڕی 15-17

A simple BottomAppBar gives the docked button a bar to sit on.

BottomAppBarـێکی سادە شریتێک دەدات بە تا لەسەری دابنیشێت.

Quick checkپشکنینی خێراWhich location puts the FAB in the middle, with its centre on the top edge of the bottom bar?کام شوێن دەخاتە ناوەڕاست و ناوەڕاستەکەی لەسەر لێواری سەرەوەی شریتی خوارەوە دەبێت؟

Where the floating button sitsدوگمەی کردەوەی سەرەکی لە کوێ دادەنرێت

All 19 FAB locationsهەر ١٩ شوێنەکەی دوگمەی کردەوەی سەرەکی

Quick checkپشکنینی خێراIn a Kurdish (right-to-left) app, where does FloatingActionButtonLocation.startFloat put the button?لە کوردیدا ()، FloatingActionButtonLocation.startFloat لە کوێ دادەنێت؟

drawer: a panel from the sidedrawer: پانێڵێک لە لاتەنیشتەوە

A drawer is a panel that slides in from the side of the screen, over the page. It usually holds links to the app's main places. It stays hidden until the user taps the ☰ (menu) button in the app bar or swipes in from the edge of the screen.

پانێڵێکە لە لاتەنیشتی شاشەوە دێتە ناوەوە و دەکەوێتە سەر پەڕەکە. زۆربەی جار بەستەری شوێنە سەرەکییەکانی لە خۆ دەگرێت. شاراوە دەمێنێتەوە تا دەست لە دوگمەی ☰ () لە دەدات، یان پەنجە لە لێواری شاشەکەوە بەرەو ناوەوە ڕادەکێشێت.

You give the Scaffold's drawer property a widget, usually a Drawer. If the AppBar has no leading widget, Flutter adds the ☰ button for you.

دەدەیت بە drawerـی Scaffold، زۆربەی جار Drawerـێک. ئەگەر AppBar هیچ leadingـێکی نەبێت، Flutter خۆی دوگمەی ☰ زیاد دەکات.

The drawer under a shop counterچەکمەجەی ژێر مێزی دووکان

A shopkeeper keeps a drawer under the counter. Customers do not see it, so the counter stays tidy, and he pulls it out only when he needs the receipt book. A Flutter drawer is the same: the menu stays hidden, so the page has more room, until the user pulls it out with ☰ or a swipe.

دووکاندارێک چەکمەجەیەکی لە ژێر مێزەکەیدا هەیە. کڕیاران نایبینن، بۆیە مێزەکە ڕێکوپێک دەمێنێتەوە و تەنها کاتێک دەیکێشێتە دەرەوە کە پێویستی بە دەفتەری پسوولە دەبێت. لە Flutterـدا هەروایە: شاراوە دەمێنێتەوە، بۆیە پەڕەکە شوێنی زیاترە، تا بە ☰ یان بە ڕاکێشانی پەنجە دەیکێشێتە دەرەوە.

Where the analogy stops workingسنووری ئەم نموونەیە

A Flutter drawer closes when the user taps outside it. Tapping an item inside it does not close it unless your code calls Navigator.pop(context) — the call that also closes a page (pop).

لە Flutterـدا کاتێک دەست لە دەرەوەی دەدات دادەخرێت. دەست لێدانی بڕگەیەک لە ناویدا دایناخات مەگەر کۆدەکەت Navigator.pop(context) بانگ بکات — هەمان بانگکردن کە پەڕەیەکیش دادەخات (pop).

Quick checkپشکنینی خێراA Scaffold has a drawer, and its AppBar has no leading. How can the user open the drawer?Scaffoldـێک drawerـی هەیە و AppBarـەکەی leadingـی نییە. چۆن دەتوانێت بکاتەوە؟

📱 FULL Flutter Beginner Course • Programming Basics / Widgets / Navigation / User Input / UIMitch Koko · Englishئینگلیزی · 1.6M viewsبینین · 46K likesلایک · Partبەشی 51:33–55:36 (ofلە 2:23:25)

Mitch Koko's calm beginner course in Dart and Flutter: variables, operators, if/else, switch, loops, functions, collections, a first screen and a counter.

کۆرسە ئارامەکەی ⁦Mitch Koko⁩ بۆ سەرەتاییەکان لە و : ، ، if/else، switch، ، ، List/Set/Map، یەکەم شاشە و .

Watch 51:33-55:36 ('DRAWER'): the Scaffold's drawer adds the menu button, a DrawerHeader, ListTiles that open pages, and Navigator.pop to close the drawer.

لە ⁦51:33⁩ تا ⁦55:36⁩ سەیر بکە (DRAWER): drawerـی Scaffold زیاد دەکات؛ پاشان DrawerHeader، چەند ListTileـێک کە لاپەڕەی تر دەکەنەوە و Navigator.pop بۆ داخستنی .

drawer: a panel from the sidedrawer: پانێڵێک لە لاتەنیشتەوە

Which edge does a drawer open from?لیستی لاتەنیشت لە کام لێوارەوە دەکرێتەوە؟

Quick checkپشکنینی خێراA Kurdish (right-to-left) app has a drawer. From which side does it slide in? کوردی () drawerـی هەیە. لە کام لاوە دێتە ناوەوە؟

drawer: a panel from the sidedrawer: پانێڵێک لە لاتەنیشتەوە

Inside a drawer: a header and tilesناوەوەی لیستی لاتەنیشت: سەردێڕێک و ListTile

Lec4 gives the common recipe: a ListView with a DrawerHeader at the top, followed by ListTile items. The course has two drawer examples (Lec3 and Lec4); here they are joined into one complete, runnable screen:

⁦Lec4⁩ ڕێگە باوەکە دەدات: ListViewـێک کە DrawerHeaderـێک لە سەرەوەیەتی و دوای ئەو چەند ListTileـێک. وانەکە دوو نموونەی هەیە (⁦Lec3⁩ و ⁦Lec4⁩)؛ لێرەدا هەردووکیان بوونەتە یەک شاشەی تەواو کە جێبەجێ دەکرێت:

A drawer with a header, icons and a dividerلیستی لاتەنیشت لەگەڵ سەردێڕ، ئایکۆنەکان و هێڵی جیاکەرەوەDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: CoursePage()));

class CoursePage extends StatelessWidget {
  const CoursePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Mobile App Course')),
      drawer: Drawer(
        child: ListView(
          padding: EdgeInsets.zero,
          children: [
            const DrawerHeader(
              decoration: BoxDecoration(color: Colors.green),
              child: Text(
                'Drawer Panel',
                style: TextStyle(color: Colors.white, fontSize: 24),
              ),
            ),
            ListTile(
              leading: const Icon(Icons.people),
              title: const Text('Share'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.mail),
              title: const Text('Email'),
              onTap: () => Navigator.pop(context),
            ),
            const Divider(),
            ListTile(
              leading: const Icon(Icons.inbox),
              title: const Text('Primary'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.group),
              title: const Text('Social'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.local_offer),
              title: const Text('Promotions'),
              onTap: () => Navigator.pop(context),
            ),
          ],
        ),
      ),
      body: const Center(child: Text('Swipe from the edge or tap ☰')),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 13

A ListView scrolls when the items do not fit on the screen.

ListView دەکرێت کاتێک بڕگەکان جێیان نابێتەوە.

Lineدێڕی 14

Removes the list's automatic top padding, so the header reaches the top edge (the Flutter cookbook marks this line as important).

خۆکاری سەرەوەی لیستەکە لادەبات، بۆ ئەوەی سەردێڕەکە بگاتە لێواری سەرەوە (کتێبی ڕێنمایی Flutter ئەم دێڕە بە گرنگ دادەنێت).

Lineدێڕی 16-17

DrawerHeader: a coloured box at the top of the drawer.

DrawerHeader: سندووقێکی ڕەنگاوڕەنگ لە سەرەوەی .

Lineدێڕی 24

leading: an icon before the item's text.

leading: پێش دەقی بڕگەکە.

Lineدێڕی 26

Closes the drawer when the item is tapped.

کاتێک دەست لە بڕگەکە دەدرێت دادەخات.

Lineدێڕی 33

A thin line between two groups of items.

هێڵێکی باریک لە نێوان دوو کۆمەڵە بڕگەدا.

An open drawer over a phone screen. A green DrawerHeader 'Drawer Panel' at the top; ListTile rows Share and Email with icons; a Divider line; Primary, Social and Promotions. Labels explain DrawerHeader, ListTile(leading: Icon, title: Text) with onTap, Divider, Drawer > ListView (scrolls) and the grey scrim, which closes the drawer when tapped.لیستێکی لاتەنیشتی کراوە لەسەر شاشەی مۆبایلێک. DrawerHeaderـێکی سەوز 'Drawer Panel' لە سەرەوە؛ ڕیزەکانی ListTile بە ناوی Share و Email لەگەڵ ئایکۆنەکان؛ هێڵێکی Divider؛ Primary، Social و Promotions. نووسینەکان DrawerHeader، ListTile(leading: Icon, title: Text) لەگەڵ onTap، Divider، Drawer > ListView (تێپەڕکردن دەکرێت) و پەردە خۆڵەمێشییەکە ڕوون دەکەنەوە کە دەست لێدانی لیستە لاتەنیشتەکە دادەخات.
The parts of a drawer. The ☰ button is added to the AppBar automatically.بەشەکانی . دوگمەی ☰ خۆکارانە دەخرێتە سەر AppBar.CêIT
Quick checkپشکنینی خێراWhy does each ListTile in the drawer call Navigator.pop(context)?بۆچی هەر ListTileـێک لە Navigator.pop(context) بانگ دەکات؟

drawer: a panel from the sidedrawer: پانێڵێک لە لاتەنیشتەوە

endDrawer: the panel on the other sideendDrawer: پانێڵەکەی لای تر

endDrawer is the same kind of panel, but on the opposite edge: the end edge. The course says it appears on the right side "by default"; more exactly, it is on the right in an English app and on the left in a Kurdish app. A screen may have both: the main menu in drawer and, for example, account settings or filters in endDrawer.

endDrawer هەمان جۆری پانێڵە، بەڵام لە لێواری بەرامبەر: لێواری کۆتایی. وانەکە دەڵێت بە بنەڕەت لە لای ڕاست دەردەکەوێت؛ وردتر، لە ئینگلیزیدا لە ڕاستە و لە کوردیدا لە چەپ. شاشەیەک دەتوانێت هەردووکیانی هەبێت: سەرەکی لە drawerدا و بۆ نموونە ڕێکخستنەکانی هەژمار یان پاڵێوەرەکان لە endDrawerدا.

A drawer and an end drawer on one screendrawer و endDrawer لە یەک شاشەداDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class SettingsPage extends StatelessWidget {
  const SettingsPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Shop')),
      drawer: const Drawer(child: Center(child: Text('Main menu'))),
      endDrawer: Drawer(
        child: ListView(
          children: [
            const ListTile(title: Text('Account Settings')),
            ListTile(
              leading: const Icon(Icons.notifications),
              title: const Text('Notifications'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.close),
              title: const Text('Close Menu'),
              onTap: () => Navigator.pop(context),
            ),
          ],
        ),
      ),
      body: const Center(child: Text('Products')),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 10

The main menu, at the start edge.

سەرەکی، لە لێواری سەرەتا.

Lineدێڕی 11

The second panel, at the end edge.

پانێڵی دووەم، لە لێواری کۆتایی.

When the Scaffold has an endDrawer and the AppBar has no actions, Flutter adds a ☰ button at the end of the app bar too, so the user can open it.

کاتێک Scaffold endDrawerـی هەیە و AppBar هیچ actionsـێکی نییە، Flutter دوگمەیەکی ☰ لە کۆتایی زیاد دەکات، بۆ ئەوەی بتوانێت بیکاتەوە.

Quick checkپشکنینی خێراIn a Kurdish (right-to-left) app, where does the endDrawer open?لە کوردیدا () endDrawer لە کوێوە دەکرێتەوە؟

bottomNavigationBar: the main sectionsbottomNavigationBar: بەشە سەرەکییەکان

bottomNavigationBar is a bar at the very bottom of the Scaffold, like a menu for the app's main sections: for example Home, Search and Profile. Each item has an icon and a short label, and tapping an item shows that section. Material Design advises three to five items.

bottomNavigationBar شریتێکە لە خوارترین بەشی Scaffold، وەک بۆ بەشە سەرەکییەکانی : بۆ نموونە Home، Search و Profile. هەر بڕگەیەک و ناوێکی کورتی هەیە و دەست لێدانی بڕگەیەک ئەو بەشە پیشان دەدات. ⁦Material Design⁩ سێ بۆ پێنج بڕگە پێشنیار دەکات.

The course's bottom bar, made to workشریتی خوارەوەی وانەکە، کارپێکراوDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: HomePage()));

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  int _index = 0; // which item is selected

  static const _pages = [
    Center(child: Text('Home page')),
    Center(child: Text('Search page')),
    Center(child: Text('Profile page')),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Mobile App Course')),
      body: _pages[_index],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _index,
        fixedColor: Colors.red,
        items: const [
          BottomNavigationBarItem(label: 'Home', icon: Icon(Icons.home)),
          BottomNavigationBarItem(label: 'Search', icon: Icon(Icons.search)),
          BottomNavigationBarItem(label: 'Profile', icon: Icon(Icons.account_circle)),
        ],
        onTap: (int indexOfItem) {
          setState(() => _index = indexOfItem);
        },
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 5

A StatefulWidget, because the selection changes.

StatefulWidget، چونکە هەڵبژاردنەکە دەگۆڕێت.

Lineدێڕی 13

The state: which item is selected.

: کام بڕگە هەڵبژێردراوە.

Lineدێڕی 15-19

One page for each item.

بۆ هەر بڕگەیەک پەڕەیەک.

Lineدێڕی 25

The body shows the page of the selected item.

body پەڕەی بڕگە هەڵبژێردراوەکە پیشان دەدات.

Lineدێڕی 27

The bar reads the selection from the state, not a fixed 0.

شریتەکە هەڵبژاردنەکە لە دەخوێنێتەوە، نەک لە 0ـی جێگیر.

Lineدێڕی 28

The colour of the selected item (the course uses red).

ڕەنگی بڕگەی هەڵبژێردراو (وانەکە سوور بەکار دەهێنێت).

Lineدێڕی 34-35

Save the tapped index and rebuild the screen.

ژمارەی بڕگەی لێدراو هەڵبگرە و شاشەکە دووبارە دروست بکەرەوە.

With four or more items, BottomNavigationBar switches to a shifting style by default: only the selected item shows its label. Add type: BottomNavigationBarType.fixed to keep every label visible.

کاتێک چوار بڕگە یان زیاتر هەبن، BottomNavigationBar بە بنەڕەت دەچێتە سەر شێوازی shifting: تەنها بڕگەی هەڵبژێردراو ناوەکەی پیشان دەدات. type: BottomNavigationBarType.fixed زیاد بکە بۆ ئەوەی هەموو ناوەکان دیار بمێنن.

Quick checkپشکنینی خێراIn the course's original code, why does tapping Search not select it?لە کۆدە ڕەسەنەکەی وانەکەدا، بۆچی دەست لێدانی Search هەڵی نابژێرێت؟

📱 FULL Flutter Beginner Course • Programming Basics / Widgets / Navigation / User Input / UIMitch Koko · Englishئینگلیزی · 1.6M viewsبینین · 46K likesلایک · Partبەشی 55:37–59:48 (ofلە 2:23:25)

Mitch Koko's calm beginner course in Dart and Flutter: variables, operators, if/else, switch, loops, functions, collections, a first screen and a counter.

کۆرسە ئارامەکەی ⁦Mitch Koko⁩ بۆ سەرەتاییەکان لە و : ، ، if/else، switch، ، ، List/Set/Map، یەکەم شاشە و .

Watch 55:37-59:48 ('BOTTOM NAV BAR'): items, a list of pages, the selected index kept in a StatefulWidget and changed with setState in onTap.

لە ⁦55:37⁩ تا ⁦59:48⁩ سەیر بکە (BOTTOM NAV BAR): items، لە لاپەڕەکان و هەڵبژێردراو کە لە دەمێنێتەوە و لە onTapـدا بە setState دەگۆڕێت.

bottomSheet: extra information at the bottombottomSheet: زانیاریی زیادە لە خوارەوە

bottomSheet shows a piece of extra information about the page's main content, fixed at the bottom: for example the address and phone number of a shop under its list of offers. It stays visible (a persistent bottom sheet) and sits above the footer buttons and the bottom bar.

bottomSheet پارچەیەک زانیاریی زیادە دەربارەی ناوەڕۆکی سەرەکیی پەڕەکە پیشان دەدات کە لە خوارەوە جێگیرە: بۆ نموونە ناونیشان و ژمارەی تەلەفۆنی دووکانێک لە ژێر لیستی داشکاندنەکانی. دیار دەمێنێتەوە ( persistent) و لە سەرووی دوگمەکانی خوارەوە و شریتی خوارەوە دادەنیشێت.

Here is the course's screen with all three bottom parts and a yellow page:

ئەمە شاشەکەی وانەکەیە لەگەڵ هەر سێ بەشەکەی خوارەوە و پەڕەیەکی زەرد:

backgroundColor, bottomSheet, persistentFooterButtons and a bottom barbackgroundColor، bottomSheet، persistentFooterButtons و شریتی خوارەوەDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class ShopPage extends StatelessWidget {
  const ShopPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Mobile App Course')),
      backgroundColor: Colors.yellow,
      body: const Center(child: Text('Today\'s offers')),
      bottomSheet: Container(
        height: 70,
        color: Colors.cyan[50],
        child: const Column(
          children: [
            Row(
              children: [
                Icon(Icons.place),
                SizedBox(width: 7),
                Text('12 Bazaar Street, Sulaymaniyah'),
              ],
            ),
            Row(
              children: [
                Icon(Icons.phone),
                SizedBox(width: 7),
                Text('0750 000 0000'),
              ],
            ),
          ],
        ),
      ),
      persistentFooterButtons: [
        ElevatedButton(
          onPressed: () {},
          child: const Icon(Icons.add),
        ),
        ElevatedButton(
          onPressed: () {},
          child: const Icon(Icons.clear, color: Colors.amber),
        ),
      ],
      bottomNavigationBar: NavigationBar(
        destinations: const [
          NavigationDestination(icon: Icon(Icons.home), label: 'Home'),
          NavigationDestination(icon: Icon(Icons.search), label: 'Search'),
          NavigationDestination(icon: Icon(Icons.account_circle), label: 'Profile'),
        ],
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 10

The page colour — with a comma.

ڕەنگی پەڕەکە — بە فاریزەوە.

Lineدێڕی 12

The sheet: a light-cyan box 70 pixels high.

: سندووقێکی شینی کاڵ بە بەرزیی ٧٠ .

Lineدێڕی 20

A small gap between the icon and the text.

بۆشاییەکی بچووک لە نێوان و دەقەکەدا.

Lineدێڕی 21

Made-up sample data, never a real address or phone number.

دراوەی نموونەی دروستکراو، هەرگیز ناونیشان یان ژمارەی ڕاستەقینە نا.

Lineدێڕی 34

The footer buttons.

دوگمەکانی خوارەوە.

Lineدێڕی 44

The bar at the very bottom.

شریتەکە لە خوارترین بەش.

A phone mock-up of the code above. The page is yellow with 'Today's offers'. Near the bottom, a light-cyan bottomSheet shows a pin icon with '12 Bazaar Street, Sulaymaniyah' and a phone icon with '0750 000 0000'; below it a row with + and × buttons (persistentFooterButtons); at the very bottom a NavigationBar with Home, Search and Profile. Labels name each part.وێنەی مۆبایلێک بۆ کۆدەکەی سەرەوە. پەڕەکە زەردە بە 'Today's offers'. نزیک خوارەوە، bottomSheetـێکی شینی کاڵ ئایکۆنی شوێن لەگەڵ '12 Bazaar Street, Sulaymaniyah' و ئایکۆنی تەلەفۆن لەگەڵ '0750 000 0000' پیشان دەدات؛ لە ژێریدا ڕیزێک بە دوگمەکانی + و × (persistentFooterButtons)؛ لە خوارترین بەش NavigationBarـێک بە Home، Search و Profile. نووسینەکان ناوی هەر بەشێک دەڵێن.
Bottom to top: bottomNavigationBar, persistentFooterButtons, bottomSheet, then the body.لە خوارەوە بۆ سەرەوە: bottomNavigationBar، persistentFooterButtons، bottomSheet، پاشان body.CêIT
Quick checkپشکنینی خێراWhich order is right, from the very bottom of the screen upwards?کام ڕیزبەندی ڕاستە، لە خوارترین بەشی شاشەکەوە بەرەو سەرەوە؟

resizeToAvoidBottomInset: making room for the keyboardresizeToAvoidBottomInset: جێکردنەوە بۆ کیبۆرد

When a text field gets focus, the phone's on-screen keyboard slides up and covers the bottom part of the screen. That covered strip is called the bottom inset. resizeToAvoidBottomInset decides what the Scaffold does about it:

کاتێک ئامادە دەبێت بۆ نووسین، سەر شاشەی مۆبایلەکە بەرز دەبێتەوە و بەشی خوارەوەی شاشەکە دادەپۆشێت. ئەو پارچە داپۆشراوە پێی دەوترێت ⁦bottom inset⁩. resizeToAvoidBottomInset بڕیار دەدات Scaffold چی بکات:

  • true (the default): the body becomes shorter, so widgets at its bottom, such as a text field, move up above the keyboard. Floating widgets such as the FAB move up too.
  • false: the body keeps its full height and the keyboard simply covers its bottom part.
  • true (بنەڕەت): body کورتتر دەبێتەوە، بۆیە ئەو لە خوارەوەیدان، وەک ، دەچنە سەرووی . ئەو لەسەر پەڕەکە دەوەستن، وەک FAB، ئەوانیش بەرز دەبنەوە.
  • false: body هەموو بەرزییەکەی دەپارێزێت و تەنها بەشی خوارەوەی دادەپۆشێت.
Three frames of a chat-like screen with the title 'Mobile App Development Course', the text 'Messages appear here' and a 'Type here' field at the bottom. Frame 1: the keyboard is closed. Frame 2, resizeToAvoidBottomInset: true: the keyboard is open, the body is shorter and the field sits just above the keyboard. Frame 3, false: the keyboard covers the field.
Three frames of a chat-like screen with the title 'Mobile App Development Course', the text 'Messages appear here' and a 'Type here' field at the bottom. Frame 1: the keyboard is closed. Frame 2, resizeToAvoidBottomInset: true: the keyboard is open, the body is shorter and the field sits just above the keyboard. Frame 3, false: the keyboard covers the field.
true (default): the field moves up; false: the keyboard hides it.true (بنەڕەت): خانەکە بەرز دەبێتەوە؛ false: دەیشارێتەوە.CêIT
A message screen that makes room for the keyboardشاشەیەکی پەیام کە جێ بۆ کیبۆرد دەکاتەوەDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class MessagePage extends StatelessWidget {
  const MessagePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Mobile App Development Course')),
      resizeToAvoidBottomInset: true, // the default: make room for the keyboard
      body: const Column(
        children: [
          Expanded(
            child: Center(child: Text('Messages appear here')),
          ),
          Padding(
            padding: EdgeInsets.all(12),
            child: TextField(
              decoration: InputDecoration(
                border: OutlineInputBorder(),
                labelText: 'Type here',
              ),
            ),
          ),
        ],
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 10

The default value, written out to show it. Try false.

، نووسراوە تا ببینرێت. false تاقی بکەرەوە.

Lineدێڕی 13

Expanded takes the free height, so the field stays at the bottom of the body.

Expanded بەرزییە بەتاڵەکە دەگرێت، بۆیە خانەکە لە خوارەوەی body دەمێنێتەوە.

Lineدێڕی 18

Tapping the field opens the keyboard.

دەست لێدانی خانەکە دەکاتەوە.

Quick checkپشکنینی خێراA chat screen has its text field at the bottom. The user taps the field and the keyboard hides it. What is the most likely cause?لە شاشەیەکی گفتوگۆدا لە خوارەوەیە. دەست لە خانەکە دەدات و دەیشارێتەوە. هۆکارە ئەگەرییەکە چییە؟

Common mistakesهەڵە باوەکان

MistakeهەڵەWhat happensچی ڕوو دەداتFixچاککردن
A drawer item with no onTap, or without Navigator.pop(context)بڕگەیەکی بەبێ onTap یان بەبێ Navigator.pop(context)Tapping does nothing, or the drawer stays openدەست لێدان هیچ ناکات، یان کراوە دەمێنێتەوەAct, then call Navigator.pop(context)کارەکە بکە، پاشان Navigator.pop(context) بانگ بکە
currentIndex: 0 written as a fixed numbercurrentIndex: 0 وەک ژمارەیەکی جێگیر نووسراوەThe bottom bar never changesشریتی خوارەوە هەرگیز ناگۆڕێتKeep the index in a StatefulWidget and update it with setStateژمارەکە لە StatefulWidgetـێکدا هەڵبگرە و بە setState نوێی بکەرەوە
Calling setState in a StatelessWidgetبانگکردنی setState لە StatelessWidgetـێکداCompile error: there is no setState there: لەوێ setState نییەTurn the screen into a StatefulWidgetشاشەکە بکە بە StatefulWidget
A drawer's ListView without padding: EdgeInsets.zeroListViewـی بەبێ padding: EdgeInsets.zeroA gap above the headerبۆشاییەک لە سەرووی سەردێڕەکەAdd padding: EdgeInsets.zeropadding: EdgeInsets.zero زیاد بکە
Thinking endDrawer is always on the rightوا بیر بکەیتەوە کە endDrawer هەمیشە لە ڕاستەWrong design for a Kurdish appدیزاینی هەڵە بۆ کوردیThink start and end: in Kurdish apps the end is the leftبە start و end بیر بکەرەوە: لە کوردییەکاندا کۆتایی لای چەپە
backgroundColor: Colors.yellow; inside Scaffold(...)backgroundColor: Colors.yellow; لە ناو Scaffold(...)Syntax errorهەڵەی End the argument with a comma بە فاریزە کۆتایی پێ بهێنە
Using resizeToAvoidBottomPaddingبەکارهێنانی resizeToAvoidBottomPaddingThe parameter does not exist any moreئەو ئیتر بوونی نییەUse resizeToAvoidBottomInsetresizeToAvoidBottomInset بەکار بهێنە
A docked FAB location on a screen with no bottom barشوێنێکی docked بۆ FAB لە شاشەیەکی بێ شریتی خوارەوەThe button sits against the bottom edge بە لێواری خوارەوەوە دەنووسێتUse a Float location, or add a bottom barشوێنێکی Float بەکار بهێنە، یان شریتێکی خوارەوە زیاد بکە

Exercisesڕاهێنانەکان

Exerciseڕاهێنان1. A drawer for a school app١. لیستی لاتەنیشت بۆ ئەپێکی قوتابخانە

Build a screen 'My School' with a drawer. The drawer has an indigo header with the white text 'My School' and three items with icons: Timetable, Marks and Library. Tapping an item closes the drawer.

شاشەیەکی '⁦My School⁩' دروست بکە کە هەبێت. سەردێڕێکی نیلی بە دەقی سپی '⁦My School⁩' و سێ بڕگەی هەیە کە هەریەکەیان هەیە: Timetable، Marks و Library. دەست لێدانی بڕگەیەک دادەخات.

Hintئاماژە

Drawer → ListView(padding: EdgeInsets.zero) → DrawerHeader + ListTile(leading, title, onTap).

ڕیزبەندییەکە: Drawer ← ⁦ListView(padding: EdgeInsets.zero)⁩ ← ⁦DrawerHeader + ListTile(leading, title, onTap)⁩.

Show answerوەڵامەکە پیشان بدە
One possible answerوەڵامێکی گونجاوDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class SchoolHome extends StatelessWidget {
  const SchoolHome({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('My School')),
      drawer: Drawer(
        child: ListView(
          padding: EdgeInsets.zero,
          children: [
            const DrawerHeader(
              decoration: BoxDecoration(color: Colors.indigo),
              child: Text(
                'My School',
                style: TextStyle(color: Colors.white, fontSize: 24),
              ),
            ),
            ListTile(
              leading: const Icon(Icons.calendar_month),
              title: const Text('Timetable'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.grade),
              title: const Text('Marks'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.local_library),
              title: const Text('Library'),
              onTap: () => Navigator.pop(context),
            ),
          ],
        ),
      ),
      body: const Center(child: Text('Welcome!')),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 12

No gap above the header.

هیچ بۆشاییەک لە سەرووی سەردێڕەکە نییە.

Lineدێڕی 24

Each item closes the drawer.

هەر بڕگەیەک دادەخات.

Exerciseڕاهێنان2. The course's 'Account Settings' end drawer٢. endDrawerـی '⁦Account Settings⁩'ـی وانەکە

The course shows an end drawer called 'Account Settings' with the items Profile & Security, Notifications, Favorites, About and Log Out & Exit. Build it as an endDrawer with an icon before each item. Which edge will it open from in a Kurdish app?

وانەکە endDrawerـێک پیشان دەدات بە ناوی '⁦Account Settings⁩' بە بڕگەکانی ⁦Profile & Security⁩، Notifications، Favorites، About و ⁦Log Out & Exit⁩. وەک endDrawer دروستی بکە و پێش هەر بڕگەیەک دابنێ. لە کوردیدا لە کام لێوارەوە دەکرێتەوە؟

Show answerوەڵامەکە پیشان بدە
One possible answerوەڵامێکی گونجاوDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class StorePage extends StatelessWidget {
  const StorePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Store')),
      endDrawer: Drawer(
        child: ListView(
          children: [
            const ListTile(
              title: Text('Account Settings', style: TextStyle(fontSize: 20)),
            ),
            ListTile(
              leading: const Icon(Icons.security),
              title: const Text('Profile & Security'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.notifications),
              title: const Text('Notifications'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.favorite),
              title: const Text('Favorites'),
              onTap: () => Navigator.pop(context),
            ),
            ListTile(
              leading: const Icon(Icons.info),
              title: const Text('About'),
              onTap: () => Navigator.pop(context),
            ),
            const Divider(),
            ListTile(
              leading: const Icon(Icons.logout),
              title: const Text('Log Out & Exit'),
              onTap: () => Navigator.pop(context),
            ),
          ],
        ),
      ),
      body: const Center(child: Text('Products')),
    );
  }
}

In a Kurdish (right-to-left) app the end drawer opens from the left edge; in an English app from the right.

لە کوردیدا () endDrawer لە لێواری چەپەوە دەکرێتەوە؛ لە ئینگلیزیدا لە ڕاستەوە.

Exerciseڕاهێنان3. A FAB on the bottom bar٣. FAB لەسەر شریتی خوارەوە

A notes app has a BottomAppBar with a menu icon and a search icon. Put a + button with the tooltip 'New note' in the middle, sitting on the bar's top edge. Which two Scaffold properties do you need?

تێبینی BottomAppBarـێکی هەیە بە و گەڕان. دوگمەیەکی + بە tooltipـی '⁦New note⁩' لە ناوەڕاستدا دابنێ کە لەسەر لێواری سەرەوەی شریتەکە دانیشێت. پێویستت بە کام دوو Scaffold هەیە؟

Show answerوەڵامەکە پیشان بدە

floatingActionButton for the button and floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked for its place:

floatingActionButton بۆ و floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked بۆ شوێنەکەی:

One possible answerوەڵامێکی گونجاوDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class NotesHome extends StatelessWidget {
  const NotesHome({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Notes')),
      body: const Center(child: Text('No notes yet')),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        tooltip: 'New note',
        child: const Icon(Icons.add),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: const BottomAppBar(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [Icon(Icons.menu), Icon(Icons.search)],
        ),
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 16

center + docked.

center (ناوەڕاست) + docked (نووساو بە شریتەوە).

Exerciseڕاهێنان4. Four sections with NavigationBar٤. چوار بەش بە NavigationBar

Change the course's bottom bar into a Material 3 NavigationBar with four destinations: Home, Search, Profile and Settings. The app bar title and the text in the middle of the page must show the name of the selected section.

شریتی خوارەوەی وانەکە بگۆڕە بۆ NavigationBarـی ⁦Material 3⁩ بە چوار شوێنەوە: Home، Search، Profile و Settings. ناونیشانی و دەقی ناوەڕاستی پەڕەکە دەبێت ناوی بەشی هەڵبژێردراو پیشان بدەن.

Hintئاماژە

You need a StatefulWidget, an int _index and setState.

پێویستت بە StatefulWidget، int _index و setState هەیە.

Show answerوەڵامەکە پیشان بدە
One possible answerوەڵامێکی گونجاوDARTRuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
import 'package:flutter/material.dart';

class ShopHome extends StatefulWidget {
  const ShopHome({super.key});

  @override
  State<ShopHome> createState() => _ShopHomeState();
}

class _ShopHomeState extends State<ShopHome> {
  int _index = 0;

  static const _titles = ['Home', 'Search', 'Profile', 'Settings'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(_titles[_index])),
      body: Center(child: Text('This is the ${_titles[_index]} page')),
      bottomNavigationBar: NavigationBar(
        selectedIndex: _index,
        onDestinationSelected: (int index) {
          setState(() => _index = index);
        },
        destinations: const [
          NavigationDestination(icon: Icon(Icons.home), label: 'Home'),
          NavigationDestination(icon: Icon(Icons.search), label: 'Search'),
          NavigationDestination(icon: Icon(Icons.account_circle), label: 'Profile'),
          NavigationDestination(icon: Icon(Icons.settings), label: 'Settings'),
        ],
      ),
    );
  }
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 13

One list of names serves the title, the page and the bar's order.

یەک لیستی ناو بۆ ناونیشان، پەڕە و ڕیزبەندیی شریتەکە بەکار دێت.

Lineدێڕی 23

The state changes, so the title and the body change too.

دەگۆڕێت، بۆیە ناونیشان و bodyـیش دەگۆڕێن.

Exerciseڕاهێنان5. Predict the screen٥. شاشەکە پێشبینی بکە

A login screen has two text fields at the bottom of a Column and resizeToAvoidBottomInset: false. What does the user see after tapping the second field? Suggest two ways to fix it.

شاشەیەکی چوونەژوورەوە دوو لە خوارەوەی Columnـێکدا هەیە و resizeToAvoidBottomInset: false. دوای دەست لێدانی خانەی دووەم چی دەبینێت؟ دوو ڕێگەی چاککردن پێشنیار بکە.

Show answerوەڵامەکە پیشان بدە

The keyboard opens over the bottom of the screen and covers the fields, because the body keeps its full height. Fix 1: remove the line (the default true shrinks the body). Fix 2: if the body must keep its height (for example a background picture), put the form in a SingleChildScrollView so the user can scroll the field into view.

لەسەر خوارەوەی شاشەکە دەکرێتەوە و خانەکان دادەپۆشێت، چونکە body هەموو بەرزییەکەی دەپارێزێت. چاککردنی ١: ئەو دێڕە لابە (trueـی بنەڕەت body بچووک دەکاتەوە). چاککردنی ٢: ئەگەر body دەبێت بەرزییەکەی بپارێزێت (بۆ نموونە وێنەیەکی پاشبنەما)، فۆڕمەکە بخە ناو SingleChildScrollView بۆ ئەوەی بتوانێت خانەکە بە بهێنێتە بەرچاو.

Quick checkپشکنینی خێراWhich property would you use for a shop's address that must stay visible under a scrolling list of offers?بۆ ناونیشانی دووکانێک کە دەبێت لە ژێر لیستێکی داشکاندندا کە دەکرێت دیار بمێنێت، کام بەکار دەهێنیت؟

Summaryپوختە

  • floatingActionButtonLocation places the FAB: endFloat (default), endDocked, centerFloat, centerDocked and 15 more; end is the left in Kurdish apps.
  • drawer slides in from the start edge, endDrawer from the end edge. A drawer is usually Drawer → ListView → DrawerHeader + ListTiles, and each item closes it with Navigator.pop(context). Material 3 adds NavigationDrawer.
  • bottomNavigationBar shows the main sections. The selected index is state: keep it in a StatefulWidget and update it with setState. Material 3's bar is NavigationBar.
  • persistentFooterButtons stay above the bottom bar and never scroll; backgroundColor colours the whole page; bottomSheet shows fixed extra information; showModalBottomSheet opens a sheet on demand.
  • resizeToAvoidBottomInset (default true) shrinks the body when the keyboard opens. resizeToAvoidBottomPadding no longer exists.
  • floatingActionButtonLocation FAB دادەنێت: endFloat (بنەڕەت)، endDocked، centerFloat، centerDocked و ١٥ی تر؛ end لە کوردییەکاندا چەپە.
  • drawer لە لێواری سەرەتاوە دێتە ناوەوە و endDrawer لە لێواری کۆتاییەوە. زۆربەی جار Drawer ← ListView ← DrawerHeader + ListTileـە و هەر بڕگەیەک بە Navigator.pop(context) دایدەخات. ⁦Material 3⁩ NavigationDrawer زیاد دەکات.
  • bottomNavigationBar بەشە سەرەکییەکان پیشان دەدات. ژمارەی هەڵبژێردراو : لە StatefulWidgetـێکدا هەڵیبگرە و بە setState نوێی بکەرەوە. شریتی ⁦Material 3⁩ NavigationBarـە.
  • persistentFooterButtons لە سەرووی شریتی خوارەوە دەمێننەوە و هەرگیز ناکرێن؛ backgroundColor هەموو پەڕەکە ڕەنگ دەکات؛ bottomSheet زانیاریی زیادەی جێگیر پیشان دەدات؛ showModalBottomSheet پەڕەیەک کاتی پێویست دەکاتەوە.
  • resizeToAvoidBottomInset (بنەڕەت true) body بچووک دەکاتەوە کاتێک دەکرێتەوە. resizeToAvoidBottomPadding ئیتر بوونی نییە.
Review questionsپرسیارەکانی پێداچوونەوە
What is the difference between drawer and endDrawer?جیاوازیی drawer و endDrawer چییە؟

Only the edge: drawer opens from the start edge (left in English, right in Kurdish apps), endDrawer from the end edge.

تەنها لێوارەکە: drawer لە لێواری سەرەتاوە دەکرێتەوە (لە ئینگلیزییەکاندا چەپ، لە کوردییەکاندا ڕاست) و endDrawer لە لێواری کۆتاییەوە.

Why must a working bottom navigation bar be inside a StatefulWidget?بۆچی شریتی ڕێنیشاندانی خوارەوەی کارپێکراو دەبێت لە ناو StatefulWidgetـێکدا بێت؟

The selected index changes when the user taps. It must be kept in a State object and changed with setState, so the bar and the body are built again.

ژمارەی هەڵبژێردراو کاتی دەست لێدان دەگۆڕێت. دەبێت لە Stateـدا هەڵبگیرێت و بە setState بگۆڕدرێت، بۆ ئەوەی شریتەکە و body دووبارە دروست ببنەوە.

What is the difference between float and docked FAB locations?جیاوازیی شوێنەکانی float و dockedـی FAB چییە؟

A floating FAB hovers above the bottom bar; a docked FAB has its centre on the bar's top edge.

FABـی float لە سەرووی شریتی خوارەوە ڕادەوەستێت؛ FABـی docked ناوەڕاستەکەی لەسەر لێواری سەرەوەی شریتەکەیە.

What replaced resizeToAvoidBottomPadding?چی جێگەی resizeToAvoidBottomPaddingـی گرتەوە؟

resizeToAvoidBottomInset. The old parameter was deprecated in Flutter 1.1.9 and later removed.

resizeToAvoidBottomInset. کۆنەکە لە ⁦Flutter 1.1.9⁩ـدا کرا و دواتر لابرا.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Container: Size, Padding, Margin and AlignmentContainer: قەبارە، بۆشایی ناوەوە، پەراوێز و ڕێکخستنی شوێن

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.