How PageViewModel works
masterA PageViewModel represents a single page within the introduction sequence. You provide a list of these objects to the pages parameter of the IntroductionScreen widget.
Key capabilities:
- Content: Define text using
titleandbody(Strings), or usetitleWidgetandbodyWidgetto provide custom Widgets. Note: You must use eitherbodyorbodyWidget, not both. - Visuals: Use the
imageparameter to display any Widget (e.g.,Icon,Image.asset,Image.network). - Styling: Use the
decorationparameter (of typePageDecoration) to customizepageColor,titleTextStyle, andbodyTextStylefor that specific page.
PageViewModel(
title: "Title of page",
body: "Description text",
image: const Center(child: Icon(Icons.star)),
decoration: const PageDecoration(
pageColor: Colors.blue,
titleTextStyle: TextStyle(color: Colors.white),
),
)