Implement mediaplayer and content viewer
This commit is contained in:
parent
dcf3e312cf
commit
bd36e3039e
5 changed files with 183 additions and 45 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/utils/app_route.dart';
|
||||
import 'package:fluffychat/views/content_web_view.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
@ -29,27 +31,35 @@ class ContentBanner extends StatelessWidget {
|
|||
height: bannerSize,
|
||||
method: ThumbnailMethod.scale,
|
||||
);
|
||||
return Container(
|
||||
height: 200,
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
child: !loading
|
||||
? mxContent.mxc?.isNotEmpty ?? false
|
||||
? kIsWeb
|
||||
? Image.network(
|
||||
src,
|
||||
height: 200,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: src,
|
||||
height: 200,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (c, s) =>
|
||||
Center(child: CircularProgressIndicator()),
|
||||
errorWidget: (c, s, o) => Icon(Icons.error, size: 200),
|
||||
)
|
||||
: Icon(defaultIcon, size: 200)
|
||||
: Icon(defaultIcon, size: 200),
|
||||
return InkWell(
|
||||
onTap: () => Navigator.of(context).push(
|
||||
AppRoute.defaultRoute(
|
||||
context,
|
||||
ContentWebView(mxContent),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
height: 200,
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
child: !loading
|
||||
? mxContent.mxc?.isNotEmpty ?? false
|
||||
? kIsWeb
|
||||
? Image.network(
|
||||
src,
|
||||
height: 200,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: src,
|
||||
height: 200,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (c, s) =>
|
||||
Center(child: CircularProgressIndicator()),
|
||||
errorWidget: (c, s, o) => Icon(Icons.error, size: 200),
|
||||
)
|
||||
: Icon(defaultIcon, size: 200)
|
||||
: Icon(defaultIcon, size: 200),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue