mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 12:23:31 +00:00
Interactions Screens interim commit
This commit is contained in:
parent
0e60aba2f6
commit
089fca1790
4 changed files with 73 additions and 0 deletions
|
@ -169,6 +169,19 @@ class _InteractionsBarControlState extends State<InteractionsBarControl> {
|
|||
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(
|
||||
|
|
4
lib/models/interaction_type_enum.dart
Normal file
4
lib/models/interaction_type_enum.dart
Normal file
|
@ -0,0 +1,4 @@
|
|||
enum InteractionType {
|
||||
like,
|
||||
reshare,
|
||||
}
|
|
@ -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,
|
||||
|
|
36
lib/screens/interactions_viewer_screen.dart
Normal file
36
lib/screens/interactions_viewer_screen.dart
Normal file
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue