Skip to content

Commit

Permalink
Frontend: Implement WIP widget and update asset folder names
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghshubham777 committed Sep 23, 2024
1 parent cf0e0da commit 5329b37
Show file tree
Hide file tree
Showing 56 changed files with 136 additions and 80 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Binary file added frontend/assets/image/in_progress.webp
Binary file not shown.
File renamed without changes
2 changes: 1 addition & 1 deletion frontend/lib/common/view/custom_package_advertisement.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CustomPackageAdvertisement extends StatelessWidget {
alignment: Alignment.topRight,
child: Transform.translate(
offset: const Offset(0, -16),
child: SvgPicture.asset(Assets.iconsDecoration),
child: SvgPicture.asset(Assets.iconDecoration),
),
),
],
Expand Down
6 changes: 3 additions & 3 deletions frontend/lib/common/view/dta_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DTAAppBar extends StatelessWidget {
right: 4,
bottom: 3,
),
child: SvgPicture.asset(Assets.iconsBxMenu),
child: SvgPicture.asset(Assets.iconBxMenu),
),
),
),
Expand All @@ -83,15 +83,15 @@ class DTAAppBar extends StatelessWidget {
ZoomTapDetector(
onTap: () {},
child: SvgPicture.asset(
Assets.iconsBiBell,
Assets.iconBiBell,
width: 24,
),
),
const SizedBox(width: 20),
ZoomTapDetector(
onTap: () {},
child: SvgPicture.asset(
Assets.iconsOcticonPerson,
Assets.iconOcticonPerson,
width: 24,
),
),
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/common/view/dta_horizontal_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DTAHorizontalList extends StatelessWidget {
color: appColors.primaryLight,
child: Center(
child: DtaIcon(
Assets.iconsWarning,
Assets.iconWarning,
color: appColors.accent.withOpacity(0.8),
width: 32,
),
Expand Down
38 changes: 38 additions & 0 deletions frontend/lib/common/view/in_progress_animation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:frontend/common/view/app_colors.dart';
import 'package:frontend/constants/assets.dart';
import 'package:frontend/features/main/view/main_screen.dart';
import 'package:frontend/utils/constants.dart';

class InProgressAnimation extends StatelessWidget {
const InProgressAnimation({super.key});

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
Container(
constraints: const BoxConstraints(maxWidth: 500, maxHeight: 500),
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Image.asset(Assets.imageInProgress),
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'🚧\nThis feature is a work-in-progress',
style: TextStyle(
color: appColors.secondaryDark,
fontFamily: Constants.fontDMSerifDisplay,
fontSize: 24,
),
textAlign: TextAlign.center,
),
),
SizedBox(height: MainScreen.bottomNavBarHeight(context)),
],
),
);
}
}
2 changes: 1 addition & 1 deletion frontend/lib/common/view/section_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SectionHeader extends StatelessWidget {
this.actionText = 'View All',
this.onActionTap,
this.dense = false,
this.actionAsset = Assets.iconsArrowForward,
this.actionAsset = Assets.iconArrowForward,
this.titleAlternateFont = false,
});

Expand Down
48 changes: 25 additions & 23 deletions frontend/lib/constants/assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,52 @@
class Assets {
Assets._();

static const String iconsArrowDown = "assets/icons/arrow_down.svg";
static const String iconArrowDown = "assets/icon/arrow_down.svg";

static const String iconsArrowForward = "assets/icons/arrow_forward.svg";
static const String iconArrowForward = "assets/icon/arrow_forward.svg";

static const String iconsBiBell = "assets/icons/bi_bell.svg";
static const String iconBiBell = "assets/icon/bi_bell.svg";

static const String iconsBottomNavCollab = "assets/icons/bottom_nav_collab.svg";
static const String iconBottomNavCollab = "assets/icon/bottom_nav_collab.svg";

static const String iconsBottomNavDash = "assets/icons/bottom_nav_dash.svg";
static const String iconBottomNavDash = "assets/icon/bottom_nav_dash.svg";

static const String iconsBottomNavHome = "assets/icons/bottom_nav_home.svg";
static const String iconBottomNavHome = "assets/icon/bottom_nav_home.svg";

static const String iconsBottomNavInspire = "assets/icons/bottom_nav_inspire.svg";
static const String iconBottomNavInspire = "assets/icon/bottom_nav_inspire.svg";

static const String iconsBottomNavVendors = "assets/icons/bottom_nav_vendors.svg";
static const String iconBottomNavVendors = "assets/icon/bottom_nav_vendors.svg";

static const String iconsBxMenu = "assets/icons/bx_menu.svg";
static const String iconBxMenu = "assets/icon/bx_menu.svg";

static const String iconsCalendar = "assets/icons/calendar.svg";
static const String iconCalendar = "assets/icon/calendar.svg";

static const String iconsChatBubble = "assets/icons/chat_bubble.svg";
static const String iconChatBubble = "assets/icon/chat_bubble.svg";

static const String iconsCheck = "assets/icons/check.svg";
static const String iconCheck = "assets/icon/check.svg";

static const String iconsDecoration = "assets/icons/decoration.svg";
static const String iconDecoration = "assets/icon/decoration.svg";

static const String iconsMoney = "assets/icons/money.svg";
static const String iconMoney = "assets/icon/money.svg";

static const String iconsOcticonPerson = "assets/icons/octicon_person.svg";
static const String iconOcticonPerson = "assets/icon/octicon_person.svg";

static const String iconsStar = "assets/icons/star.svg";
static const String iconStar = "assets/icon/star.svg";

static const String iconsWarning = "assets/icons/warning.svg";
static const String iconWarning = "assets/icon/warning.svg";

static const String imagesAuthBg = "assets/images/auth_bg.webp";
static const String imageAuthBg = "assets/image/auth_bg.webp";

static const String imagesAuthBgBorder = "assets/images/auth_bg_border.webp";
static const String imageAuthBgBorder = "assets/image/auth_bg_border.webp";

static const String imagesAvatarWoman = "assets/images/avatar_woman.webp";
static const String imageAvatarWoman = "assets/image/avatar_woman.webp";

static const String imagesFloralBg = "assets/images/floral_bg.png";
static const String imageFloralBg = "assets/image/floral_bg.png";

static const String imagesFlowers = "assets/images/flowers.webp";
static const String imageFlowers = "assets/image/flowers.webp";

static const String imagesLocationAgra = "assets/images/location_agra.svg";
static const String imageInProgress = "assets/image/in_progress.webp";

static const String imageLocationAgra = "assets/image/location_agra.svg";
}

6 changes: 3 additions & 3 deletions frontend/lib/features/auth/view/authentication_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AuthenticationScreen extends StatelessWidget {

// Pink background image
SizedBox.expand(
child: Image.asset(Assets.imagesAuthBg, fit: BoxFit.fitHeight),
child: Image.asset(Assets.imageAuthBg, fit: BoxFit.fitHeight),
),

// Golden border
Expand All @@ -34,7 +34,7 @@ class AuthenticationScreen extends StatelessWidget {
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(Assets.imagesAuthBgBorder),
image: AssetImage(Assets.imageAuthBgBorder),
fit: BoxFit.cover,
),
),
Expand Down Expand Up @@ -122,7 +122,7 @@ class AuthenticationScreen extends StatelessWidget {
width: 600,
height: 310,
child: Image.asset(
Assets.imagesFlowers,
Assets.imageFlowers,
fit: BoxFit.cover,
),
),
Expand Down
7 changes: 2 additions & 5 deletions frontend/lib/features/collab/view/collab_screen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/common/view/in_progress_animation.dart';

