Skip to content

Commit

Permalink
assume fixed size
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed May 17, 2024
1 parent b6601eb commit cc8a780
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions lib/Frontend/Widgets/tail_blog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class _TailBlogState extends State<TailBlog> {
alignment: Alignment.center,
firstChild: feedState == FeedState.loading ? const LinearProgressIndicator() : Container(),
secondChild: ListView.builder(
itemExtent: 300,
controller: widget.controller,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
Expand All @@ -41,35 +42,39 @@ class _TailBlogState extends State<TailBlog> {
padding: const EdgeInsets.all(8.0),
child: Card(
clipBehavior: Clip.antiAlias,
child: InkWell(
onTap: () async {
await launchUrl(Uri.parse("${feedItem.url}?utm_source=Tail_App'"));
},
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
if (feedItem.imageId != null) ...[
FutureBuilder(
future: getImage(feedItem, context),
builder: (BuildContext context, AsyncSnapshot<Widget> snapshot) {
return AnimatedSize(
duration: animationTransitionDuration,
child: snapshot.hasData ? snapshot.data! : Container(),
);
},
)
],
Card(
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.zero,
elevation: 2,
child: ListTile(
//leading: Icon(feedItem.feedType.icon),
trailing: const Icon(Icons.open_in_browser),
title: Text(feedItem.title),
child: SizedBox(
height: 300,
child: InkWell(
onTap: () async {
await launchUrl(Uri.parse("${feedItem.url}?utm_source=Tail_App'"));
},
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
if (feedItem.imageId != null) ...[
FutureBuilder(
future: getImage(feedItem, context),
builder: (BuildContext context, AsyncSnapshot<Widget> snapshot) {
return AnimatedOpacity(
duration: animationTransitionDuration,
opacity: snapshot.hasData ? 1 : 0,
child: snapshot.hasData ? snapshot.data! : Container(),
);
},
)
],
Card(
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.zero,
elevation: 2,
child: ListTile(
//leading: Icon(feedItem.feedType.icon),
trailing: const Icon(Icons.open_in_browser),
title: Text(feedItem.title),
),
),
),
],
],
),
),
),
),
Expand Down Expand Up @@ -99,7 +104,7 @@ class _TailBlogState extends State<TailBlog> {
if (_wordpressPosts.isEmpty) {
final ListPostRequest request = ListPostRequest(
page: 1,
perPage: 5,
perPage: 10,
order: Order.desc,
);
final WordpressResponse<List<Post>> wordpressPostResponse = await client.posts.list(request);
Expand Down

0 comments on commit cc8a780

Please sign in to comment.