Skip to content

Commit

Permalink
fix drag images error
Browse files Browse the repository at this point in the history
  • Loading branch information
codenameakshay committed Nov 14, 2021
1 parent af9054d commit 6fc2ac7
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ class _HomePageState extends State<HomePage> {
setState(() {
_loading = true;
});
_fileLink = await _ds
.uploadFileAnonymous(File(detail.urls.first.toFilePath()));
if (detail.urls.isNotEmpty) {
_fileLink = await _ds.uploadFileAnonymous(
File(detail.urls.first.toFilePath()));
}
setState(() {
_loading = false;
});
Expand Down Expand Up @@ -74,16 +76,23 @@ class _HomePageState extends State<HomePage> {
onTap: _fileLink != null
? () => launch(_fileLink ?? '')
: null,
child: Text(
_fileLink == null
? 'Drop a file to start'
: _fileLink.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w100,
color: Colors.white.withOpacity(0.3),
),
),
child: _fileLink == null
? Text(
'Drop a file to start',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w100,
color: Colors.white.withOpacity(0.3),
),
)
: SelectableText(
_fileLink.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w100,
color: Colors.white.withOpacity(0.3),
),
),
),
),
),
Expand Down

0 comments on commit 6fc2ac7

Please sign in to comment.