chore: added button to go to activity generator page to activity planner page (#2309)
This commit is contained in:
parent
bfaad6d193
commit
e3961db0d6
3 changed files with 78 additions and 23 deletions
|
|
@ -4839,8 +4839,8 @@
|
|||
"randomize": "Randomize",
|
||||
"clear": "Clear",
|
||||
"makeYourOwnActivity": "Make your own activity",
|
||||
"featuredActivities": "Featured activities",
|
||||
"yourBookmarks": "My bookmarks",
|
||||
"featuredActivities": "Featured",
|
||||
"yourBookmarks": "Bookmarked",
|
||||
"goToChat": "Go to chat",
|
||||
"save": "Save",
|
||||
"selectActivity": "Select activity",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
|
|||
return Scaffold(
|
||||
appBar: ActivityPlannerPageAppBar(
|
||||
pageMode: pageMode,
|
||||
setPageMode: _setPageMode,
|
||||
roomID: widget.roomID,
|
||||
),
|
||||
body: Center(
|
||||
child: ConstrainedBox(
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pangea/activity_planner/activity_planner_page.dart';
|
||||
import 'package:fluffychat/pangea/activity_suggestions/activity_suggestions_constants.dart';
|
||||
import 'package:fluffychat/pangea/common/widgets/customized_svg.dart';
|
||||
|
||||
class ActivityPlannerPageAppBar extends StatelessWidget
|
||||
implements PreferredSizeWidget {
|
||||
final PageMode pageMode;
|
||||
final Function(PageMode) setPageMode;
|
||||
final String roomID;
|
||||
|
||||
const ActivityPlannerPageAppBar({
|
||||
required this.pageMode,
|
||||
required this.setPageMode,
|
||||
required this.roomID,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
|
@ -20,39 +25,89 @@ class ActivityPlannerPageAppBar extends StatelessWidget
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = L10n.of(context);
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
leadingWidth: 150.0,
|
||||
leading: Row(
|
||||
children: [
|
||||
const SizedBox(width: 8.0),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
title: pageMode == PageMode.savedActivities
|
||||
? Center(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.bookmarks),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(l10n.myBookmarkedActivities),
|
||||
),
|
||||
],
|
||||
),
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.bookmarks),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(l10n.myBookmarkedActivities),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Center(
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.event_note_outlined),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(
|
||||
l10n.activityPlannerTitle,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
Container(
|
||||
width: 150.0,
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
customBorder: const CircleBorder(),
|
||||
onTap: () => context.go('/rooms/$roomID/planner/generator'),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(36.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 10.0,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 8.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.event_note_outlined),
|
||||
const SizedBox(width: 8),
|
||||
CustomizedSvg(
|
||||
svgUrl:
|
||||
"${AppConfig.assetsBaseURL}/${ActivitySuggestionsConstants.crayonIconPath}",
|
||||
colorReplacements: {
|
||||
"#CDBEF9": colorToHex(
|
||||
theme.colorScheme.secondary,
|
||||
),
|
||||
},
|
||||
height: 16.0,
|
||||
width: 16.0,
|
||||
),
|
||||
Flexible(
|
||||
child: Text(
|
||||
l10n.activityPlannerTitle,
|
||||
L10n.of(context).createActivity,
|
||||
style: theme.textTheme.titleSmall?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue