Skip to content

Commit

Permalink
fix: ui code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanRns committed May 9, 2024
1 parent d599255 commit bfeaab9
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 305 deletions.
Binary file modified evently/assets/images/text_field_multi_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified evently/assets/images/text_field_single_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions evently/lib/screens/buyer_status_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class _BuyerResponseScreenState extends State<BuyerResponseScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: EventlyAppTheme.kLightGreen,
backgroundColor: EventlyAppTheme.kGreen,
body: SizedBox(
width: double.infinity,
child: Column(
Expand All @@ -36,7 +36,7 @@ class _BuyerResponseScreenState extends State<BuyerResponseScreen> {
child: const Icon(
Icons.check,
size: 161,
color: EventlyAppTheme.kLightGreen,
color: EventlyAppTheme.kGreen,
),
)
],
Expand Down
2 changes: 1 addition & 1 deletion evently/lib/screens/custom_widgets/step_labels.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StepLabels extends StatelessWidget {
fontSize: 8.sp,
fontFamily: 'Inter',
fontWeight: FontWeight.w700,
color: currentStep.value >= index ? EventlyAppTheme.kBlue : EventlyAppTheme.kGrey,
color: currentStep.value >= index ? EventlyAppTheme.kBlue : EventlyAppTheme.kGery03,
),
),
],
Expand Down
8 changes: 4 additions & 4 deletions evently/lib/screens/custom_widgets/steps_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ class MyStepsIndicator extends StatelessWidget {
nbSteps: 4,
lineLength: 0.68.sw / 4,
doneLineColor: EventlyAppTheme.kBlue,
undoneLineColor: EventlyAppTheme.kLightGrey,
undoneLineColor: EventlyAppTheme.kGery03,
doneLineThickness: 1.5,
undoneLineThickness: 1.5,
unselectedStepColorIn: EventlyAppTheme.kLightGrey,
unselectedStepColorOut: EventlyAppTheme.kLightGrey,
unselectedStepColorIn: EventlyAppTheme.kGery03,
unselectedStepColorOut: EventlyAppTheme.kGery03,
doneStepColor: EventlyAppTheme.kBlue,
selectedStepColorIn: EventlyAppTheme.kBlue,
selectedStepColorOut: EventlyAppTheme.kBlue,
enableLineAnimation: true,
enableStepAnimation: true,
lineLengthCustomStep: const [],
doneStepWidget: Container(width: 10.w, height: 10.h, decoration: const BoxDecoration(color: EventlyAppTheme.kBlue)),
unselectedStepWidget: Container(width: 10.w, height: 10.h, decoration: const BoxDecoration(color: EventlyAppTheme.kLightGrey)),
unselectedStepWidget: Container(width: 10.w, height: 10.h, decoration: const BoxDecoration(color: EventlyAppTheme.kGery03)),
selectedStepWidget: Container(width: 15.w, height: 15.h, decoration: const BoxDecoration(color: EventlyAppTheme.kBlue)),
);
});
Expand Down
68 changes: 6 additions & 62 deletions evently/lib/screens/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import 'package:evently/evently_provider.dart';
import 'package:evently/generated/locale_keys.g.dart';
import 'package:evently/screens/custom_widgets/step_labels.dart';
import 'package:evently/screens/custom_widgets/steps_indicator.dart';
import 'package:evently/utils/evently_app_theme.dart';
import 'package:evently/screens/price_screen.dart';
import 'package:evently/utils/space_utils.dart';
import 'package:evently/viewmodels/create_event_viewmodel.dart';
import 'package:evently/widgets/clipped_button.dart';
import 'package:evently/widgets/evently_text_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
Expand Down Expand Up @@ -39,45 +38,9 @@ class _DetailsScreenState extends State<DetailsScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const VerticalSpace(20),
MyStepsIndicator(currentStep: createEventViewModel.currentStep),
const VerticalSpace(5),
StepLabels(currentPage: createEventViewModel.currentPage, currentStep: createEventViewModel.currentStep),
const VerticalSpace(10),
const VerticalSpace(20),
Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.centerLeft,
child: ValueListenableBuilder(
valueListenable: createEventViewModel.currentPage,
builder: (_, int currentPage, __) => Padding(
padding: EdgeInsets.only(left: 10.sp),
child: IconButton(
onPressed: () {
FocusScope.of(context).unfocus();
ScaffoldMessenger.of(context).hideCurrentSnackBar();
Navigator.pop(context);
},
icon: const Icon(
Icons.arrow_back_ios,
color: EventlyAppTheme.kGrey,
),
)),
)),
ValueListenableBuilder(
valueListenable: createEventViewModel.currentPage,
builder: (_, int currentPage, __) {
return Text(
createEventViewModel.pageTitles[createEventViewModel.currentPage.value],
style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontSize: 18.sp, fontWeight: FontWeight.w700, color: EventlyAppTheme.kDarkText),
);
},
),
],
),
const VerticalSpace(20),
PageAppBar(onPressBack: () {}),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 15.h),
child: Column(
Expand Down Expand Up @@ -159,30 +122,11 @@ class _DetailsScreenState extends State<DetailsScreen> {
},
noOfLines: 4,
),
VerticalSpace(20.h),
ClippedButton(
title: LocaleKeys.continue_key.tr(),
bgColor: EventlyAppTheme.kBlue,
textColor: EventlyAppTheme.kWhite,
onPressed: () {
createEventViewModel.nextPage();
},
cuttingHeight: 15.h,
clipperType: ClipperType.bottomLeftTopRight,
isShadow: false,
fontWeight: FontWeight.w700,
),
VerticalSpace(10.h),
Center(
child: InkWell(
onTap: () {},
child: Text(
LocaleKeys.save_draft.tr(),
style: TextStyle(color: EventlyAppTheme.kLightGreyText, fontSize: 14.sp, fontWeight: FontWeight.w700),
),
),
BottomButtons(
onPressContinue: () {},
onPressSaveDraft: () {},
isContinueEnable: false,
),
VerticalSpace(5.h),
],
),
),
Expand Down
17 changes: 7 additions & 10 deletions evently/lib/screens/event_hub/event_hub_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class EventHubScreen extends StatefulWidget {

class _EventHubScreenState extends State<EventHubScreen> {
TextStyle headingStyle = TextStyle(
fontSize: isTablet ? 20.sp : 20.sp,
fontWeight: FontWeight.w800,
color: EventlyAppTheme.kLightPurple,
fontSize: isTablet ? 20.sp : 25,
fontWeight: FontWeight.bold,
color: EventlyAppTheme.kTextLightPurple,
fontFamily: kUniversalFontFamily,
);
TextStyle titleStyle = TextStyle(
fontSize: isTablet ? 14.sp : 14.sp,
fontWeight: FontWeight.w700,
fontSize: isTablet ? 14.sp : 15,
fontWeight: FontWeight.bold,
color: EventlyAppTheme.kWhite,
fontFamily: kUniversalFontFamily,
);
Expand All @@ -38,7 +38,7 @@ class _EventHubScreenState extends State<EventHubScreen> {
TextStyle subTitleStyle = TextStyle(
fontSize: isTablet ? 12.sp : 12.sp,
fontWeight: FontWeight.w700,
color: EventlyAppTheme.kLightText,
color: EventlyAppTheme.kGrey01,
fontFamily: kUniversalFontFamily,
);

Expand All @@ -64,10 +64,7 @@ class _EventHubScreenState extends State<EventHubScreen> {
InkWell(
onTap: () => Navigator.of(context).pushNamed(RouteUtil.kCreateEvent),
child: DecoratedBox(
decoration: BoxDecoration(
color: EventlyAppTheme.kpurpleDark,
boxShadow: [BoxShadow(color: EventlyAppTheme.kpurpleDark.withOpacity(0.6), blurRadius: 8.0)],
),
decoration: const BoxDecoration(color: EventlyAppTheme.kTextLightBlue),
child: Icon(Icons.add, size: 27.h, color: EventlyAppTheme.kWhite),
),
),
Expand Down
39 changes: 6 additions & 33 deletions evently/lib/screens/host_view_ticket_preview.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:evently/generated/locale_keys.g.dart';
import 'package:evently/screens/price_screen.dart';
import 'package:evently/utils/constants.dart';
import 'package:evently/utils/evently_app_theme.dart';
import 'package:evently/utils/route_util.dart';
import 'package:evently/utils/space_utils.dart';
import 'package:evently/widgets/clipped_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand All @@ -26,34 +23,10 @@ class _HostTicketPreviewState extends State<HostTicketPreview> {
bottomNavigationBar: Container(
padding: EdgeInsets.symmetric(horizontal: 30.w),
height: 110.h,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ClippedButton(
title: LocaleKeys.publish.tr(),
bgColor: EventlyAppTheme.kBlue,
textColor: EventlyAppTheme.kWhite,
onPressed: () {
Navigator.of(context).pushReplacementNamed(RouteUtil.kRouteEventHub);
},
cuttingHeight: 15.h,
clipperType: ClipperType.bottomLeftTopRight,
isShadow: false,
fontWeight: FontWeight.w700,
),
VerticalSpace(10.h),
Center(
child: InkWell(
onTap: () {},
child: Text(
LocaleKeys.save_draft.tr(),
style: TextStyle(color: EventlyAppTheme.kLightGreyText, fontSize: 14.sp, fontWeight: FontWeight.w700),
),
),
),
VerticalSpace(5.h),
],
child: BottomButtons(
onPressContinue: () {},
onPressSaveDraft: () {},
isContinueEnable: false,
),
),
body: SingleChildScrollView(
Expand Down Expand Up @@ -212,7 +185,7 @@ class _HostTicketPreviewState extends State<HostTicketPreview> {
SizedBox(width: 5.w),
Text(
'Redeem',
style: TextStyle(fontSize: 15.sp, color: EventlyAppTheme.kDarkGreen, fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 15.sp, color: EventlyAppTheme.kGreenText, fontWeight: FontWeight.bold),
)
],
)
Expand Down
72 changes: 10 additions & 62 deletions evently/lib/screens/overview_screen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import 'dart:io';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:evently/evently_provider.dart';
import 'package:evently/generated/locale_keys.g.dart';
import 'package:evently/screens/custom_widgets/step_labels.dart';
import 'package:evently/screens/custom_widgets/steps_indicator.dart';
import 'package:evently/screens/price_screen.dart';
import 'package:evently/utils/constants.dart';
import 'package:evently/utils/evently_app_theme.dart';
import 'package:evently/utils/space_utils.dart';
import 'package:evently/viewmodels/create_event_viewmodel.dart';
import 'package:evently/widgets/clipped_button.dart';
import 'package:evently/widgets/evently_text_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
Expand Down Expand Up @@ -45,39 +44,7 @@ class _OverViewScreenState extends State<OverViewScreen> {
children: [
MyStepsIndicator(currentStep: createEventViewModel.currentStep),
StepLabels(currentPage: createEventViewModel.currentPage, currentStep: createEventViewModel.currentStep),
Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.centerLeft,
child: ValueListenableBuilder(
valueListenable: createEventViewModel.currentPage,
builder: (_, int currentPage, __) => Padding(
padding: EdgeInsets.only(left: 10.sp),
child: IconButton(
onPressed: () {
FocusScope.of(context).unfocus();
ScaffoldMessenger.of(context).hideCurrentSnackBar();
Navigator.pop(context);
},
icon: const Icon(
Icons.arrow_back_ios,
color: EventlyAppTheme.kGrey,
),
)),
),
),
ValueListenableBuilder(
valueListenable: createEventViewModel.currentPage,
builder: (_, int currentPage, __) {
return Text(
createEventViewModel.pageTitles[createEventViewModel.currentPage.value],
style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontSize: 18.sp, fontWeight: FontWeight.w700, color: EventlyAppTheme.kDarkText),
);
},
),
],
),
PageAppBar(onPressBack: () {}),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 15.h),
child: Column(
Expand Down Expand Up @@ -109,7 +76,7 @@ class _OverViewScreenState extends State<OverViewScreen> {
child: DottedBorder(
borderType: BorderType.Rect,
dashPattern: const [10, 6],
color: EventlyAppTheme.kLightPurple,
color: EventlyAppTheme.kTextDarkPurple,
strokeWidth: 3.h,
child: provider.thumbnail != null
? Stack(
Expand All @@ -128,14 +95,14 @@ class _OverViewScreenState extends State<OverViewScreen> {
children: [
Text(
LocaleKeys.tap_select.tr(),
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold, color: EventlyAppTheme.kLightPurple),
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold, color: EventlyAppTheme.kTextDarkPurple),
),
VerticalSpace(10.h),
SvgPicture.asset(SVGUtils.kSvgUpload),
VerticalSpace(10.h),
Text(
LocaleKeys.mb_limit.tr(),
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold, color: EventlyAppTheme.kLightPurple),
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold, color: EventlyAppTheme.kTextDarkPurple),
),
],
),
Expand All @@ -144,30 +111,11 @@ class _OverViewScreenState extends State<OverViewScreen> {
),
),
),
VerticalSpace(20.h),
ClippedButton(
title: LocaleKeys.continue_key.tr(),
bgColor: EventlyAppTheme.kBlue,
textColor: EventlyAppTheme.kWhite,
onPressed: () {
createEventViewModel.nextPage();
},
cuttingHeight: 15.h,
clipperType: ClipperType.bottomLeftTopRight,
isShadow: false,
fontWeight: FontWeight.w700,
),
VerticalSpace(10.h),
Center(
child: InkWell(
onTap: () {},
child: Text(
LocaleKeys.save_draft.tr(),
style: TextStyle(color: EventlyAppTheme.kLightGreyText, fontSize: 14.sp, fontWeight: FontWeight.w700),
),
),
),
VerticalSpace(5.h),
BottomButtons(
onPressContinue: () {},
onPressSaveDraft: () {},
isContinueEnable: false,
)
],
),
),
Expand Down
Loading

0 comments on commit bfeaab9

Please sign in to comment.