forked from eatvio/eatvio_app
feat(feed): add recipes screen
This commit is contained in:
@@ -85,20 +85,22 @@ class CustomDropDown extends StatelessWidget {
|
||||
autofocus: autofocus!,
|
||||
value: value,
|
||||
isExpanded: true,
|
||||
style: textStyle ?? TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
style: textStyle ??
|
||||
TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
items: items?.map((SelectionPopupModel item) {
|
||||
return DropdownMenuItem<SelectionPopupModel>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.title,
|
||||
style: hintStyle ?? TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black,
|
||||
),
|
||||
style: hintStyle ??
|
||||
TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
@@ -115,11 +117,12 @@ class CustomDropDown extends StatelessWidget {
|
||||
InputDecoration _buildInputDecoration(BuildContext context) {
|
||||
return InputDecoration(
|
||||
hintText: hintText ?? "",
|
||||
hintStyle: hintStyle ?? TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
hintStyle: hintStyle ??
|
||||
TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
prefixIcon: prefix,
|
||||
prefixIconConstraints: prefixConstraints,
|
||||
suffixIcon: suffix,
|
||||
|
||||
@@ -25,8 +25,8 @@ class CustomDropDown extends StatelessWidget {
|
||||
this.onChanged,
|
||||
this.defaultValue,
|
||||
}) : super(
|
||||
key: key,
|
||||
);
|
||||
key: key,
|
||||
);
|
||||
|
||||
final Alignment? alignment;
|
||||
|
||||
@@ -72,9 +72,9 @@ class CustomDropDown extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return alignment != null
|
||||
? Align(
|
||||
alignment: alignment ?? Alignment.center,
|
||||
child: _buildDropDownWidget(context),
|
||||
)
|
||||
alignment: alignment ?? Alignment.center,
|
||||
child: _buildDropDownWidget(context),
|
||||
)
|
||||
: _buildDropDownWidget(context);
|
||||
}
|
||||
|
||||
@@ -85,14 +85,20 @@ class CustomDropDown extends StatelessWidget {
|
||||
focusNode: focusNode ?? FocusNode(),
|
||||
icon: icon,
|
||||
autofocus: autofocus!,
|
||||
style: textStyle ?? Theme.of(context).textTheme.titleMedium,
|
||||
style: textStyle ?? Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
items: items?.map((SelectionPopupModel item) {
|
||||
return DropdownMenuItem<SelectionPopupModel>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: hintStyle ?? Theme.of(context).textTheme.titleMedium,
|
||||
style: hintStyle ?? Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
@@ -111,7 +117,10 @@ class CustomDropDown extends StatelessWidget {
|
||||
InputDecoration _buildInputDecoration(BuildContext context) {
|
||||
return InputDecoration(
|
||||
hintText: hintText ?? "",
|
||||
hintStyle: hintStyle ?? Theme.of(context).textTheme.titleMedium,
|
||||
hintStyle: hintStyle ?? Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
prefixIcon: prefix,
|
||||
prefixIconConstraints: prefixConstraints,
|
||||
suffixIcon: suffix,
|
||||
@@ -123,7 +132,10 @@ class CustomDropDown extends StatelessWidget {
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
),
|
||||
fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary,
|
||||
fillColor: fillColor ?? Theme
|
||||
.of(context)
|
||||
.colorScheme
|
||||
.onPrimary,
|
||||
filled: filled,
|
||||
border: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
|
||||
@@ -247,12 +247,16 @@ class _ExpandableListState extends State<ExpandableList> {
|
||||
value: value,
|
||||
child: SizedBox(
|
||||
// Используем SizedBox для ограничения ширины элемента списка
|
||||
width: MediaQuery.of(context).size.width * 0.8, // Устанавливаем желаемую ширину элемента списка
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width * 0.8, // Устанавливаем желаемую ширину элемента списка
|
||||
child: Text(value),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
isExpanded: true, // Расширяем список на всю доступную ширину
|
||||
isExpanded: true,
|
||||
// Расширяем список на всю доступную ширину
|
||||
decoration: InputDecoration(labelText: 'Активность'),
|
||||
),
|
||||
Row(
|
||||
@@ -391,11 +395,9 @@ class _ExpandableListState extends State<ExpandableList> {
|
||||
return baseUrl + '/api/profile/update';
|
||||
}
|
||||
|
||||
Future<http.Response> _sendHttpRequest(
|
||||
Map<String, dynamic> profileData,
|
||||
String apiUrl,
|
||||
String? token,
|
||||
) {
|
||||
Future<http.Response> _sendHttpRequest(Map<String, dynamic> profileData,
|
||||
String apiUrl,
|
||||
String? token,) {
|
||||
return http.post(
|
||||
Uri.parse(apiUrl),
|
||||
body: json.encode(profileData),
|
||||
@@ -420,16 +422,17 @@ class _ExpandableListState extends State<ExpandableList> {
|
||||
void _showErrorDialog(String errorMessage) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('Ошибка'),
|
||||
content: Text(errorMessage),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: onTapOk(context),
|
||||
child: Text('OK'),
|
||||
builder: (context) =>
|
||||
AlertDialog(
|
||||
title: Text('Ошибка'),
|
||||
content: Text(errorMessage),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: onTapOk(context),
|
||||
child: Text('OK'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
class HyperSwitch extends StatefulWidget {
|
||||
final String title;
|
||||
final MyProfileLoadedState? state;
|
||||
|
||||
HyperSwitch(this.title, this.state);
|
||||
|
||||
@override
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
class HypoSwitch extends StatefulWidget {
|
||||
final String title;
|
||||
final MyProfileLoadedState? state;
|
||||
|
||||
HypoSwitch(this.title, this.state);
|
||||
|
||||
@override
|
||||
|
||||
@@ -13,7 +13,8 @@ class _LanguageDropdownState extends State<LanguageDropdown> {
|
||||
return DropdownButton<String>(
|
||||
value: selectedLanguage,
|
||||
onChanged: selectLanguage(),
|
||||
isDense: false, // Установите isDense в false
|
||||
isDense: false,
|
||||
// Установите isDense в false
|
||||
selectedItemBuilder: getList(),
|
||||
items: ['Русский'].map((String language) {
|
||||
return DropdownMenuItem<String>(
|
||||
|
||||
@@ -89,7 +89,7 @@ class CustomOutlinedButton extends BaseButton {
|
||||
}
|
||||
}
|
||||
|
||||
/*_buildAppBarbuildOutlinedButtonWidget() {
|
||||
/*_buildAppBarbuildOutlinedButtonWidget() {
|
||||
return Container(
|
||||
height: this.height ?? 30.v,
|
||||
width: this.width ?? double.maxFinite,
|
||||
|
||||
@@ -11,8 +11,8 @@ class CustomTextFormField extends StatelessWidget {
|
||||
this.autofocus = false,
|
||||
this.textStyle,
|
||||
this.obscureText = false,
|
||||
this.textInputAction = TextInputAction.next,
|
||||
this.textInputType = TextInputType.text,
|
||||
this.textInputAction,
|
||||
this.textInputType,
|
||||
this.maxLines,
|
||||
this.hintText,
|
||||
this.hintStyle,
|
||||
|
||||
Reference in New Issue
Block a user