Incular logoIncular
API ReferenceDesign Systems

MaterialApp & Scaffold

App root, page scaffold, bars, drawers, and navigation rails.

ShellPurpose
MaterialAppTheme, routes, locale, restoration root
ScaffoldBody + bars + drawers + sheets page frame
AppBar / SliverAppBar / BottomAppBarTop, collapsing, and bottom bars
Drawer / NavigationRail / NavigationDrawerSide navigation patterns
ScaffoldMessengerSnack bar queue owner
use incular::prelude::*;
use incular::material_prelude::{AppBar, MaterialApp, Scaffold, ThemeData};

fn main() {
    let app = Application::new(|_cx| {
        MaterialApp::new(
            Scaffold::new(Text::new("Body"))
                .app_bar(AppBar::new(Text::new("Demo"))),
        )
        .title("Demo")
        .theme(ThemeData::light())
        .into()
    })
    .expect("valid application");
    incular::run(app).expect("run application");
}

route / routes / initial_route, locale and supported locales, restoration_scope_id, builder, from_builder, drawer/navigation-bar slots, ScaffoldMessenger, and action buttons (BackButton, CloseButton, DrawerButton) share the same consuming-builder shape.

K_TOOLBAR_HEIGHT = 56.0. ThemeMode: System / Light / Dark.

Related: Navigator, Theme.