forked from eatvio/eatvio_app
50 lines
1.8 KiB
Dart
50 lines
1.8 KiB
Dart
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
|
import 'package:eatvio_app/core/widgets/custom_divider.dart';
|
|
import 'package:eatvio_app/core/widgets/main_background_bouble.dart';
|
|
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
|
import 'package:eatvio_app/features/plans/presentation/widgets/item_widget.dart';
|
|
import 'package:eatvio_app/features/plans/presentation/widgets/option_duration_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class OptionWidget extends StatelessWidget {
|
|
const OptionWidget({super.key, required this.option});
|
|
final PacketOptions? option;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (option == null) {
|
|
return SizedBox.shrink();
|
|
}
|
|
return MainBackgroundBouble(
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SizedBox(height: 16),
|
|
Text(
|
|
option?.short ?? '',
|
|
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
|
),
|
|
SizedBox(height: 12),
|
|
Text(
|
|
option?.description ?? '',
|
|
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
|
|
),
|
|
SizedBox(height: 12),
|
|
OptionDurationWidget(duration: 7),
|
|
SizedBox(height: 16),
|
|
CustomDivider(),
|
|
SizedBox(height: 16),
|
|
ListView.separated(
|
|
physics: NeverScrollableScrollPhysics(),
|
|
separatorBuilder: (context, index) => SizedBox(height: 12),
|
|
itemBuilder: (context, index) => ItemWidget(text: option?.items[index] ?? ''),
|
|
itemCount: option?.items.length ?? 0,
|
|
shrinkWrap: true,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|