fix: Firebase implementation

This commit is contained in:
Jacques 2024-01-29 16:07:16 +01:00
parent 179841f930
commit 1fc7c8d2de
5 changed files with 7 additions and 7 deletions

View file

@ -10,7 +10,7 @@ import 'package:go_router/go_router.dart';
List<GoRoute> getTimelineStoryRoutes({ List<GoRoute> getTimelineStoryRoutes({
TimelineUserStoryConfiguration? configuration, TimelineUserStoryConfiguration? configuration,
}) { }) {
var config = configuration ??= TimelineUserStoryConfiguration( var config = configuration ?? TimelineUserStoryConfiguration(
userId: 'test_user', userId: 'test_user',
service: TimelineService( service: TimelineService(
postService: LocalTimelinePostService(), postService: LocalTimelinePostService(),

View file

@ -9,9 +9,9 @@ import 'package:flutter_timeline_view/flutter_timeline_view.dart';
@immutable @immutable
class TimelineUserStoryConfiguration { class TimelineUserStoryConfiguration {
const TimelineUserStoryConfiguration({ const TimelineUserStoryConfiguration({
required this.userId,
required this.service, required this.service,
required this.optionsBuilder, required this.optionsBuilder,
this.userId = 'test_user',
this.openPageBuilder, this.openPageBuilder,
this.onPostTap, this.onPostTap,
this.onUserTap, this.onUserTap,

View file

@ -7,4 +7,5 @@ library flutter_timeline_firebase;
export 'src/config/firebase_timeline_options.dart'; export 'src/config/firebase_timeline_options.dart';
export 'src/service/firebase_post_service.dart'; export 'src/service/firebase_post_service.dart';
export 'src/service/firebase_timeline_service.dart';
export 'src/service/firebase_user_service.dart'; export 'src/service/firebase_user_service.dart';

View file

@ -9,8 +9,7 @@ class FirebaseTimelineService implements TimelineService {
this.firebasePostService, this.firebasePostService,
this.firebaseUserService, this.firebaseUserService,
}) { }) {
firebaseUserService ??= FirebaseTimelinePostService( firebaseUserService ??= FirebaseTimelineUserService(
userService: userService,
options: options, options: options,
app: app, app: app,
); );
@ -45,7 +44,7 @@ class FirebaseTimelineService implements TimelineService {
if (firebaseUserService != null) { if (firebaseUserService != null) {
return firebaseUserService!; return firebaseUserService!;
} else { } else {
return FirebaseUserService( return FirebaseTimelineUserService(
options: options, options: options,
app: app, app: app,
); );

View file

@ -8,8 +8,8 @@ import 'package:flutter_timeline_firebase/src/config/firebase_timeline_options.d
import 'package:flutter_timeline_firebase/src/models/firebase_user_document.dart'; import 'package:flutter_timeline_firebase/src/models/firebase_user_document.dart';
import 'package:flutter_timeline_interface/flutter_timeline_interface.dart'; import 'package:flutter_timeline_interface/flutter_timeline_interface.dart';
class FirebaseUserService implements TimelineUserService { class FirebaseTimelineUserService implements TimelineUserService {
FirebaseUserService({ FirebaseTimelineUserService({
FirebaseApp? app, FirebaseApp? app,
options = const FirebaseTimelineOptions(), options = const FirebaseTimelineOptions(),
}) { }) {