forked from eatvio/eatvio_app
feat(diary): product name -> input for glossary request, resize modal with keyboard (glossary request), calendar resize by tap + swipe
This commit is contained in:
@@ -172,13 +172,20 @@ class _DiaryScreenState extends State<DiaryScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
_nextCalendarFormat() {
|
||||
setState(() {
|
||||
_calendarFormat = CalendarFormat.values[(_calendarFormat.index - 1) % CalendarFormat.values.length];
|
||||
});
|
||||
}
|
||||
|
||||
_arrowDown() {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onVerticalDragStart: (_) {
|
||||
setState(() {
|
||||
_calendarFormat = CalendarFormat.values[(_calendarFormat.index - 1) % CalendarFormat.values.length];
|
||||
});
|
||||
_nextCalendarFormat();
|
||||
},
|
||||
onTap: () {
|
||||
_nextCalendarFormat();
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
@@ -1003,10 +1010,15 @@ class _DiaryScreenState extends State<DiaryScreen> {
|
||||
Navigator.of(context).pop();
|
||||
if (enableQuantity) {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
useRootNavigator: true,
|
||||
useSafeArea: false,
|
||||
context: context,
|
||||
builder: (context) => GlossaryModerationRequestModalWidget(),
|
||||
builder: (context) => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
child: GlossaryModerationRequestModalWidget(productName: productNameController.text),
|
||||
),
|
||||
);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
@@ -3,7 +3,12 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GlossaryModerationRequestModalWidget extends StatefulWidget {
|
||||
const GlossaryModerationRequestModalWidget({super.key});
|
||||
final String productName;
|
||||
|
||||
const GlossaryModerationRequestModalWidget({
|
||||
super.key,
|
||||
required this.productName,
|
||||
});
|
||||
|
||||
@override
|
||||
State<GlossaryModerationRequestModalWidget> createState() => _GlossaryModerationRequestModalWidgetState();
|
||||
@@ -13,6 +18,7 @@ enum GlossaryState { alert, addNewProduct, finish }
|
||||
|
||||
class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModerationRequestModalWidget> {
|
||||
GlossaryState glossaryState = GlossaryState.alert;
|
||||
final productNameController = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -23,6 +29,12 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
productNameController.text = widget.productName;
|
||||
}
|
||||
|
||||
_alert() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -142,6 +154,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
const SizedBox(height: 24),
|
||||
CustomTextFormField(
|
||||
hintText: 'Сырный суп',
|
||||
controller: productNameController,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user