create diet screen

This commit is contained in:
Username1548
2024-11-25 16:01:02 +07:00
parent c3cb55f8a2
commit c78a90b603
42 changed files with 1742 additions and 918 deletions

View File

@@ -0,0 +1,41 @@
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
class CustomDropDownButton<T> extends StatelessWidget {
const CustomDropDownButton({
super.key,
required this.items,
required this.onChanged,
this.value,
this.hint,
});
final T? value;
final List<DropdownMenuItem<T>> items;
final void Function(T?)? onChanged;
final Widget? hint;
@override
Widget build(BuildContext context) {
return DropdownButtonFormField(
hint: hint,
icon: SvgPicture.asset(
'assets/icons/arrow_down2.svg',
width: 12,
height: 8,
),
borderRadius: BorderRadius.circular(20),
dropdownColor: appTheme.lightGray0,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide.none,
),
fillColor: appTheme.lightGray0,
filled: true,
),
value: value,
items: items,
onChanged: onChanged,
);
}
}

View File

@@ -13,7 +13,7 @@ class CustomTextFormField extends StatelessWidget {
this.obscureText = false,
this.textInputAction,
this.textInputType,
this.maxLines,
this.maxLines = 1,
this.hintText,
this.hintStyle,
this.prefix,
@@ -35,6 +35,8 @@ class CustomTextFormField extends StatelessWidget {
this.onEditingComplete,
this.minLines = 1,
this.maxLength,
this.expands = false,
this.textAlignVertical,
super.key,
});
@@ -49,7 +51,7 @@ class CustomTextFormField extends StatelessWidget {
final TextInputAction? textInputAction;
final TextInputType? textInputType;
final int? maxLines;
final int minLines;
final int? minLines;
final String? hintText;
final TextStyle? hintStyle;
final Widget? prefix;
@@ -69,12 +71,15 @@ class CustomTextFormField extends StatelessWidget {
final void Function(String?)? onSaved;
final void Function(String)? onChanged;
final int? maxLength;
final bool expands;
final TextAlignVertical? textAlignVertical;
@override
Widget build(BuildContext context) {
return Align(
alignment: alignment ?? Alignment.center,
child: TextFormField(
textAlignVertical: textAlignVertical,
expands: expands,
minLines: minLines,
maxLength: maxLength,
onChanged: onChanged,
@@ -88,7 +93,7 @@ class CustomTextFormField extends StatelessWidget {
),
obscureText: obscureText!,
textInputAction: textInputAction,
maxLines: maxLines ?? 1,
maxLines: maxLines,
initialValue: initialValue,
cursorColor: appTheme.blueA400,
decoration: InputDecoration(

View File

@@ -0,0 +1,38 @@
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class MainBackgroundBouble extends StatelessWidget {
const MainBackgroundBouble(
{super.key, required this.child, this.width, this.padding, this.enableShadow = false,});
final double? width;
final Widget child;
final bool enableShadow;
final EdgeInsetsGeometry? padding;
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
boxShadow: enableShadow
? [
BoxShadow(
color: Color(0x00000000).withOpacity(0.2),
spreadRadius: 0,
blurRadius: 32,
offset: Offset(0, 0),
),
]
: null,),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Container(
decoration: BoxDecoration(
color: appTheme.whiteA700,
),
width: width ?? MediaQuery.sizeOf(context).width,
padding: padding,
child: child,
),
),
);
}
}