forked from eatvio/eatvio_app
feat(feed, profile): добавлен переход на страинцу автора в посте, рецепте и дете. при нажатии на изображение в рецепте и диеты теперь переход на страницу с подробнее.
This commit is contained in:
@@ -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,20 +85,14 @@ 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(),
|
||||
@@ -117,10 +111,7 @@ 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,
|
||||
@@ -132,10 +123,7 @@ 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,10 +247,7 @@ 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),
|
||||
),
|
||||
);
|
||||
@@ -395,9 +392,11 @@ 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),
|
||||
@@ -422,17 +421,16 @@ 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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user