forked from eatvio/eatvio_app
feat(diary) Initial layouts for Diary edit
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomDropDown extends StatelessWidget {
|
||||
@@ -39,7 +38,7 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
final TextStyle? textStyle;
|
||||
|
||||
final List<SelectionPopupModel>? items;
|
||||
final List<String>? items;
|
||||
|
||||
final String? hintText;
|
||||
|
||||
@@ -61,9 +60,9 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
final bool? filled;
|
||||
|
||||
final FormFieldValidator<SelectionPopupModel>? validator;
|
||||
final FormFieldValidator<String>? validator;
|
||||
|
||||
final Function(SelectionPopupModel)? onChanged;
|
||||
final Function(String)? onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -77,31 +76,29 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
Widget get dropDownWidget => SizedBox(
|
||||
width: width ?? double.maxFinite,
|
||||
child: DropdownButtonFormField<SelectionPopupModel>(
|
||||
child: DropdownButtonFormField(
|
||||
focusNode: focusNode ?? FocusNode(),
|
||||
icon: icon,
|
||||
autofocus: autofocus!,
|
||||
style: textStyle ?? theme.textTheme.titleMedium,
|
||||
items: items?.map((SelectionPopupModel item) {
|
||||
return DropdownMenuItem<SelectionPopupModel>(
|
||||
value: item,
|
||||
items: items?.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(
|
||||
item.title,
|
||||
value,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: hintStyle ?? theme.textTheme.titleMedium,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
decoration: decoration,
|
||||
validator: validator,
|
||||
onChanged: (value) {
|
||||
onChanged!(value!);
|
||||
onChanged!(value.toString());
|
||||
},
|
||||
),
|
||||
);
|
||||
InputDecoration get decoration => InputDecoration(
|
||||
hintText: hintText ?? "",
|
||||
hintStyle: hintStyle ?? theme.textTheme.titleMedium,
|
||||
hintStyle: hintStyle,
|
||||
prefixIcon: prefix,
|
||||
prefixIconConstraints: prefixConstraints,
|
||||
suffixIcon: suffix,
|
||||
@@ -109,33 +106,27 @@ class CustomDropDown extends StatelessWidget {
|
||||
isDense: true,
|
||||
contentPadding: contentPadding ??
|
||||
EdgeInsets.only(
|
||||
left: 6.h,
|
||||
top: 6.v,
|
||||
bottom: 6.v,
|
||||
left: 17,
|
||||
top: 17,
|
||||
bottom: 17,
|
||||
),
|
||||
fillColor: fillColor ?? theme.colorScheme.onPrimary,
|
||||
fillColor: fillColor,
|
||||
filled: filled,
|
||||
border: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabledBorder: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
color: Colors.blue,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user