StoryImage.url constructor

StoryImage.url(
  1. String url, {
  2. StoryController? controller,
  3. Map<String, dynamic>? requestHeaders,
  4. BoxFit fit = BoxFit.fitWidth,
  5. Widget? loadingWidget,
  6. Widget? errorWidget,
  7. Key? key,
})

Use this shorthand to fetch images/gifs from the provided url

Implementation

factory StoryImage.url(
  String url, {
  StoryController? controller,
  Map<String, dynamic>? requestHeaders,
  BoxFit fit = BoxFit.fitWidth,
  Widget? loadingWidget,
  Widget? errorWidget,
  Key? key,
}) {
  return StoryImage(
      ImageLoader(
        url,
        requestHeaders: requestHeaders,
      ),
      controller: controller,
      fit: fit,
      loadingWidget: loadingWidget,
      errorWidget: errorWidget,
      key: key,
  );
}