felangel / flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
https://pub.dev/packages/flow_builder
MIT License
389 stars 63 forks source link

Updating state flow using context.flow is not recognized #24

Closed kinanajoudeh closed 3 years ago

kinanajoudeh commented 3 years ago

When I try to update the flow state via context.flow().update it gives an error:

Error: The method 'flow' isn't defined for the class 'BuildContext'. 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'flow'.

felangel commented 3 years ago

Hi @kinanajoudeh 👋 Thanks for opening an issue!

I believe you are missing the flow_builder import:

import 'package:flow_builder/flow_builder.dart';

Hope that helps 👍