fix: feedback

This commit is contained in:
mike doornenbal 2024-04-23 13:39:49 +02:00
parent 7b76a8d956
commit a964830cc1
7 changed files with 40 additions and 24 deletions

View file

@ -1,3 +1,8 @@
## 2.3.1
- Updated readme.
- fixed bug in `localTimelinePostService` where it was not possible to make a post.
## 2.3.0 ## 2.3.0
- Added separate open page builders for timeline screens - Added separate open page builders for timeline screens

View file

@ -1,6 +1,6 @@
# Flutter Timeline # Flutter Timeline
Flutter Timeline is a package which shows a list posts by a user. This package also has additional features like liking a post and leaving comments. Default this package adds support for a Firebase back-end. You can add your custom back-end (like a Websocket-API) by extending the `CommunityChatInterface` interface from the `flutter_community_chat_interface` package. Flutter Timeline is a package which shows a list posts by a user. This package also has additional features like liking a post and leaving comments. Default this package adds support for a Firebase back-end.
![Flutter Timeline GIF](example.gif) ![Flutter Timeline GIF](example.gif)
@ -8,7 +8,7 @@ Flutter Timeline is a package which shows a list posts by a user. This package a
To use this package, add flutter_timeline as a dependency in your pubspec.yaml file: To use this package, add flutter_timeline as a dependency in your pubspec.yaml file:
``` ```
flutter_timeline flutter_timeline:
git: git:
url: https://github.com/Iconica-Development/flutter_timeline.git url: https://github.com/Iconica-Development/flutter_timeline.git
path: packages/flutter_timeline path: packages/flutter_timeline
@ -23,7 +23,13 @@ If you are going to use Firebase as the back-end of the Timeline, you should als
path: packages/flutter_timeline_firebase path: packages/flutter_timeline_firebase
``` ```
In firebase add firestore and storage to your project.
In firestore add a collection named `timeline` and a collection named `users`.
In the `timeline` collection all posts will be stored. In the `users` collection all users will be stored.
In the `users` collection you should add your users data.
Add the following code in your `main` function, before the runApp(). Add the following code in your `main` function, before the runApp().
And import this package: import 'package:intl/date_symbol_data_local.dart';
``` ```
initializeDateFormatting(); initializeDateFormatting();
``` ```
@ -35,12 +41,15 @@ Add go_router as dependency to your project.
Add the following configuration to your flutter_application: Add the following configuration to your flutter_application:
``` ```
List<GoRoute> getTimelineStoryRoutes() => getTimelineStoryRoutes( List<GoRoute> getTimelineStoryRoutes() =>
getTimelineStoryRoutes(
TimelineUserStoryConfiguration( TimelineUserStoryConfiguration(
service: FirebaseTimelineService(), service: TimelineService(
userService: FirebaseUserService(), postService: LocalTimelinePostService(),
userId: currentUserId, ),
optionsBuilder: (context) => FirebaseOptions(), optionsBuilder: (context) {
return const TimelineOptions();
},
), ),
); );
``` ```
@ -58,7 +67,7 @@ final GoRouter _router = GoRouter(
); );
}, },
), ),
...getTimelineStoryRoutes(timelineUserStoryConfiguration) ...getTimelineStoryRoutes(configuration: configuration);
], ],
); );
``` ```
@ -171,7 +180,7 @@ The `TimelineOptions` has its own parameters, as specified below:
| categoriesOptions | Options for using the category selector to provide posts of a certain category. | | categoriesOptions | Options for using the category selector to provide posts of a certain category. |
The `ImagePickerTheme` ans `imagePickerConfig` also have their own parameters, how to use these parameters can be found in [the documentation of the flutter_image_picker package](https://github.com/Iconica-Development/flutter_image_picker). The `ImagePickerTheme` and `imagePickerConfig` also have their own parameters, how to use these parameters can be found in [the documentation of the flutter_image_picker package](https://github.com/Iconica-Development/flutter_image_picker).
## Issues ## Issues

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
name: flutter_timeline name: flutter_timeline
description: Visual elements and interface combined into one package description: Visual elements and interface combined into one package
version: 2.3.0 version: 2.3.1
publish_to: none publish_to: none
@ -19,13 +19,13 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_timeline url: https://github.com/Iconica-Development/flutter_timeline
path: packages/flutter_timeline_view path: packages/flutter_timeline_view
ref: 2.3.0 ref: 2.3.1
flutter_timeline_interface: flutter_timeline_interface:
git: git:
url: https://github.com/Iconica-Development/flutter_timeline url: https://github.com/Iconica-Development/flutter_timeline
path: packages/flutter_timeline_interface path: packages/flutter_timeline_interface
ref: 2.3.0 ref: 2.3.1
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0

View file

@ -4,7 +4,7 @@
name: flutter_timeline_firebase name: flutter_timeline_firebase
description: Implementation of the Flutter Timeline interface for Firebase. description: Implementation of the Flutter Timeline interface for Firebase.
version: 2.3.0 version: 2.3.1
publish_to: none publish_to: none
@ -23,7 +23,7 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_timeline url: https://github.com/Iconica-Development/flutter_timeline
path: packages/flutter_timeline_interface path: packages/flutter_timeline_interface
ref: 2.3.0 ref: 2.3.1
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0

View file

@ -4,7 +4,7 @@
name: flutter_timeline_interface name: flutter_timeline_interface
description: Interface for the service of the Flutter Timeline component description: Interface for the service of the Flutter Timeline component
version: 2.3.0 version: 2.3.1
publish_to: none publish_to: none

View file

@ -86,7 +86,9 @@ class LocalTimelinePostService
@override @override
Future<List<TimelinePost>> fetchPosts(String? category) async { Future<List<TimelinePost>> fetchPosts(String? category) async {
if (posts.isEmpty) {
posts = getMockedPosts(); posts = getMockedPosts();
}
notifyListeners(); notifyListeners();
return posts; return posts;
} }

View file

@ -4,7 +4,7 @@
name: flutter_timeline_view name: flutter_timeline_view
description: Visual elements of the Flutter Timeline Component description: Visual elements of the Flutter Timeline Component
version: 2.3.0 version: 2.3.1
publish_to: none publish_to: none
@ -23,7 +23,7 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_timeline url: https://github.com/Iconica-Development/flutter_timeline
path: packages/flutter_timeline_interface path: packages/flutter_timeline_interface
ref: 2.3.0 ref: 2.3.1
flutter_image_picker: flutter_image_picker:
git: git:
url: https://github.com/Iconica-Development/flutter_image_picker url: https://github.com/Iconica-Development/flutter_image_picker