This is a nested tabs example project.

This is great if you want tabs with probably a header on top of them. Normally tabs are displayed at the bottom of the appBar. What about if you want to include say an image or some card between the tabbar and appbar. This is what we create.

We will in the process understand around 4 classes that are mandatory for creating tabs:

  1. TabController/DefaultTabController.
  2. TabBar
  3. TabView
  4. Tab

Let's start.

ThemeData is a class that holds the color and typography values for a material design theme.

A material design TabBar tab.

Tab derives from the StatelessWidget:

class Tab extends StatelessWidget

Tab also resides in the flutter package.

If both icon and text are provided, the text is displayed below the icon.

More documentation coming soon.

This is a flutter Toast tutorial.

We see how to show:

  1. Short Toast.
  2. Long Toast.
  3. Colored Toast.
  4. Toast in center of screen.
  5. Toast at the Bottom of screen.

This is a flutter Swipe Tabs tutorial.

We will have 6 Tabs in our application. The Tabs will be arranged beautifully in our appBar just below the title.

Each tab will have the tab title and icon. You can then click the tab or swipe it either from left to right or right to left.

Our TabViews will have Cards.Each Card will have an image and text.

This is a flutter GridView tutorial.

A GridView is a scrollable, 2D array of widgets.

The main axis direction of a grid is the direction in which it scrolls (the scrollDirection).

The most commonly used grid layouts are GridView.count, which creates a layout with a fixed number of tiles in the cross axis, andGridView.extent, which creates a layout with tiles that have a maximum cross-axis extent. A custom SliverGridDelegate can produce an arbitrary 2D arrangement of children, including arrangements that are unaligned or overlapping.

To create a grid with a large (or infinite) number of children, use the GridView.builder constructor with either a SliverGridDelegateWithFixedCrossAxisCount or a SliverGridDelegateWithMaxCrossAxisExtent for the gridDelegate.

To use a custom SliverChildDelegate, use GridView.custom.

To create a linear array of children, use a ListView.

To control the initial scroll offset of the scroll view, provide a controller with its ScrollController.initialScrollOffset property set.

new GridView.count(
  primary: false,
  padding: const EdgeInsets.all(20.0),
  crossAxisSpacing: 10.0,
  crossAxisCount: 2,
  children: <Widget>[
    const Text('He\'d have you all unravel at the'),
    const Text('Heed not the rabble'),
    const Text('Sound of screams but the'),
    const Text('Who scream'),
    const Text('Revolution is coming...'),
    const Text('Revolution, they...'),
  ],
)

CupertinoAlertDialog An iOS-style alert dialog.

Generally we utilize an alert dialog to tell the user about situations that need user attention or acknowledgement.

AlertDialogs can have the following:

  1. Title(Optional) - displayed above content
  2. Content(Optional) - displayed between content and list of actions.
  3. List of actions(Optional) - displayed below the content
  4. The title is displayed above the content and the actions are displayed below the content.

CupertinoAlertDialogs do style their titles and content (typically a message) to match the standard iOS title and message dialog text style.

However you can overridde these by explicitly defining TextStyles for Text widgets that are part of the title or content.

To display action buttons that look like standard iOS dialog buttons, provide CupertinoDialogActions for the actions given to this dialog.

CupertinoAlertDialog is typically passed as the child widget to showDialog, which displays the dialog.

Flutter AlertDialog Tutorial and example.

An alert dialog informs the user about situations that require acknowledgement.

This is a flutter ListView tutorial.

A ListView is a scrollable list of widgets arranged linearly.

As the names suggests it's responsibility is list items. These items can then scrolled. ListView isn't the only scrolling view. There are others like gridview, however ListView is the most commonly used.

ListView will display its children one after another in the scroll direction. In the cross axis, the children are required to fill the ListView.

Here's a simple infinite listview:

new ListView.builder(
  padding: new EdgeInsets.all(8.0),
  itemExtent: 20.0,
  itemBuilder: (BuildContext context, int index) {
    return new Text('entry $index');
  },
)

This is a Flutter Android SnackBar Tutorial and Example.

SnackBar is a lightweight message with an optional action which briefly displays at the bottom of the screen.

SnakBars are important as they allows us show quick notifications for a short period of time without requiring user intervention.

However uses can also act by clicking the action button which can be rendered in the SnackBar.

Displaying a snackbar is easy. You simply invoke the Scaffold.of(context).showSnackBar(), passing an instance of SnackBar that describes the message.

You can also provide your own custom duration for displaying the SnackBar.

A SnackBar with an action will not time out when TalkBack or VoiceOver are enabled. This is controlled by AccessibilityFeatures.accessibleNavigation.