Interactions Screens interim commit

codemagic-setup
Hank Grabowski 2023-01-30 22:22:08 -05:00
rodzic 0e60aba2f6
commit 089fca1790
4 zmienionych plików z 73 dodań i 0 usunięć

Wyświetl plik

@ -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(

Wyświetl plik

@ -0,0 +1,4 @@
enum InteractionType {
like,
reshare,
}

Wyświetl plik

@ -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,

Wyświetl plik

@ -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';
}
}
}