transition to another image widget
This commit is contained in:
parent
7be6db1a88
commit
0b72aab64a
|
@ -21,6 +21,6 @@
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>8.0</string>
|
<string>9.0</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
PODS:
|
PODS:
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- FMDB (2.7.5):
|
|
||||||
- FMDB/standard (= 2.7.5)
|
|
||||||
- FMDB/standard (2.7.5)
|
|
||||||
- image_picker (0.0.1):
|
- image_picker (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- package_info_plus (0.4.5):
|
- package_info_plus (0.4.5):
|
||||||
|
@ -13,9 +10,6 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
- shared_preferences (0.0.1):
|
- shared_preferences (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- sqflite (0.0.2):
|
|
||||||
- Flutter
|
|
||||||
- FMDB (>= 2.7.5)
|
|
||||||
- url_launcher (0.0.1):
|
- url_launcher (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
|
@ -26,13 +20,8 @@ DEPENDENCIES:
|
||||||
- path_provider (from `.symlinks/plugins/path_provider/ios`)
|
- path_provider (from `.symlinks/plugins/path_provider/ios`)
|
||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
|
|
||||||
SPEC REPOS:
|
|
||||||
trunk:
|
|
||||||
- FMDB
|
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
|
@ -46,22 +35,18 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/share_plus/ios"
|
:path: ".symlinks/plugins/share_plus/ios"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||||
sqflite:
|
|
||||||
:path: ".symlinks/plugins/sqflite/ios"
|
|
||||||
url_launcher:
|
url_launcher:
|
||||||
:path: ".symlinks/plugins/url_launcher/ios"
|
:path: ".symlinks/plugins/url_launcher/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
||||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
|
||||||
image_picker: e06f7a68f000bd36f552c1847e33cda96ed31f1f
|
image_picker: e06f7a68f000bd36f552c1847e33cda96ed31f1f
|
||||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||||
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
||||||
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
||||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||||
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
|
||||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||||
|
|
||||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||||
|
|
||||||
COCOAPODS: 1.11.0
|
COCOAPODS: 1.11.2
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:lemmy_api_client/v3.dart';
|
import 'package:lemmy_api_client/v3.dart';
|
||||||
|
@ -9,6 +8,7 @@ import '../hooks/delayed_loading.dart';
|
||||||
import '../hooks/stores.dart';
|
import '../hooks/stores.dart';
|
||||||
import '../l10n/l10n.dart';
|
import '../l10n/l10n.dart';
|
||||||
import '../stores/config_store.dart';
|
import '../stores/config_store.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/fullscreenable_image.dart';
|
import '../widgets/fullscreenable_image.dart';
|
||||||
import '../widgets/radio_picker.dart';
|
import '../widgets/radio_picker.dart';
|
||||||
import 'add_instance.dart';
|
import 'add_instance.dart';
|
||||||
|
@ -96,7 +96,7 @@ class AddAccountPage extends HookWidget {
|
||||||
url: icon.value!,
|
url: icon.value!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: icon.value!,
|
imageUrl: icon.value!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:lemmy_api_client/v3.dart';
|
import 'package:lemmy_api_client/v3.dart';
|
||||||
|
@ -6,6 +5,7 @@ import 'package:lemmy_api_client/v3.dart';
|
||||||
import '../hooks/debounce.dart';
|
import '../hooks/debounce.dart';
|
||||||
import '../hooks/stores.dart';
|
import '../hooks/stores.dart';
|
||||||
import '../util/cleanup_url.dart';
|
import '../util/cleanup_url.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/fullscreenable_image.dart';
|
import '../widgets/fullscreenable_image.dart';
|
||||||
|
|
||||||
/// A page that let's user add a new instance. Pops a url of the added instance
|
/// A page that let's user add a new instance. Pops a url of the added instance
|
||||||
|
@ -76,7 +76,7 @@ class AddInstancePage extends HookWidget {
|
||||||
url: icon.value!,
|
url: icon.value!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: icon.value!,
|
imageUrl: icon.value!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
else if (isSite.value == false)
|
else if (isSite.value == false)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
@ -18,6 +17,7 @@ import '../util/more_icon.dart';
|
||||||
import '../util/share.dart';
|
import '../util/share.dart';
|
||||||
import '../widgets/avatar.dart';
|
import '../widgets/avatar.dart';
|
||||||
import '../widgets/bottom_modal.dart';
|
import '../widgets/bottom_modal.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/fullscreenable_image.dart';
|
import '../widgets/fullscreenable_image.dart';
|
||||||
import '../widgets/info_table_popup.dart';
|
import '../widgets/info_table_popup.dart';
|
||||||
import '../widgets/markdown_text.dart';
|
import '../widgets/markdown_text.dart';
|
||||||
|
@ -270,7 +270,7 @@ class _CommunityOverview extends StatelessWidget {
|
||||||
url: community.community.banner!,
|
url: community.community.banner!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: community.community.banner!,
|
imageUrl: community.community.banner!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SafeArea(
|
SafeArea(
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:math' show max;
|
import 'dart:math' show max;
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:lemmy_api_client/v3.dart';
|
import 'package:lemmy_api_client/v3.dart';
|
||||||
|
@ -11,6 +10,7 @@ import '../hooks/stores.dart';
|
||||||
import '../l10n/l10n.dart';
|
import '../l10n/l10n.dart';
|
||||||
import '../util/goto.dart';
|
import '../util/goto.dart';
|
||||||
import '../widgets/bottom_modal.dart';
|
import '../widgets/bottom_modal.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/infinite_scroll.dart';
|
import '../widgets/infinite_scroll.dart';
|
||||||
import '../widgets/sortable_infinite_list.dart';
|
import '../widgets/sortable_infinite_list.dart';
|
||||||
import 'add_account.dart';
|
import 'add_account.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:math' show pi;
|
import 'dart:math' show pi;
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:lemmy_api_client/v3.dart';
|
import 'package:lemmy_api_client/v3.dart';
|
||||||
|
@ -16,6 +15,7 @@ import '../util/extensions/datetime.dart';
|
||||||
import '../util/goto.dart';
|
import '../util/goto.dart';
|
||||||
import '../util/more_icon.dart';
|
import '../util/more_icon.dart';
|
||||||
import '../widgets/bottom_modal.dart';
|
import '../widgets/bottom_modal.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/comment/comment.dart';
|
import '../widgets/comment/comment.dart';
|
||||||
import '../widgets/infinite_scroll.dart';
|
import '../widgets/infinite_scroll.dart';
|
||||||
import '../widgets/info_table_popup.dart';
|
import '../widgets/info_table_popup.dart';
|
||||||
|
@ -307,7 +307,7 @@ class PrivateMessageTile extends HookWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:lemmy_api_client/v3.dart';
|
import 'package:lemmy_api_client/v3.dart';
|
||||||
|
@ -14,6 +13,7 @@ import '../util/share.dart';
|
||||||
import '../util/text_color.dart';
|
import '../util/text_color.dart';
|
||||||
import '../widgets/avatar.dart';
|
import '../widgets/avatar.dart';
|
||||||
import '../widgets/bottom_modal.dart';
|
import '../widgets/bottom_modal.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/fullscreenable_image.dart';
|
import '../widgets/fullscreenable_image.dart';
|
||||||
import '../widgets/info_table_popup.dart';
|
import '../widgets/info_table_popup.dart';
|
||||||
import '../widgets/markdown_text.dart';
|
import '../widgets/markdown_text.dart';
|
||||||
|
@ -126,7 +126,7 @@ class InstancePage extends HookWidget {
|
||||||
url: siteView.site.banner!,
|
url: siteView.site.banner!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: siteView.site.banner!,
|
imageUrl: siteView.site.banner!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SafeArea(
|
SafeArea(
|
||||||
|
@ -143,7 +143,7 @@ class InstancePage extends HookWidget {
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
imageUrl: siteView.site.icon!,
|
imageUrl: siteView.site.icon!,
|
||||||
errorWidget: (_, __, ___) =>
|
errorBuilder: (_, ___) =>
|
||||||
const Icon(Icons.warning),
|
const Icon(Icons.warning),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
@ -14,6 +13,7 @@ import '../util/more_icon.dart';
|
||||||
import '../util/pictrs.dart';
|
import '../util/pictrs.dart';
|
||||||
import '../widgets/bottom_modal.dart';
|
import '../widgets/bottom_modal.dart';
|
||||||
import '../widgets/bottom_safe.dart';
|
import '../widgets/bottom_safe.dart';
|
||||||
|
import '../widgets/cached_network_image.dart';
|
||||||
import '../widgets/editor.dart';
|
import '../widgets/editor.dart';
|
||||||
|
|
||||||
/// Page for managing things like username, email, avatar etc
|
/// Page for managing things like username, email, avatar etc
|
||||||
|
@ -506,7 +506,7 @@ class _ImagePicker extends HookWidget {
|
||||||
if (url.value != null)
|
if (url.value != null)
|
||||||
CachedNetworkImage(
|
CachedNetworkImage(
|
||||||
imageUrl: url.value!,
|
imageUrl: url.value!,
|
||||||
errorWidget: (_, __, ___) => const Icon(Icons.error),
|
errorBuilder: (_, ___) => const Icon(Icons.error),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import 'dart:math' show max, min;
|
import 'dart:math' show max, min;
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:extended_image/extended_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
@ -144,7 +144,7 @@ class MediaViewPage extends HookWidget {
|
||||||
: (_, __, ___) => showButtons.value = !showButtons.value,
|
: (_, __, ___) => showButtons.value = !showButtons.value,
|
||||||
minScale: PhotoViewComputedScale.contained,
|
minScale: PhotoViewComputedScale.contained,
|
||||||
initialScale: PhotoViewComputedScale.contained,
|
initialScale: PhotoViewComputedScale.contained,
|
||||||
imageProvider: CachedNetworkImageProvider(url),
|
imageProvider: ExtendedNetworkImageProvider(url, cache: true),
|
||||||
heroAttributes: PhotoViewHeroAttributes(tag: url),
|
heroAttributes: PhotoViewHeroAttributes(tag: url),
|
||||||
loadingBuilder: (context, event) =>
|
loadingBuilder: (context, event) =>
|
||||||
const Center(child: CircularProgressIndicator()),
|
const Center(child: CircularProgressIndicator()),
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
|
||||||
import '../hooks/stores.dart';
|
import '../hooks/stores.dart';
|
||||||
|
import 'cached_network_image.dart';
|
||||||
|
|
||||||
/// User's avatar. Respects the `showAvatars` setting from configStore
|
/// User's avatar. Respects the `showAvatars` setting from configStore
|
||||||
/// If passed url is null, a blank box is displayed to prevent weird indents
|
/// If passed url is null, a blank box is displayed to prevent weird indents
|
||||||
|
@ -50,7 +50,7 @@ class Avatar extends HookWidget {
|
||||||
width: radius * 2,
|
width: radius * 2,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
errorWidget: (_, __, ___) => blankWidget,
|
errorBuilder: (_, __) => blankWidget,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
import 'package:extended_image/extended_image.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
typedef ImageBuilder = Widget Function(
|
||||||
|
BuildContext context, ImageProvider imageProvider);
|
||||||
|
|
||||||
|
typedef LoadingBuilder = Widget Function(
|
||||||
|
BuildContext context, ImageChunkEvent? progress);
|
||||||
|
|
||||||
|
typedef ErrorBuilder = Widget Function(
|
||||||
|
BuildContext context, Object? lastException);
|
||||||
|
|
||||||
|
extension Progress on ImageChunkEvent {
|
||||||
|
double? get progress {
|
||||||
|
if (expectedTotalBytes == null ||
|
||||||
|
cumulativeBytesLoaded > expectedTotalBytes!) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return cumulativeBytesLoaded / expectedTotalBytes!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CachedNetworkImage extends StatelessWidget {
|
||||||
|
final String imageUrl;
|
||||||
|
final double? height;
|
||||||
|
final double? width;
|
||||||
|
final BoxFit? fit;
|
||||||
|
final bool cache;
|
||||||
|
|
||||||
|
final ErrorBuilder? errorBuilder;
|
||||||
|
final LoadingBuilder? loadingBuilder;
|
||||||
|
final ImageBuilder? imageBuilder;
|
||||||
|
|
||||||
|
const CachedNetworkImage({
|
||||||
|
required this.imageUrl,
|
||||||
|
this.errorBuilder,
|
||||||
|
this.loadingBuilder,
|
||||||
|
this.imageBuilder,
|
||||||
|
this.height,
|
||||||
|
this.width,
|
||||||
|
this.fit,
|
||||||
|
this.cache = true,
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ExtendedImage.network(
|
||||||
|
imageUrl,
|
||||||
|
height: height,
|
||||||
|
width: width,
|
||||||
|
fit: fit,
|
||||||
|
cache: cache,
|
||||||
|
loadStateChanged: (state) {
|
||||||
|
switch (state.extendedImageLoadState) {
|
||||||
|
case LoadState.loading:
|
||||||
|
return loadingBuilder?.call(context, state.loadingProgress) ??
|
||||||
|
SizedBox(height: height, width: width);
|
||||||
|
case LoadState.completed:
|
||||||
|
return imageBuilder?.call(context, state.imageProvider);
|
||||||
|
case LoadState.failed:
|
||||||
|
return errorBuilder?.call(context, state.lastException);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import 'package:markdown/markdown.dart' as md;
|
import 'package:markdown/markdown.dart' as md;
|
||||||
|
|
||||||
import '../url_launcher.dart';
|
import '../url_launcher.dart';
|
||||||
|
import 'cached_network_image.dart';
|
||||||
import 'fullscreenable_image.dart';
|
import 'fullscreenable_image.dart';
|
||||||
|
|
||||||
/// A Markdown renderer with link/image handling
|
/// A Markdown renderer with link/image handling
|
||||||
|
@ -52,7 +52,7 @@ class MarkdownText extends StatelessWidget {
|
||||||
url: uri.toString(),
|
url: uri.toString(),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: uri.toString(),
|
imageUrl: uri.toString(),
|
||||||
errorWidget: (context, url, error) => Row(
|
errorBuilder: (context, error) => Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.warning),
|
const Icon(Icons.warning),
|
||||||
Text("couldn't load image, ${error.toString()}")
|
Text("couldn't load image, ${error.toString()}")
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
@ -23,6 +22,7 @@ import '../util/more_icon.dart';
|
||||||
import '../util/share.dart';
|
import '../util/share.dart';
|
||||||
import 'avatar.dart';
|
import 'avatar.dart';
|
||||||
import 'bottom_modal.dart';
|
import 'bottom_modal.dart';
|
||||||
|
import 'cached_network_image.dart';
|
||||||
import 'fullscreenable_image.dart';
|
import 'fullscreenable_image.dart';
|
||||||
import 'info_table_popup.dart';
|
import 'info_table_popup.dart';
|
||||||
import 'markdown_text.dart';
|
import 'markdown_text.dart';
|
||||||
|
@ -309,7 +309,7 @@ class PostWidget extends HookWidget {
|
||||||
width: 70,
|
width: 70,
|
||||||
height: 70,
|
height: 70,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
errorWidget: (context, url, error) =>
|
errorBuilder: (context, error) =>
|
||||||
Text(error.toString()),
|
Text(error.toString()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -397,9 +397,9 @@ class PostWidget extends HookWidget {
|
||||||
url: post.post.url!,
|
url: post.post.url!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: post.post.url!,
|
imageUrl: post.post.url!,
|
||||||
errorWidget: (_, __, ___) => const Icon(Icons.warning),
|
errorBuilder: (_, ___) => const Icon(Icons.warning),
|
||||||
progressIndicatorBuilder: (context, url, progress) =>
|
loadingBuilder: (context, progress) =>
|
||||||
CircularProgressIndicator(value: progress.progress),
|
CircularProgressIndicator(value: progress?.progress),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
@ -14,6 +13,7 @@ import '../util/extensions/datetime.dart';
|
||||||
import '../util/goto.dart';
|
import '../util/goto.dart';
|
||||||
import '../util/text_color.dart';
|
import '../util/text_color.dart';
|
||||||
import 'avatar.dart';
|
import 'avatar.dart';
|
||||||
|
import 'cached_network_image.dart';
|
||||||
import 'fullscreenable_image.dart';
|
import 'fullscreenable_image.dart';
|
||||||
import 'markdown_text.dart';
|
import 'markdown_text.dart';
|
||||||
import 'sortable_infinite_list.dart';
|
import 'sortable_infinite_list.dart';
|
||||||
|
@ -147,7 +147,7 @@ class _UserOverview extends HookWidget {
|
||||||
url: userView.person.banner!,
|
url: userView.person.banner!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: userView.person.banner!,
|
imageUrl: userView.person.banner!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
@ -208,7 +208,7 @@ class _UserOverview extends HookWidget {
|
||||||
url: userView.person.avatar!,
|
url: userView.person.avatar!,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: userView.person.avatar!,
|
imageUrl: userView.person.avatar!,
|
||||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
errorBuilder: (_, ___) => const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
100
pubspec.lock
100
pubspec.lock
|
@ -99,27 +99,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.2"
|
version: "8.1.2"
|
||||||
cached_network_image:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: cached_network_image
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.0"
|
|
||||||
cached_network_image_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: cached_network_image_platform_interface
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
cached_network_image_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: cached_network_image_web
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -204,6 +183,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
extended_image:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: extended_image
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.2"
|
||||||
|
extended_image_library:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: extended_image_library
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -237,20 +230,6 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_blurhash:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_blurhash
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.6.0"
|
|
||||||
flutter_cache_manager:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_cache_manager
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.2"
|
|
||||||
flutter_hooks:
|
flutter_hooks:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -357,6 +336,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.13.3"
|
version: "0.13.3"
|
||||||
|
http_client_helper:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_client_helper
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -525,13 +511,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
octo_image:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: octo_image
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0+1"
|
|
||||||
package_config:
|
package_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -695,13 +674,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
rxdart:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rxdart
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.27.2"
|
|
||||||
share_plus:
|
share_plus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -826,20 +798,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.8.1"
|
||||||
sqflite:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: sqflite
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0+4"
|
|
||||||
sqflite_common:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: sqflite_common
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.1+1"
|
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -868,13 +826,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
synchronized:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: synchronized
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -952,13 +903,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.2"
|
||||||
uuid:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: uuid
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.4"
|
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1010,4 +954,4 @@ packages:
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.14.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=2.0.0"
|
flutter: ">=2.5.0"
|
||||||
|
|
|
@ -30,7 +30,6 @@ dependencies:
|
||||||
ref: bugfix/flutter-2.5-update
|
ref: bugfix/flutter-2.5-update
|
||||||
markdown: ^4.0.0
|
markdown: ^4.0.0
|
||||||
flutter_markdown: ^0.6.1
|
flutter_markdown: ^0.6.1
|
||||||
cached_network_image: ^3.0.0
|
|
||||||
modal_bottom_sheet: ^2.0.0
|
modal_bottom_sheet: ^2.0.0
|
||||||
|
|
||||||
# native
|
# native
|
||||||
|
@ -65,6 +64,7 @@ dependencies:
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
extended_image: ^5.1.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Loading…
Reference in New Issue