Skip to content

Commit

Permalink
Merge pull request #46 from canopas/implement-journey_timeline
Browse files Browse the repository at this point in the history
Implement journey timeline
  • Loading branch information
cp-radhika-s authored Jul 22, 2024
2 parents ae9258d + 5878a98 commit a8ca444
Show file tree
Hide file tree
Showing 17 changed files with 1,399 additions and 33 deletions.
Binary file added app/assets/images/ic_distance_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/images/ic_feed_location-pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ic_feed_location_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions app/assets/images/ic_journey_empty_timeline_image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/assets/images/ic_timeline_filter_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion app/assets/locales/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,18 @@
"choose_place_add_place_btn_text": "Add place",
"choose_place_prompt_added_title_text": "{placeName} Added",
"choose_place_prompt_sub_title_text": "You will be notified when members of your space arrive/leave this place",
"choose_place_prompt_got_it_btn_text": "Got it"
"choose_place_prompt_got_it_btn_text": "Got it",

"@_Timeline": {
},
"journey_timeline_title": "Timeline",
"journey_timeline_title_your_timeline": "Your Timeline",
"journey_timeline_title_other_user": "{userName} Timeline",
"journey_timeline_add_place_btn_text": "Add Place",
"journey_timeline_unknown_address_text": "Unknown address",
"journey_timeline_getting_address_text": "Getting address..",
"journey_timeline_empty_screen_text": "No location history found!",
"journey_timeline_Since_text": "Since {date}",
"journey_timeline_today_text": "Today {date}",
"journey_timeline_date_picker_select_text": "Select"
}
24 changes: 24 additions & 0 deletions app/lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions app/lib/ui/app_route.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'dart:async';

import 'package:data/api/auth/auth_models.dart';
import 'package:data/api/message/message_models.dart';
import 'package:data/api/space/space_models.dart';
import 'package:flutter/cupertino.dart';
import 'package:go_router/go_router.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:yourspace_flutter/ui/flow/auth/sign_in/phone/verification/phone_verification_screen.dart';
import 'package:yourspace_flutter/ui/flow/journey/timeline/journey_timeline_screen.dart';
import 'package:yourspace_flutter/ui/flow/geofence/add/locate/locate_on_map_screen.dart';
import 'package:yourspace_flutter/ui/flow/geofence/add/placename/choose_place_name_screen.dart';
import 'package:yourspace_flutter/ui/flow/geofence/places/places_list_screen.dart';
Expand Down Expand Up @@ -43,6 +45,7 @@ class AppRoute {
static const pathAddNewPlace = '/add-new-place';
static const pathLocateOnMap = "/locate_on_map";
static const pathChoosePlace = "/choose_place";
static const pathJourneyTimeline = '/journey-timeline';

final String path;
final String? name;
Expand Down Expand Up @@ -201,16 +204,28 @@ class AppRoute {
);
}

static AppRoute journeyTimeline(ApiUser user) {
return AppRoute(pathJourneyTimeline,
builder: (_) => JourneyTimelineScreen(selectedUser: user));
}

