Merge pull request 'fix: comments' (#195) from mso7nueh/eatvio_app:main into main

Reviewed-on: eatvio/eatvio_app#195
This commit is contained in:
mso7nueh
2024-12-11 11:14:35 +00:00
2 changed files with 61 additions and 55 deletions

View File

@@ -49,39 +49,43 @@ class CalendarScreen extends StatelessWidget {
}
Widget _buildCalendar(BuildContext context, CalendarStateLoaded state) {
return Stack(alignment: Alignment.bottomCenter, children: [
FormBuilder(
child: Scaffold(
appBar: AppBar(
toolbarHeight: 0,
automaticallyImplyLeading: false,
),
backgroundColor: Colors.white,
resizeToAvoidBottomInset: true,
body: SizedBox(
width: double.maxFinite,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
SizedBox(height: 24),
_buildCalendarBody(context, state),
SizedBox(height: 24),
],
return Stack(
alignment: Alignment.bottomCenter,
children: [
FormBuilder(
child: Scaffold(
appBar: AppBar(
title: Text(
'Календарь',
),
),
backgroundColor: Colors.white,
resizeToAvoidBottomInset: true,
body: SizedBox(
width: double.maxFinite,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
SizedBox(height: 24),
_buildCalendarBody(context, state),
SizedBox(height: 24),
],
),
),
),
),
),
],
],
),
),
),
),
),
],);
],
);
}
_buildCalendarBody(BuildContext context, CalendarStateLoaded state) {
@@ -180,44 +184,46 @@ class CalendarScreen extends StatelessWidget {
style: theme.textTheme.titleMedium,
),
SizedBox(height: 4),
Row(children: [
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
_getStateText(diary['state'] ?? ''),
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
SizedBox(width: 4),
if (diary['state'] == 'started')
Row(
children: [
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Заполнить отчет',
_getStateText(diary['state'] ?? ''),
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
if (diary['state'] == 'finished')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
SizedBox(width: 4),
if (diary['state'] == 'started')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Заполнить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
child: Text(
'Изменить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
if (diary['state'] == 'finished')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Изменить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
),
],),
],
),
],
),
),

View File

@@ -78,7 +78,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
),
SizedBox(height: 4),
SizedBox(
width: MediaQuery.of(context).size.width * 0.8,
width: isChild ? MediaQuery.of(context).size.width * 0.72 : MediaQuery.of(context).size.width * 0.8,
child: Text(
comment.body,
style: TextStyle(