Skip to content

Commit dda3ea8

Browse files
committed
update some docs
1 parent 7879f90 commit dda3ea8

File tree

4 files changed

+48
-26
lines changed

4 files changed

+48
-26
lines changed

packages/stream_feed_flutter_core/lib/src/bloc/feed_bloc.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ import 'package:stream_feed_flutter_core/src/extensions.dart';
1010
///
1111
/// [GenericFeedBloc] can be access at anytime by using the factory [of] method
1212
/// using Flutter's [BuildContext].
13+
///
14+
/// Usually what you want is the convenient [FeedBloc] that already
15+
/// has the default parameters defined for you
16+
/// suitable to most use cases
17+
///
18+
/// ## Usage
19+
/// - query activities
20+
/// - query reactions (like, retweet, claps)
21+
/// - add activities (a tweet for example)
22+
/// - remove activities (delete a tweet)
23+
/// - add reactions (comment under a tweet)
24+
/// - remove reacitons (delete a comment under a tweet)
25+
/// - add child reactions (like to a comment)
26+
/// - remove child reacitons (unlike a comment)
27+
1328
class GenericFeedBloc<A, Ob, T, Or> {
1429
GenericFeedBloc({required this.client, this.analyticsClient});
1530

packages/stream_feed_flutter_core/lib/src/bloc/provider.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:stream_feed_flutter_core/src/bloc/feed_bloc.dart';
55
/// Inherited widget providing the [GenericFeedBloc] to the widget tree
66
/// Usually what you need is the convenient [FeedProvider] that already
77
/// has the default parameters defined for you
8+
/// suitable to most usecases
89
class GenericFeedProvider<A, Ob, T, Or> extends InheritedWidget {
910
const GenericFeedProvider({
1011
Key? key,

packages/stream_feed_flutter_core/lib/src/flat_feed_core.dart

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,15 @@ import 'package:stream_feed_flutter_core/src/states/states.dart';
77
import 'package:stream_feed_flutter_core/src/typedefs.dart';
88
import 'package:stream_feed_flutter_core/stream_feed_flutter_core.dart';
99

10+
/// {@template genericFlatFeedCore}
1011
/// [GenericFlatFeedCore] is a simplified class that allows fetching a list of
1112
/// enriched activities (flat) while exposing UI builders.
12-
///
13-
///
14-
/// ```dart
15-
/// class FlatActivityListPage extends StatelessWidget {
16-
/// @override
17-
/// Widget build(BuildContext context) {
18-
/// return Scaffold(
19-
/// body: GenericFlatFeedCore(
20-
/// onErrorWidget: Center(
21-
/// child: Text('An error has occurred'),
22-
/// ),
23-
/// onEmptyWidget: Center(
24-
/// child: Text('Nothing here...'),
25-
/// ),
26-
/// onProgressWidget: Center(
27-
/// child: CircularProgressIndicator(),
28-
/// ),
29-
/// feedBuilder: (context, activities, idx) {
30-
/// return YourActivityWidget(activity: activities[idx]);
31-
/// }
32-
/// ),
33-
/// );
34-
/// }
35-
/// }
36-
/// ```
37-
///
3813
/// Make sure to have a [GenericFeedProvider] ancestor in order to provide the
3914
/// information about the activities.
15+
/// Usually what you want is the convenient [FlatFeedCore] that already
16+
/// has the default parameters defined for you
17+
/// suitable to most use cases
18+
/// {@endtemplate}
4019
class GenericFlatFeedCore<A, Ob, T, Or> extends StatefulWidget {
4120
const GenericFlatFeedCore({
4221
Key? key,

packages/stream_feed_flutter_core/lib/src/typedefs.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,34 @@ typedef ReactionsBuilder = Widget Function(
2222
so this is hack until it is supported
2323
*/
2424

25+
/// {@template flatFeedCore}
2526
///Convenient typedef for [GenericFlatFeedCore] with default parameters
27+
/// ## Usage
28+
///
29+
/// ```dart
30+
/// class FlatActivityListPage extends StatelessWidget {
31+
/// @override
32+
/// Widget build(BuildContext context) {
33+
/// return Scaffold(
34+
/// body: FlatFeedCore(
35+
/// onErrorWidget: Center(
36+
/// child: Text('An error has occurred'),
37+
/// ),
38+
/// onEmptyWidget: Center(
39+
/// child: Text('Nothing here...'),
40+
/// ),
41+
/// onProgressWidget: Center(
42+
/// child: CircularProgressIndicator(),
43+
/// ),
44+
/// feedBuilder: (context, activities, idx) {
45+
/// return YourActivityWidget(activity: activities[idx]);
46+
/// }
47+
/// ),
48+
/// );
49+
/// }
50+
/// }
51+
/// ```
52+
/// {@endtemplate}
2653
typedef FlatFeedCore = GenericFlatFeedCore<User, String, String, String>;
2754

2855
///Convenient typedef for [GenericReactionListCore] with default parameters

0 commit comments

Comments
 (0)