Skip to content

Commit

Permalink
fix: code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanRns committed May 31, 2024
1 parent 22b6da9 commit 9886137
Show file tree
Hide file tree
Showing 11 changed files with 179 additions and 194 deletions.
Binary file added evently/assets/images/text_field_bottom_left.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 added evently/assets/images/text_field_top_right.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: 2 additions & 1 deletion evently/lib/evently_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class EventlyProvider extends ChangeNotifier {

set setPerks(PerksModel perksModel) {
_perks.add(perksModel);
setSelectedPerks = _perks.length - 1;
notifyListeners();
}

Expand All @@ -146,6 +147,7 @@ class EventlyProvider extends ChangeNotifier {

removePerks(int index) {
_perks.removeAt(index);
setSelectedPerks = _perks.length - 1;
notifyListeners();
}

Expand Down Expand Up @@ -292,7 +294,6 @@ class EventlyProvider extends ChangeNotifier {

final String prices = isFreeDrop == FreeDrop.yes ? "0" : _selectedDenom.formatAmount(price: price.toString());


final recipe = event.createRecipe(
cookbookId: _cookbookId!,
recipeId: _recipeId,
Expand Down
6 changes: 5 additions & 1 deletion evently/lib/screens/custom_widgets/bottom_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ class BottomButtons extends StatelessWidget {
const VerticalSpace(10),
Center(
child: InkWell(
onTap: onPressSaveDraft,
onTap: () {
if (isContinueEnable) {
onPressSaveDraft();
}
},
child: Text(
LocaleKeys.save_draft.tr(),
style: TextStyle(color: EventlyAppTheme.kTextGrey02, fontSize: 14.sp, fontWeight: FontWeight.w700),
Expand Down
52 changes: 29 additions & 23 deletions evently/lib/screens/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import 'package:evently/screens/custom_widgets/bottom_buttons.dart';
import 'package:evently/screens/custom_widgets/page_app_bar.dart';
import 'package:evently/screens/custom_widgets/step_labels.dart';
import 'package:evently/screens/custom_widgets/steps_indicator.dart';
import 'package:evently/utils/constants.dart';
import 'package:evently/utils/enums.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/viewmodels/create_event_viewmodel.dart';
Expand Down Expand Up @@ -60,11 +62,12 @@ class _DetailsScreenState extends State<DetailsScreen> {
});
},
child: EventlyTextField(
enable: false,
label: LocaleKeys.start_date.tr(),
controller: TextEditingController(text: provider.startDate),
textCapitalization: TextCapitalization.sentences,
),
enable: false,
label: LocaleKeys.start_date.tr(),
controller: TextEditingController(text: provider.startDate),
textCapitalization: TextCapitalization.sentences,
imageBackground: PngUtils.textFieldBottomLeft,
inputTextColor: EventlyAppTheme.kTextDarkBlue),
),
),
HorizontalSpace(20.w),
Expand All @@ -77,14 +80,15 @@ class _DetailsScreenState extends State<DetailsScreen> {
});
},
child: EventlyTextField(
enable: false,
label: LocaleKeys.end_date.tr(),
controller: TextEditingController(text: provider.endDate),
textCapitalization: TextCapitalization.sentences,
validator: (value) {
return null;
},
),
enable: false,
label: LocaleKeys.end_date.tr(),
controller: TextEditingController(text: provider.endDate),
textCapitalization: TextCapitalization.sentences,
validator: (value) {
return null;
},
imageBackground: PngUtils.textFieldTopRight,
inputTextColor: EventlyAppTheme.kTextDarkBlue),
),
),
],
Expand All @@ -103,14 +107,15 @@ class _DetailsScreenState extends State<DetailsScreen> {
});
},
child: EventlyTextField(
enable: false,
label: LocaleKeys.start_time.tr(),
controller: TextEditingController(text: provider.startTime),
textCapitalization: TextCapitalization.sentences,
validator: (value) {
return null;
},
),
enable: false,
label: LocaleKeys.start_time.tr(),
controller: TextEditingController(text: provider.startTime),
textCapitalization: TextCapitalization.sentences,
validator: (value) {
return null;
},
imageBackground: PngUtils.textFieldBottomLeft,
inputTextColor: EventlyAppTheme.kTextDarkBlue),
),
),
HorizontalSpace(20.w),
Expand All @@ -132,6 +137,8 @@ class _DetailsScreenState extends State<DetailsScreen> {
validator: (value) {
return null;
},
imageBackground: PngUtils.textFieldTopRight,
inputTextColor: EventlyAppTheme.kTextDarkBlue,
),
),
),
Expand Down Expand Up @@ -163,10 +170,9 @@ class _DetailsScreenState extends State<DetailsScreen> {
textCapitalization: TextCapitalization.sentences,
noOfLines: 4,
),
const VerticalSpace(80),
const VerticalSpace(40),
BottomButtons(
onPressContinue: () {

createEventViewModel.nextPage();
},
onPressSaveDraft: () {
Expand Down
Loading

0 comments on commit 9886137

Please sign in to comment.