Skip to content
Articles
Article

Sharing Location using Inherited Widget

by Brian Armstrong flutter.institute

14 min read

Sometimes you need to use a location from multiple routes/widgets within your app. Instead of having to set up and manage the location [https://pub.dartlang.org/packages/location] plugin in all these various places, we can instead set it up once and share that data between many widgets using an Inherited Widget [(https://docs.flutter.io/flutter/widgets/InheritedWidget-class.html)]. Download Visit the GitHub repository [https://github.com/flutter-institute/location_context] to clone the source

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

Supported by