Skip to content

Commit

Permalink
feat: data collecllection from over view screen
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanRns committed May 9, 2024
1 parent eea4ff2 commit b6743ce
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
18 changes: 17 additions & 1 deletion evently/lib/evently_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:io';
import 'package:evently/models/denom.dart';
import 'package:evently/models/picked_file_model.dart';
import 'package:evently/repository/repository.dart';
import 'package:evently/utils/constants.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
Expand All @@ -21,25 +22,40 @@ class EventlyProvider extends ChangeNotifier {
String _eventName = '';
String _hostName = '';
File? _thumbnail;
bool _isOverviewEnable = false;

File? get thumbnail => _thumbnail;
String get eventName => _eventName;
String get hostName => _hostName;
bool get isOverviewEnable => _isOverviewEnable;

set setEventName(String value) {
_eventName = value;
checkIsOverEnable();
notifyListeners();
}

set setHostName(String value) {
_hostName = value;
checkIsOverEnable();
notifyListeners();
}

set setThumbnail(File? file) {
_thumbnail = file;
checkIsOverEnable();
notifyListeners();
}

set setOverviewEnable(bool value) {
_isOverviewEnable = value;
notifyListeners();
}

checkIsOverEnable() {
setOverviewEnable = thumbnail != null && eventName.length >= kMinEventName && hostName.length >= kMinHostName;
}

///* detail screen
String _startDate = "";
String _endDate = "";
Expand Down Expand Up @@ -75,7 +91,7 @@ class EventlyProvider extends ChangeNotifier {
notifyListeners();
}

set setLocation (String value) {
set setLocation(String value) {
_location = value;
notifyListeners();
}
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 @@ -26,7 +26,11 @@ class BottomButtons extends StatelessWidget {
title: LocaleKeys.continue_key.tr(),
bgColor: isContinueEnable ? EventlyAppTheme.kBlue : EventlyAppTheme.kGery03,
textColor: EventlyAppTheme.kWhite,
onPressed: onPressContinue,
onPressed: () {
if (isContinueEnable) {
onPressContinue();
}
},
cuttingHeight: 15.h,
clipperType: ClipperType.bottomLeftTopRight,
isShadow: false,
Expand Down
13 changes: 10 additions & 3 deletions evently/lib/screens/overview_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,28 @@ class _OverViewScreenState extends State<OverViewScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const VerticalSpace(20),
MyStepsIndicator(currentStep: createEventViewModel.currentStep),
StepLabels(currentPage: createEventViewModel.currentPage, currentStep: createEventViewModel.currentStep),
PageAppBar(onPressBack: () {}),
const VerticalSpace(20),
PageAppBar(onPressBack: () {
Navigator.of(context).pop();
}),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 15.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
EventlyTextField(
controller: TextEditingController(text: provider.eventName),
onChanged: (_) => provider.setEventName = _,
label: LocaleKeys.event_name.tr(),
hint: LocaleKeys.what_your_event_called.tr(),
textCapitalization: TextCapitalization.sentences,
),
VerticalSpace(20.h),
EventlyTextField(
controller: TextEditingController(text: provider.hostName),
onChanged: (String _) => provider.setHostName = _,
label: LocaleKeys.host_name.tr(),
hint: LocaleKeys.who_hosting_it.tr(),
Expand All @@ -70,7 +76,7 @@ class _OverViewScreenState extends State<OverViewScreen> {
textAlign: TextAlign.start,
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.w700),
),
VerticalSpace(10.h),
SizedBox(height: 4.h),
ClipRRect(
borderRadius: BorderRadius.only(topRight: Radius.circular(8.r), topLeft: Radius.circular(8.r)),
child: Center(
Expand Down Expand Up @@ -112,10 +118,11 @@ class _OverViewScreenState extends State<OverViewScreen> {
),
),
),
const VerticalSpace(80),
BottomButtons(
onPressContinue: () {},
onPressSaveDraft: () {},
isContinueEnable: false,
isContinueEnable: provider.isOverviewEnable,
)
],
),
Expand Down
6 changes: 3 additions & 3 deletions evently/lib/widgets/evently_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class EventlyTextField extends StatelessWidget {
Text(
label,
textAlign: TextAlign.start,
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.w700),
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700),
),
SizedBox(height: 4.h),
Stack(
Expand Down Expand Up @@ -73,7 +73,7 @@ class EventlyTextField extends StatelessWidget {
child: TextFormField(
enabled: enable,
onChanged: onChanged,
style: TextStyle(fontSize: noOfLines == 1 ? 18.sp : 15.sp, fontWeight: FontWeight.w400, color: EventlyAppTheme.kTextGrey),
style: TextStyle(fontSize: noOfLines == 1 ? 18.sp : 15, fontWeight: FontWeight.w400, color: EventlyAppTheme.kTextGrey),
controller: controller,
validator: validator,
minLines: noOfLines,
Expand All @@ -83,7 +83,7 @@ class EventlyTextField extends StatelessWidget {
inputFormatters: inputFormatters,
decoration: InputDecoration(
hintText: hint,
hintStyle: TextStyle(fontSize: 15.sp, fontWeight: FontWeight.w400, color: EventlyAppTheme.kTextGrey),
hintStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w400, color: EventlyAppTheme.kTextGrey),
border: const OutlineInputBorder(borderSide: BorderSide.none),
floatingLabelBehavior: FloatingLabelBehavior.always,
contentPadding: EdgeInsets.fromLTRB(10.w, 0.h, 10.w, 0.h),
Expand Down

0 comments on commit b6743ce

Please sign in to comment.