class CollabScreen extends ConsumerWidget {
const CollabScreen({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
return const Scaffold(
body: Center(
child: Text('Collab'),
),
);
return const Scaffold(body: Center(child: InProgressAnimation()));
}
}
4 changes: 2 additions & 2 deletions frontend/lib/features/dashboard/view/due_tasks_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class _DueTaskListItem extends StatelessWidget {
2,
(index) => DtaIcon(
switch (index) {
0 => Assets.iconsChatBubble,
_ => Assets.iconsBiBell,
0 => Assets.iconChatBubble,
_ => Assets.iconBiBell,
},
color: appColors.secondaryDark.withOpacity(0.6),
width: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _WeekCalendarRowState extends State<WeekCalendarRow> {
),
const SizedBox(width: 8),
DtaIcon(
Assets.iconsArrowForward,
Assets.iconArrowForward,
color: appColors.accent,
width: 8,
),
Expand Down
14 changes: 14 additions & 0 deletions frontend/lib/features/home/provider/home_screen_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:core/models/auth/dta_user.dart';
import 'package:frontend/features/auth/provider/auth_providers.dart';
import 'package:frontend/utils/extensions.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'home_screen_provider.g.dart';

@riverpod
FutureOr<DTAUser> userProfile(UserProfileRef ref) async {
final authService = ref.watch(authServiceProvider);
final response = await authService.getUserProfile();
if (response.hasError) throw Exception(response.errorMessage);
return response.data;
}
6 changes: 3 additions & 3 deletions frontend/lib/features/home/view/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class HomeScreen extends ConsumerWidget {
key: Key(index.toString()),
dateTime: DateTime.now(),
iconAsset: switch (index) {
0 => Assets.iconsCalendar,
1 => Assets.iconsMoney,
_ => Assets.iconsBiBell,
0 => Assets.iconCalendar,
1 => Assets.iconMoney,
_ => Assets.iconBiBell,
},
title: switch (index) {
0 => 'Wedding',
Expand Down
18 changes: 13 additions & 5 deletions frontend/lib/features/home/view/setup_profile_section.dart
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import 'package:awesome_extensions/awesome_extensions.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/common/view/app_colors.dart';
import 'package:frontend/common/view/dta_app_bar.dart';
import 'package:frontend/common/view/dta_button.dart';
import 'package:frontend/common/view/half_onion_dome_container.dart';
import 'package:frontend/constants/assets.dart';
import 'package:frontend/features/home/provider/home_screen_provider.dart';
import 'package:frontend/utils/constants.dart';

class SetupProfileSection extends StatelessWidget {
class SetupProfileSection extends ConsumerWidget {
const SetupProfileSection({super.key});

@override
Widget build(BuildContext context) {
Widget build(BuildContext context, WidgetRef ref) {
final userProfileState = ref.watch(userProfileProvider);

return HalfOnionDomeContainer(
width: context.width,
height: 350,
child: Stack(
children: [
Image.asset(
Assets.imagesFloralBg,
Assets.imageFloralBg,
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
Expand All @@ -40,7 +44,11 @@ class SetupProfileSection extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Hello, Divya!',
userProfileState.maybeWhen(
data: (user) => 'Hello, ${user.firstName}!',
loading: () => 'Loading...',
orElse: () => '',
),
style: context.displaySmall?.copyWith(
fontFamily: Constants.fontComforter,
),
Expand Down Expand Up @@ -75,7 +83,7 @@ class SetupProfileSection extends StatelessWidget {
bottom: 20,
right: -4,
height: 233,
child: Image.asset(Assets.imagesAvatarWoman),
child: Image.asset(Assets.imageAvatarWoman),
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/features/home/view/status_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class StatusLabel extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
DtaIcon(
isCompleted ? Assets.iconsCheck : Assets.iconsWarning,
isCompleted ? Assets.iconCheck : Assets.iconWarning,
color: contentColor,
),
const SizedBox(width: 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TaskQuickDetailsCard extends StatelessWidget {
),
),
DtaIcon(
Assets.iconsCalendar,
Assets.iconCalendar,
color: appColors.secondaryDark,
),
],
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/features/home/view/upcoming_task_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class UpcomingTaskCard extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const DtaIcon(Assets.iconsChatBubble),
const DtaIcon(Assets.iconChatBubble),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8,
Expand All @@ -126,7 +126,7 @@ class UpcomingTaskCard extends StatelessWidget {
),
),
const SizedBox(width: 4),
const DtaIcon(Assets.iconsBiBell),
const DtaIcon(Assets.iconBiBell),
],
),
),
Expand Down
7 changes: 2 additions & 5 deletions frontend/lib/features/inspire/view/inspire_screen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/common/view/in_progress_animation.dart';

class InspireScreen extends ConsumerWidget {
const InspireScreen({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
return const Scaffold(
body: Center(
child: Text('Inspire'),
),
);
return const Scaffold(body: Center(child: InProgressAnimation()));
}
}
Loading

0 comments on commit 5329b37

Please sign in to comment.