{
    "componentChunkName": "component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js",
    "path": "/docs/flutter/provider-example/",
    "result": {"data":{"mdx":{"id":"27e44270-9e1f-555d-bf33-605739c88c5b","excerpt":"Let's get right into the provider example. We also have a Flutter provider plugin on  pub.dev Create a new Provider class We're using a ChangeNotifier to notify…","fields":{"slug":"/docs/flutter/provider-example/"},"frontmatter":{"title":"Flutter Provider Plugin Example","description":"A complete provider example on how to use LinkFive with the Flutter provider plugin","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"Flutter Provider Plugin Example\",\n  \"description\": \"A complete provider example on how to use LinkFive with the Flutter provider plugin\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Let's get right into the provider example.\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"We also have a Flutter provider plugin on \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://pub.dev/packages/linkfive_purchases_provider\"\n  }, \"pub.dev\"))), mdx(\"h2\", {\n    \"id\": \"create-a-new-provider-class\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#create-a-new-provider-class\",\n    \"aria-label\": \"create a new provider class permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Create a new Provider class\"), mdx(\"p\", null, \"We're using a ChangeNotifier to notify all listeners that something has changed.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"class LinkFiveProvider extends ChangeNotifier {\\n\\n}\\n\")), mdx(\"p\", null, \"We will initialize LinkFive in it's constructor. This will also check if an active subscription is currently existing.\"), mdx(\"p\", null, \"We will also listen for all data changes that is coming through the plugin with a listener.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"SubscriptionData\"), \": Is the subscription product which contains the price, the duration and the name of your subscriptions. This data is used to offer a subscription product to your users.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"ActiveSubscriptionData\"), \": Is an active verified subscription that the user purchased.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"LinkFiveProvider() {\\n  LinkFivePurchases.init(\\\"API_KEY\\\");\\n  LinkFivePurchases\\n          .products\\n          .listen(_productsUpdate)\\n  LinkFivePurchases\\n          .activeProducts\\n          .listen(_activeProductsUpdate)\\n}\\n\")), mdx(\"p\", null, \"Inside the listener methods, you can just save the data to the ChangeNotifier and notify all Listeners that something has changed.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"void _productsUpdate(LinkFiveProducts data) async {\\n  this.products = data;\\n  notifyListeners();\\n}\\n\\nvoid _activeProductsUpdate(LinkFiveActiveProducts data) {\\n  activeProducts = data;\\n  notifyListeners();\\n}\\n\")), mdx(\"p\", null, \"This was the basic example and should be enough to implement subscriptions into your App. You should also save the streams to the ChangeNotifier and cancel them on dispose.\"), mdx(\"h2\", {\n    \"id\": \"add-your-provider-to-your-other-providers\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#add-your-provider-to-your-other-providers\",\n    \"aria-label\": \"add your provider to your other providers permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Add your Provider to your other providers\"), mdx(\"p\", null, \"In your main method or wherever you want to add the provider to the Widget tree, add the provider like any other providers.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"MultiProvider(providers: [\\n  ChangeNotifierProvider(\\n    create: (context) => LinkFiveProvider(),\\n    lazy: false,\\n  ),\\n  // Your other providers\\n])\\n\")), mdx(\"h2\", {\n    \"id\": \"consume-the-provider\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#consume-the-provider\",\n    \"aria-label\": \"consume the provider permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Consume the Provider\"), mdx(\"p\", null, \"In your build method, right before you want to offer the subscriptions, you can consume the provider using a Consumer< LinkFiveProvider >\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"@override\\nWidget build(BuildContext context) {\\n  return Container(\\n    child: Consumer<LinkFiveProvider>(\\n      builder: (_, linkFiveProvider, __) {\\n        var products = linkFiveProvider.products;\\n        if (products != null) {\\n\\n          // use the subscription Data to build your Purchase buttons\\n\\n          // example:\\n          return Column(\\n            children: [\\n              Row(\\n                children: buildSubscriptionButtons(products),\\n                mainAxisAlignment: MainAxisAlignment.spaceEvenly,\\n              )\\n            ],\\n          );\\n        }\\n        return Center(child: Text('No Subscription found...'));\\n      },\\n  ));\\n}\\n\\n\")), mdx(\"p\", null, \"In your buildSubscriptionButtons method, loop through the subscriptions and create a button for each element.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"buildSubscriptionButtons(LinkFiveProducts linkFiveProducts) {\\n  return linkFiveProducts.productDetailList\\n      .map((linkFiveProductDetails) => ElevatedButton(\\n\\n            onPressed: () {\\n                LinkFivePurchases.purchase(linkFiveProductDetails.productDetails);\\n            },\\n\\n            child: Text(linkFiveProductDetails.productDetails.price),\\n          ))\\n      .toList();\\n}\\n\")), mdx(\"p\", null, \"When the user presses the button, LinkFivePurchases.purchase(...) is called and handles the entire purchase process.\"), mdx(\"p\", null, \"The verified receipt will be passed to the activeSubscription stream.\"), mdx(\"h2\", {\n    \"id\": \"call-fetchproducts\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#call-fetchproducts\",\n    \"aria-label\": \"call fetchproducts permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Call .fetchProducts()\"), mdx(\"p\", null, \"To receive your product offerings, you should call fetchProducts to load all available subscriptions. We did not call it automatically since you might want to avoid calling to fetch the latest products if the user already has an active premium plan.\"), mdx(\"p\", null, \"Another good practice is to\"), mdx(\"hr\", null), mdx(\"hr\", null), mdx(\"h2\", {\n    \"id\": \"complete-provider-example\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#complete-provider-example\",\n    \"aria-label\": \"complete provider example permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Complete Provider Example\"), mdx(\"p\", null, \"Now also as a standalone package: \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://pub.dev/packages/linkfive_purchases_provider\"\n  }, \"linkfive_purchases_provider\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"import 'dart:async';\\n\\nimport 'package:flutter/material.dart';\\nimport 'package:linkfive_purchases/linkfive_purchases.dart';\\n\\n/// LinkFive Provider\\n///\\n/// Initialize LinkFive with your Api Key\\n///\\n/// Please register on our website: https://www.linkfive.io to get an api key\\nclass LinkFiveProvider extends ChangeNotifier {\\n  /// LinkFive client as factory\\n  final LinkFivePurchasesMain linkFivePurchases = LinkFivePurchasesMain();\\n\\n  /// LinkFive subscriptions that you can offer to your user\\n  LinkFiveProducts? products;\\n\\n  /// All verified receipt received by LinkFive\\n  LinkFiveActiveProducts? activeProducts;\\n\\n  /// Streams that will be cleaned on dispose\\n  List<StreamSubscription> _streams = [];\\n\\n  /// All verified receipts as List or emptyList\\n  List<LinkFivePlan> get activePlanList => activeProducts?.planList ?? [];\\n\\n  /// LinkFive as CallbackInterface for your Paywall\\n  CallbackInterface get callbackInterface => linkFivePurchases;\\n\\n  /// conveniently check if the user has any activeProducts\\n  bool get hasActiveProduct =>\\n      activeProducts != null && activeProducts!.planList.isNotEmpty;\\n\\n  /// Initialize LinkFive with your Api Key\\n  ///\\n  /// Please register on our website: https://www.linkfive.io to get an api key\\n  ///\\n  /// [LinkFiveEnvironment] is 99,999..% [LinkFiveEnvironment.PRODUCTION] better not touch it\\n  LinkFiveProvider(String apiKey,\\n      {LinkFiveEnvironment environment = LinkFiveEnvironment.PRODUCTION}) {\\n    linkFivePurchases.init(apiKey, env: environment);\\n    _streams.add(linkFivePurchases.products.listen(_productsUpdate));\\n    _streams.add(\\n        linkFivePurchases.activeProducts.listen(_activeProductsUpdate));\\n  }\\n\\n  /// Saves available Subscriptions and notifies all listeners\\n  void _productsUpdate(LinkFiveProducts data) async {\\n    products = data;\\n    notifyListeners();\\n  }\\n\\n  /// Saves active Subscriptions and notifies all listeners\\n  void _activeProductsUpdate(LinkFiveActiveProducts data) {\\n    activeProducts = data;\\n    notifyListeners();\\n  }\\n\\n  /// Fetch all available Subscription for purchase for the user\\n  ///\\n  /// The provider will notify you for changes\\n  Future<LinkFiveProducts?> fetchProducts() {\\n    return LinkFivePurchases.fetchProducts();\\n  }\\n\\n  /// Restore Subscriptions of the user\\n  ///\\n  /// The provider will notify you if there is a change\\n  restoreSubscriptions() {\\n    return LinkFivePurchases.restore();\\n  }\\n\\n  /// Make a Purchase\\n  ///\\n  /// The provider will notify you if there is a change\\n  /// The future returns if the \\\"purchase screen\\\" is visible to the user\\n  /// and not if the purchase was successful\\n  Future<bool> purchase(ProductDetails productDetail) async {\\n    return LinkFivePurchases.purchase(productDetail);\\n  }\\n\\n  /// Handles the Switch Plan functionality.\\n  ///\\n  /// You can switch from one Subscription plan to another. Example: from currently a 1 month subscription to a 3 months subscription\\n  ///\\n  /// on iOS: you can only switch to a plan which is in the same Subscription Family\\n  ///\\n  /// [oldPurchasePlan] given by the LinkFive Plugin\\n  ///\\n  /// [productDetails] from the purchases you want to switch to\\n  ///\\n  /// [prorationMode] Google Only: default replaces immediately the subscription, and the remaining time will be prorated and credited to the user.\\n  ///   Check https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.ProrationMode for more information\\n  switchPlan(LinkFivePlan oldPurchasePlan, LinkFiveProductDetails productDetails,\\n      {ProrationMode? prorationMode}) {\\n    return LinkFivePurchases.switchPlan(oldPurchasePlan, productDetails,\\n        prorationMode: prorationMode);\\n  }\\n\\n  @override\\n  void dispose() async {\\n    for (var element in _streams) {\\n      await element.cancel();\\n    }\\n    _streams = [];\\n    super.dispose();\\n  }\\n\\n  /// helper function for the paywall to make it easier.\\n  ///\\n  /// returns the subscriptionDataList or if null, an empty list\\n  List<SubscriptionData> paywallUIHelperData(BuildContext context) =>\\n      products?.paywallUIHelperData(context: context) ?? [];\\n}\\n\\n\")), mdx(\"h2\", {\n    \"id\": \"use-the-provider-and-show-the-ui\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#use-the-provider-and-show-the-ui\",\n    \"aria-label\": \"use the provider and show the ui permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Use the provider and show the UI\"), mdx(\"p\", null, \"This example uses Navigation 2.0\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-dart\"\n  }, \"import 'package:flutter/material.dart';\\nimport 'package:in_app_purchases_paywall_ui/in_app_purchases_paywall_ui.dart';\\nimport 'package:linkfive_purchases_provider/linkfive_purchases_provider.dart';\\nimport 'package:provider/provider.dart';\\n\\nclass ProviderSimplePaywall extends StatelessWidget {\\n\\n  @override\\n  Widget build(BuildContext context) {\\n    return Consumer<LinkFiveProvider>(builder: (_, linkFiveProvider, __) {\\n      return PaywallScaffold(\\n          appBarTitle: \\\"LinkFive Premium\\\",\\n          child: SimplePaywall(\\n              theme: Theme.of(context),\\n              callbackInterface: linkFiveProvider.callbackInterface,\\n              subscriptionListData:\\n              linkFiveProvider.paywallUIHelperData(context),\\n              title: \\\"Go Premium\\\",\\n              // SubTitle\\n              subTitle: \\\"All features at a glance\\\",\\n              // Add as many bullet points as you like\\n              bulletPoints: [\\n                IconAndText(Icons.stop_screen_share_outlined, \\\"No Ads\\\"),\\n                IconAndText(Icons.hd, \\\"Premium HD\\\"),\\n                IconAndText(Icons.sort, \\\"Access to All Premium Articles\\\")\\n              ],\\n              // Shown if isPurchaseSuccess == true\\n              successTitle: \\\"You're a Premium User!\\\",\\n              // Shown if isPurchaseSuccess == true\\n              successSubTitle: \\\"Thanks for your Support!\\\",\\n              // Widget can be anything. Shown if isPurchaseSuccess == true\\n              successWidget: Container(\\n                  padding: EdgeInsets.only(top: 16, bottom: 16),\\n                  child: Row(\\n                      mainAxisAlignment: MainAxisAlignment.center,\\n                      children: [\\n                        ElevatedButton(\\n                          child: Text(\\\"Let's go!\\\"),\\n                          onPressed: () {\\n                            print(\\\"let\\u2018s go to the home widget again\\\");\\n                          },\\n                        )\\n                      ])),\\n              tosData: TextAndUrl(\\n                  \\\"Terms of Service\\\", \\\"https://www.linkfive.io/tos\\\"),\\n              // provide your PP\\n              ppData: TextAndUrl(\\n                  \\\"Privacy Policy\\\", \\\"https://www.linkfive.io/privacy\\\"),\\n              // add a custom campaign widget\\n              campaignWidget: CampaignBanner(\\n                theme: Theme.of(context),\\n                headline: \\\"\\uD83E\\uDD73 Summer Special Sale\\\",\\n              )));\\n    });\\n  }\\n}\\n\\n\")));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[{"depth":2,"value":"Create a new Provider class"},{"depth":2,"value":"Add your Provider to your other providers"},{"depth":2,"value":"Consume the Provider"},{"depth":2,"value":"Call .fetchProducts()"},{"depth":2,"value":"Complete Provider Example"},{"depth":2,"value":"Use the provider and show the UI"}]}},"pageContext":{"slug":"/docs/flutter/provider-example/","next":{"label":"Introduction","link":"/docs/docs/"},"repositoryEditUrl":"","repositoryProvider":""}},
    "staticQueryHashes": ["1954253342","2328931024","2501019404","973074209"]}