mirror of
https://github.com/Iconica-Development/flutter_form_wizard.git
synced 2025-05-19 19:03:47 +02:00
24 lines
642 B
Dart
24 lines
642 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'form_page_controller.dart';
|
||
|
|
||
|
class FormState extends InheritedWidget {
|
||
|
const FormState({
|
||
|
Key? key,
|
||
|
required Widget child,
|
||
|
required this.formController,
|
||
|
}) : super(key: key, child: child);
|
||
|
|
||
|
final ShellFormPageController formController;
|
||
|
|
||
|
static FormState of(BuildContext context) {
|
||
|
final FormState? result =
|
||
|
context.dependOnInheritedWidgetOfExactType<FormState>();
|
||
|
assert(result != null, 'No FormStat found in context');
|
||
|
return result!;
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
bool updateShouldNotify(FormState oldWidget) =>
|
||
|
formController != oldWidget.formController;
|
||
|
}
|