mirror of
https://github.com/Iconica-Development/flutter_timeline.git
synced 2025-05-19 02:23:46 +02:00
feat: use adaptive elements
This commit is contained in:
parent
035f795130
commit
bca15b6307
4 changed files with 11 additions and 5 deletions
|
@ -8,6 +8,7 @@
|
||||||
- Add a postCreationFloatingActionButtonColor to the timeline theme to set the color of the floating action button
|
- 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 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
|
- 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
|
## 3.0.1
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,12 @@ List<GoRoute> getTimelineStoryRoutes({
|
||||||
context: context,
|
context: context,
|
||||||
state: state,
|
state: state,
|
||||||
child: config.postViewOpenPageBuilder?.call(
|
child: config.postViewOpenPageBuilder?.call(
|
||||||
context, timelinePostWidget, backButton, post, category) ??
|
context,
|
||||||
|
timelinePostWidget,
|
||||||
|
backButton,
|
||||||
|
post,
|
||||||
|
category,
|
||||||
|
) ??
|
||||||
Scaffold(
|
Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: backButton,
|
leading: backButton,
|
||||||
|
|
|
@ -146,7 +146,7 @@ class _TimelinePostScreenState extends State<_TimelinePostScreen> {
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
const Center(
|
const Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.post == null) {
|
if (this.post == null) {
|
||||||
|
@ -166,7 +166,7 @@ class _TimelinePostScreenState extends State<_TimelinePostScreen> {
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
RefreshIndicator(
|
RefreshIndicator.adaptive(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
updatePost(
|
updatePost(
|
||||||
await widget.service.postService.fetchPostDetails(
|
await widget.service.postService.fetchPostDetails(
|
||||||
|
|
|
@ -108,7 +108,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (isLoading && widget.posts == null) {
|
if (isLoading && widget.posts == null) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the list of posts
|
// Build the list of posts
|
||||||
|
@ -222,7 +222,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
|
||||||
height: 12,
|
height: 12,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator.adaptive(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
await widget.onRefresh?.call(context, category);
|
await widget.onRefresh?.call(context, category);
|
||||||
await loadPosts();
|
await loadPosts();
|
||||||
|
|
Loading…
Reference in a new issue