feat: use adaptive elements

This commit is contained in:
Freek van de Ven 2024-05-21 14:16:18 +02:00
parent 035f795130
commit bca15b6307
4 changed files with 11 additions and 5 deletions

View file

@ -8,6 +8,7 @@
- Add a postCreationFloatingActionButtonColor to the timeline theme to set the color of the floating action button
- Add a post and a category to the postViewOpenPageBuilder function
- Add a refresh functionality to the timeline with a pull to refresh callback to allow additional functionality when refreshing the timeline
- Use the adaptive variants of the material elements in the timeline
## 3.0.1

View file

@ -166,7 +166,12 @@ List<GoRoute> getTimelineStoryRoutes({
context: context,
state: state,
child: config.postViewOpenPageBuilder?.call(
context, timelinePostWidget, backButton, post, category) ??
context,
timelinePostWidget,
backButton,
post,
category,
) ??
Scaffold(
appBar: AppBar(
leading: backButton,

View file

@ -146,7 +146,7 @@ class _TimelinePostScreenState extends State<_TimelinePostScreen> {
if (isLoading) {
const Center(
child: CircularProgressIndicator(),
child: CircularProgressIndicator.adaptive(),
);
}
if (this.post == null) {
@ -166,7 +166,7 @@ class _TimelinePostScreenState extends State<_TimelinePostScreen> {
return Stack(
children: [
RefreshIndicator(
RefreshIndicator.adaptive(
onRefresh: () async {
updatePost(
await widget.service.postService.fetchPostDetails(

View file

@ -108,7 +108,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
@override
Widget build(BuildContext context) {
if (isLoading && widget.posts == null) {
return const Center(child: CircularProgressIndicator());
return const Center(child: CircularProgressIndicator.adaptive());
}
// Build the list of posts
@ -222,7 +222,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
height: 12,
),
Expanded(
child: RefreshIndicator(
child: RefreshIndicator.adaptive(
onRefresh: () async {
await widget.onRefresh?.call(context, category);
await loadPosts();