forked from eatvio/eatvio_app
plan creation screen added
This commit is contained in:
50
lib/core/widgets/cpfc_container.dart
Normal file
50
lib/core/widgets/cpfc_container.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CpfcContainer extends StatelessWidget {
|
||||
const CpfcContainer({super.key, required this.calories, required this.proteins, required this.fats, required this.carbohydrates});
|
||||
final double calories;
|
||||
final double proteins;
|
||||
final double fats;
|
||||
final double carbohydrates;
|
||||
final int roundDigit = 1;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
return Container(
|
||||
color: appTheme.cardBackground,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text('${calories.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.calories, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('${proteins.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.proteins, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('${fats.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.fats, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('${carbohydrates.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.carbohydrates, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,10 @@ class CustomTextFormField extends StatelessWidget {
|
||||
this.maxLength,
|
||||
this.expands = false,
|
||||
this.textAlignVertical,
|
||||
this.counter = const SizedBox.shrink(),
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Widget? counter;
|
||||
final Alignment? alignment;
|
||||
final double? width;
|
||||
final TextEditingController? controller;
|
||||
@@ -77,7 +78,7 @@ class CustomTextFormField extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Align(
|
||||
alignment: alignment ?? Alignment.center,
|
||||
child: TextFormField(
|
||||
child: TextFormField(
|
||||
textAlignVertical: textAlignVertical,
|
||||
expands: expands,
|
||||
minLines: minLines,
|
||||
@@ -97,6 +98,7 @@ class CustomTextFormField extends StatelessWidget {
|
||||
initialValue: initialValue,
|
||||
cursorColor: appTheme.blueA400,
|
||||
decoration: InputDecoration(
|
||||
counter: counter,
|
||||
suffixText: suffixText,
|
||||
hintText: hintText ?? "",
|
||||
hintStyle: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user