builder method
A function that builds the UI to be shown from the ViewModel - Required
viewModel is the ViewModel passed in and child is the staticChildBuilder result
Implementation
@override
Widget builder(BuildContext context, PaymentViewModel model, Widget? child) {
return MaterialApp(
navigatorKey: StackedService.navigatorKey,
home: Scaffold(
backgroundColor: Colors.white,
appBar: CustomAppBar(title: "", showBackButton: false),
body:
model.isForm
? cardWidget(context, model)
: model.isFailed
? paymentFailed(model)
: model.isSuccess
? paymentSuccess()
: const SizedBox(), // fallback if none match
),
);
}