forked from eatvio/eatvio_app
Compare commits
3 Commits
diary
...
consultati
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7df1323f7d | ||
|
|
8f70e9620b | ||
|
|
1dfaa7cd93 |
@@ -10,12 +10,14 @@ abstract class ConsultationModel with _$ConsultationModel {
|
|||||||
factory ConsultationModel({
|
factory ConsultationModel({
|
||||||
required int id,
|
required int id,
|
||||||
@JsonKey(name: 'last_state') required ChosenPlanStateEnum chosenPlanState,
|
@JsonKey(name: 'last_state') required ChosenPlanStateEnum chosenPlanState,
|
||||||
required String planTitle,
|
@JsonKey(name: 'plan_title') required String planTitle,
|
||||||
required String userName,
|
@JsonKey(name: 'user_name') required String userName,
|
||||||
required String userSlug,
|
@JsonKey(name: 'user_slug') required String userSlug,
|
||||||
required double consultantPayment,
|
@JsonKey(name: 'consultant_payment') required double consultantPayment,
|
||||||
required int duration,
|
required int duration,
|
||||||
required int currentDiaryDay,
|
@JsonKey(name: 'current_diary_day') required int currentDiaryDay,
|
||||||
|
@JsonKey(name: 'user_profile_photo_url') required String userProfilePhotoUrl,
|
||||||
|
@JsonKey(name: 'consultation_option_price') required int consultationOptionPrice,
|
||||||
@JsonKey(name: 'start_date', fromJson: parseDate) required DateTime startDate,
|
@JsonKey(name: 'start_date', fromJson: parseDate) required DateTime startDate,
|
||||||
@JsonKey(name: 'end_date', fromJson: parseDate) required DateTime endDate,
|
@JsonKey(name: 'end_date', fromJson: parseDate) required DateTime endDate,
|
||||||
@JsonKey(name: 'consultant_id') required int consultantId,
|
@JsonKey(name: 'consultant_id') required int consultantId,
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ class ConsultationsContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: switch (state.state) {
|
body: switch (state.state) {
|
||||||
BaseState.loading => const Loader(),
|
BaseState.loading => const Loader(),
|
||||||
BaseState.error => DataErrorWidget(onReload: () async {}),
|
BaseState.error => DataErrorWidget(onReload: () async {
|
||||||
|
context.read<ConsultationsCubit>().loadConsultations();
|
||||||
|
}),
|
||||||
BaseState.initial => const Loader(),
|
BaseState.initial => const Loader(),
|
||||||
BaseState.success => ListView.separated(
|
BaseState.success => ListView.separated(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ class _ConsultationCardWidgetState extends State<ConsultationCardWidget> {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 30,
|
radius: 30,
|
||||||
|
backgroundImage: NetworkImage(widget.consultationsModel.userProfilePhotoUrl),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Column(
|
Column(
|
||||||
@@ -272,7 +273,7 @@ class _ConsultationCardWidgetState extends State<ConsultationCardWidget> {
|
|||||||
const CustomDivider(),
|
const CustomDivider(),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
'${widget.consultationsModel.consultantPayment.toStringAsFixed(0)} ₽',
|
'${widget.consultationsModel.consultationOptionPrice.toStringAsFixed(0)} ₽',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Color(0xFF019A3E),
|
color: Color(0xFF019A3E),
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
|
|||||||
Reference in New Issue
Block a user