diff --git a/lib/controls/timeline/interactions_bar_control.dart b/lib/controls/timeline/interactions_bar_control.dart index c121b2c..550b4bb 100644 --- a/lib/controls/timeline/interactions_bar_control.dart +++ b/lib/controls/timeline/interactions_bar_control.dart @@ -169,6 +169,19 @@ class _InteractionsBarControlState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + TextButton( + onPressed: likes == 0 ? null : () {}, + child: Text('$likes likes'), + ), + TextButton( + onPressed: reshares == 0 ? null : () {}, + child: Text('$reshares reshares'), + ), + Text('$comments comments'), + ], + ), Text('$likes likes, $reshares reshares, $comments comments'), Row(children: [ IconButton( diff --git a/lib/models/interaction_type_enum.dart b/lib/models/interaction_type_enum.dart new file mode 100644 index 0000000..c8a9379 --- /dev/null +++ b/lib/models/interaction_type_enum.dart @@ -0,0 +1,4 @@ +enum InteractionType { + like, + reshare, +} diff --git a/lib/routes.dart b/lib/routes.dart index 7524844..fbde66f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,12 +1,14 @@ import 'package:go_router/go_router.dart'; import 'globals.dart'; +import 'models/interaction_type_enum.dart'; import 'screens/contacts_screen.dart'; import 'screens/editor.dart'; import 'screens/follow_request_adjudication_screen.dart'; import 'screens/gallery_browsers_screen.dart'; import 'screens/gallery_screen.dart'; import 'screens/home.dart'; +import 'screens/interactions_viewer_screen.dart'; import 'screens/menus_screen.dart'; import 'screens/message_thread_screen.dart'; import 'screens/message_threads_browser_screen.dart'; @@ -37,6 +39,8 @@ class ScreenPaths { static String signup = '/signup'; static String userProfile = '/user_profile'; static String userPosts = '/user_posts'; + static String likes = '/likes'; + static String reshares = '/reshares'; } bool needAuthChangeInitialized = true; @@ -215,6 +219,22 @@ final appRouter = GoRouter( builder: (context, state) => UserPostsScreen(userId: state.params['id']!), ), + GoRoute( + path: '/likes/:id', + name: ScreenPaths.likes, + builder: (context, state) => InteractionsViewerScreen( + entryId: state.params['id']!, + type: InteractionType.like, + ), + ), + GoRoute( + path: '/reshares/:id', + name: ScreenPaths.reshares, + builder: (context, state) => InteractionsViewerScreen( + entryId: state.params['id']!, + type: InteractionType.reshare, + ), + ), GoRoute( path: '/user_profile/:id', name: ScreenPaths.userProfile, diff --git a/lib/screens/interactions_viewer_screen.dart b/lib/screens/interactions_viewer_screen.dart new file mode 100644 index 0000000..80134e5 --- /dev/null +++ b/lib/screens/interactions_viewer_screen.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; +import 'package:relatica/controls/standard_appbar.dart'; +import 'package:relatica/models/interaction_type_enum.dart'; + +class InteractionsViewerScreen extends StatelessWidget { + final String entryId; + final InteractionType type; + + const InteractionsViewerScreen({ + super.key, + required this.entryId, + required this.type, + }); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: StandardAppBar.build(context, buildTitle()), + body: Center( + child: Column( + children: [ + Text(buildTitle()), + ], + )), + ); + } + + String buildTitle() { + switch (type) { + case InteractionType.like: + return 'Likes'; + case InteractionType.reshare: + return 'Reshares'; + } + } +}