API ReferenceDesign Systems
MaterialApp & Scaffold
App root, page scaffold, bars, drawers, and navigation rails.
| Shell | Purpose |
|---|---|
MaterialApp | Theme, routes, locale, restoration root |
Scaffold | Body + bars + drawers + sheets page frame |
AppBar / SliverAppBar / BottomAppBar | Top, collapsing, and bottom bars |
Drawer / NavigationRail / NavigationDrawer | Side navigation patterns |
ScaffoldMessenger | Snack 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.