static AppRoute message(SpaceInfo space) {
return AppRoute(
pathMessage,
builder: (_) => ThreadListScreen(spaceInfo: space),
);
}
static AppRoute chat({required SpaceInfo spaceInfo, ThreadInfo? thread, List<ThreadInfo>? threadInfoList}) {

static AppRoute chat(
{required SpaceInfo spaceInfo,
ThreadInfo? thread,
List<ThreadInfo>? threadInfoList}) {
return AppRoute(
pathMessage,
builder: (_) => ChatScreen(spaceInfo: spaceInfo, threadInfo: thread, threadInfoList: threadInfoList),
builder: (_) => ChatScreen(
spaceInfo: spaceInfo,
threadInfo: thread,
threadInfoList: threadInfoList),
);
}

Expand Down Expand Up @@ -307,6 +322,10 @@ class AppRoute {
GoRoute(
path: pathChoosePlace,
builder: (context, state) => state.widget(context),
),
GoRoute(
path: pathJourneyTimeline,
builder: (context, state) => state.widget(context),
)
];
}
Expand Down
22 changes: 22 additions & 0 deletions app/lib/ui/components/dashed_divider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class DashedLineVerticalPainter extends CustomPainter {
final Color color;
DashedLineVerticalPainter({required this.color});

@override
void paint(Canvas canvas, Size size) {
double dashHeight = 5, dashSpace = 3, startY = 0;
final paint = Paint()
..color = color
..strokeWidth = size.width;
while (startY < size.height) {
canvas.drawLine(Offset(0, startY), Offset(0, startY + dashHeight), paint);
startY += dashHeight + dashSpace;
}
}

@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:style/extenstions/context_extenstions.dart';
import 'package:style/text/app_text_dart.dart';
import 'package:yourspace_flutter/domain/extenstions/lat_lng_extenstion.dart';
import 'package:yourspace_flutter/domain/extenstions/time_ago_extenstions.dart';
import 'package:yourspace_flutter/ui/app_route.dart';

import '../../../../../gen/assets.gen.dart';
import '../../../../components/user_battery_status.dart';
Expand All @@ -16,13 +17,11 @@ import '../../../../components/user_profile_image.dart';
class SelectedMemberDetailView extends StatefulWidget {
final ApiUserInfo? userInfo;
final void Function() onDismiss;
final void Function() onTapTimeline;

const SelectedMemberDetailView({
super.key,
required this.userInfo,
required this.onDismiss,
required this.onTapTimeline,
});

@override
Expand Down Expand Up @@ -139,20 +138,19 @@ class _SelectedMemberDetailViewState extends State<SelectedMemberDetailView> {

Widget _timeLineButtonView() {
return OnTapScale(
onTap: () {},
onTap: () {
AppRoute.journeyTimeline(widget.userInfo!.user).push(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: context.colorScheme.containerLow),
padding: const EdgeInsets.all(8),
child: OnTapScale(
onTap: () => widget.onTapTimeline(),
child: SvgPicture.asset(
Assets.images.icTimeLineHistoryIcon,
colorFilter: ColorFilter.mode(
context.colorScheme.textPrimary,
BlendMode.srcATop,
),
child: SvgPicture.asset(
Assets.images.icTimeLineHistoryIcon,
colorFilter: ColorFilter.mode(
context.colorScheme.textPrimary,
BlendMode.srcATop,
),
),
),
Expand Down
3 changes: 0 additions & 3 deletions app/lib/ui/flow/home/map/components/space_user_footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class SpaceUserFooter extends StatefulWidget {
final void Function() onRelocateTap;
final void Function() onPlacesTap;
final void Function() onDismiss;
final void Function() onTapTimeline;

const SpaceUserFooter({
super.key,
Expand All @@ -35,7 +34,6 @@ class SpaceUserFooter extends StatefulWidget {
required this.onRelocateTap,
required this.onPlacesTap,
required this.onDismiss,
required this.onTapTimeline,
});

@override
Expand Down Expand Up @@ -66,7 +64,6 @@ class _SpaceUserFooterState extends State<SpaceUserFooter> {
key: const ValueKey('detailView'),
userInfo: widget.selectedUser,
onDismiss: widget.onDismiss,
onTapTimeline: widget.onTapTimeline,
)
: const SizedBox.shrink(
key: ValueKey('emptyBox'),
Expand Down
1 change: 0 additions & 1 deletion app/lib/ui/flow/home/map/map_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class _MapScreenState extends ConsumerState<MapScreen> {
}
},
onDismiss: () => notifier.onDismissMemberDetail(),
onTapTimeline: () {},
),
Visibility(visible: enabled, child: _permissionFooter(state))
],
Expand Down
Loading

0 comments on commit a8ca444

Please sign in to comment.