Skip to content

Commit b55db2a

Browse files
authored
Merge branch 'main' into safe-parse-from-json-language-detection
2 parents 7005ecd + b039630 commit b55db2a

11 files changed

+711
-707
lines changed

assets/l10n/intl_en.arb

+3-2
Original file line numberDiff line numberDiff line change
@@ -4808,8 +4808,9 @@
48084808
"knockSpaceSuccess": "You have requested to join this space! An admin will respond to your request when they receive it 😀",
48094809
"joinByCode": "Join by code",
48104810
"createASpace": "Create a space",
4811-
"inviteAndLaunch": "Invite and launch",
4811+
"inviteAndLaunch": "Launch and invite",
48124812
"createOwnChat": "Create your own chat",
48134813
"pleaseEnterInt": "Please enter a number",
4814-
"home": "Home"
4814+
"home": "Home",
4815+
"join": "Join"
48154816
}

lib/config/routes.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import 'package:fluffychat/pangea/spaces/utils/join_with_alias.dart';
4141
import 'package:fluffychat/pangea/spaces/utils/join_with_link.dart';
4242
import 'package:fluffychat/pangea/subscription/pages/settings_subscription.dart';
4343
import 'package:fluffychat/pangea/user/pages/find_partner.dart';
44-
import 'package:fluffychat/widgets/layouts/empty_page.dart';
4544
import 'package:fluffychat/widgets/layouts/two_column_layout.dart';
4645
import 'package:fluffychat/widgets/log_view.dart';
4746
import 'package:fluffychat/widgets/matrix.dart';
@@ -352,7 +351,10 @@ abstract class AppRoutes {
352351
context,
353352
state,
354353
FluffyThemes.isColumnMode(context)
355-
? const EmptyPage()
354+
// #Pangea
355+
// ? const EmptyPage()
356+
? const ActivitySuggestionsArea()
357+
// Pangea#
356358
: const Settings(),
357359
),
358360
routes: [

lib/pangea/activity_suggestions/activity_suggestion_card.dart

+68-45
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
import 'package:flutter/material.dart';
22

3-
import 'package:fluffychat/config/themes.dart';
3+
import 'package:flutter_gen/gen_l10n/l10n.dart';
4+
45
import 'package:fluffychat/pangea/activity_planner/activity_plan_model.dart';
5-
import 'package:fluffychat/pangea/activity_suggestions/activity_suggestion_card_content.dart';
6-
import 'package:fluffychat/pangea/activity_suggestions/activity_suggestion_edit_card.dart';
7-
import 'package:fluffychat/pangea/activity_suggestions/activity_suggestions_area.dart';
6+
import 'package:fluffychat/pangea/activity_suggestions/activity_suggestion_card_row.dart';
87
import 'package:fluffychat/pangea/common/widgets/pressable_button.dart';
98

109
class ActivitySuggestionCard extends StatelessWidget {
1110
final ActivityPlanModel activity;
12-
final ActivitySuggestionsAreaState controller;
1311
final VoidCallback onPressed;
1412

1513
final double width;
1614
final double height;
15+
final double padding;
1716

1817
const ActivitySuggestionCard({
1918
super.key,
2019
required this.activity,
21-
required this.controller,
2220
required this.onPressed,
2321
required this.width,
2422
required this.height,
23+
required this.padding,
2524
});
2625

27-
bool get _isSelected => controller.selectedActivity == activity;
28-
2926
@override
3027
Widget build(BuildContext context) {
3128
final theme = Theme.of(context);
3229
return Padding(
33-
padding: const EdgeInsets.all(8.0),
30+
padding: EdgeInsets.all(padding),
3431
child: PressableButton(
3532
onPressed: onPressed,
3633
borderRadius: BorderRadius.circular(24.0),
3734
color: theme.colorScheme.primary,
38-
child: AnimatedContainer(
39-
duration: FluffyThemes.animationDuration,
40-
height: controller.isEditing && _isSelected
41-
? 675
42-
: _isSelected
43-
? 400
44-
: height,
35+
child: SizedBox(
36+
height: height,
4537
width: width,
4638
child: Stack(
4739
alignment: Alignment.topCenter,
@@ -62,10 +54,7 @@ class ActivitySuggestionCard extends StatelessWidget {
6254
decoration: BoxDecoration(
6355
image: activity.imageURL != null
6456
? DecorationImage(
65-
image: controller.avatar == null || !_isSelected
66-
? NetworkImage(activity.imageURL!)
67-
: MemoryImage(controller.avatar!)
68-
as ImageProvider<Object>,
57+
image: NetworkImage(activity.imageURL!),
6958
)
7059
: null,
7160
borderRadius: BorderRadius.circular(24.0),
@@ -74,40 +63,74 @@ class ActivitySuggestionCard extends StatelessWidget {
7463
Expanded(
7564
child: Padding(
7665
padding: const EdgeInsets.only(
77-
top: 16.0,
66+
top: 12.0,
7867
left: 12.0,
7968
right: 12.0,
8069
bottom: 12.0,
8170
),
82-
child: controller.isEditing && _isSelected
83-
? ActivitySuggestionEditCard(
84-
activity: activity,
85-
controller: controller,
86-
)
87-
: ActivitySuggestionCardContent(
88-
activity: activity,
89-
isSelected: _isSelected,
90-
controller: controller,
71+
child: Column(
72+
mainAxisSize: MainAxisSize.min,
73+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
74+
children: [
75+
ActivitySuggestionCardRow(
76+
icon: Icons.event_note_outlined,
77+
child: Text(
78+
activity.title,
79+
style: const TextStyle(
80+
fontWeight: FontWeight.bold,
81+
),
82+
maxLines: 1,
83+
overflow: TextOverflow.ellipsis,
84+
),
85+
),
86+
ConstrainedBox(
87+
constraints: const BoxConstraints(maxHeight: 54.0),
88+
child: SingleChildScrollView(
89+
scrollDirection: Axis.vertical,
90+
child: Align(
91+
alignment: Alignment.topLeft,
92+
child: Wrap(
93+
spacing: 4.0,
94+
runSpacing: 4.0,
95+
children: activity.vocab
96+
.map(
97+
(vocab) => Container(
98+
padding: const EdgeInsets.symmetric(
99+
vertical: 4.0,
100+
horizontal: 8.0,
101+
),
102+
decoration: BoxDecoration(
103+
color: theme.colorScheme.primary
104+
.withAlpha(50),
105+
borderRadius:
106+
BorderRadius.circular(24.0),
107+
),
108+
child: Text(
109+
vocab.lemma,
110+
style: theme.textTheme.bodySmall,
111+
),
112+
),
113+
)
114+
.toList(),
115+
),
116+
),
117+
),
118+
),
119+
ActivitySuggestionCardRow(
120+
icon: Icons.group_outlined,
121+
child: Text(
122+
L10n.of(context).countParticipants(
123+
activity.req.numberOfParticipants,
124+
),
125+
style: theme.textTheme.bodySmall,
91126
),
127+
),
128+
],
129+
),
92130
),
93131
),
94132
],
95133
),
96-
if (controller.isEditing && _isSelected)
97-
Positioned(
98-
top: 75.0,
99-
child: InkWell(
100-
borderRadius: BorderRadius.circular(90),
101-
onTap: controller.selectPhoto,
102-
child: const CircleAvatar(
103-
radius: 16.0,
104-
child: Icon(
105-
Icons.add_a_photo_outlined,
106-
size: 16.0,
107-
),
108-
),
109-
),
110-
),
111134
],
112135
),
113136
),

lib/pangea/activity_suggestions/activity_suggestion_card_content.dart

-172
This file was deleted.

lib/pangea/activity_suggestions/activity_suggestion_card_row.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class ActivitySuggestionCardRow extends StatelessWidget {
1515
return Padding(
1616
padding: const EdgeInsets.symmetric(vertical: 4.0),
1717
child: Row(
18-
spacing: 4.0,
18+
spacing: 8.0,
1919
children: [
2020
Icon(
2121
icon,
22-
size: 12.0,
22+
size: 16.0,
2323
),
2424
Expanded(child: child),
2525
],

0 commit comments

Comments
 (0)