-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid importing
dart:io
directly (#449)
- Loading branch information
1 parent
350e8d1
commit 5037175
Showing
6 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/core/lib/src/internal/platform_specific/fallback.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
ImageProvider? fileImageProvider(String path) => null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/widgets.dart'; | ||
|
||
ImageProvider? fileImageProvider(String path) => FileImage(File(path)); |
3 changes: 3 additions & 0 deletions
3
packages/enhanced/lib/src/internal/platform_specific/fallback.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
PictureProvider filePictureProvider(String path) => null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
PictureProvider filePictureProvider(String path) => | ||
FilePicture(SvgPicture.svgByteDecoder, File(path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5037175
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demo app
Deployed 5037175 to https://example-rjrfudqbt-flutter-widget-from-html.vercel.app.
Quick links: