Lanscape orientation and more chat layouts

This commit is contained in:
2024-05-06 14:30:08 +03:00
parent 6576ce4bc4
commit 150e6dc1f9
5 changed files with 27 additions and 510 deletions

View File

@@ -26,477 +26,17 @@ class ChatScreen extends StatelessWidget {
appBar: _buildAppbar(context),
body: SizedBox(
width: double.maxFinite,
child: Column(
children: [
SizedBox(height: 13.v),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: 34.v,
width: 211.h,
margin: EdgeInsets.only(right: 17.h),
child: Stack(
alignment: Alignment.bottomRight,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 34.v,
width: 211.h,
alignment: Alignment.center,
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: EdgeInsets.only(
right: 9.h,
bottom: 4.v,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: EdgeInsets.only(bottom: 1.v),
child: Text(
"msg_food_is_amazing".tr,
style: theme.textTheme.bodyLarge,
),
),
Padding(
padding: EdgeInsets.only(
left: 7.h,
top: 7.v,
),
child: Text(
"lbl_10_10".tr,
style: theme.textTheme.bodySmall,
),
),
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 7.v,
width: 14.h,
margin: EdgeInsets.only(
left: 2.h,
top: 9.v,
bottom: 4.v,
),
)
],
),
),
)
],
),
),
SizedBox(height: 8.v),
Padding(
padding: EdgeInsets.only(
left: 84.h,
right: 17.h,
),
child: _buildColumncheckmark(
context,
imageOne: ImageConstant.imageNotFound,
time: "lbl_10_15".tr,
),
),
SizedBox(height: 8.v),
Padding(
padding: EdgeInsets.only(
left: 84.h,
right: 17.h,
),
child: _buildColumncheckmark(
context,
imageOne: ImageConstant.imageNotFound,
time: "lbl_10_15".tr,
),
),
SizedBox(height: 20.v),
Align(
alignment: Alignment.centerLeft,
child: Container(
margin: EdgeInsets.only(
left: 10.h,
right: 77.h,
),
padding: EdgeInsets.symmetric(
horizontal: 11.h,
vertical: 4.v,
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(ImageConstant.imageNotFound),
fit: BoxFit.cover,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 3.v),
Padding(
padding: EdgeInsets.only(left: 7.h),
child: Row(
children: [
SizedBox(
height: 33.v,
child: VerticalDivider(
width: 2.h,
thickness: 2.v,
endIndent: 1.h,
),
),
Padding(
padding: EdgeInsets.only(left: 8.h),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"lbl_martha_craig".tr,
style:
CustomTextStyles.titleSmallBold,
),
Text(
"lbl_good_morning".tr,
style: CustomTextStyles
.bodyMediumBluegray800_1,
)
],
),
)
],
),
),
SizedBox(height: 4.v),
Padding(
padding: EdgeInsets.only(left: 6.h),
child: Row(
children: [
Text(
"msg_do_you_know_what".tr,
style: theme.textTheme.bodyLarge,
),
Padding(
padding: EdgeInsets.only(
left: 14.h,
top: 8.v,
),
child: Text(
"lbl_11_40".tr,
style:
CustomTextStyles.bodyMediumBlack900,
),
)
],
),
)
],
),
),
),
SizedBox(height: 20.v),
Container(
height: 34.v,
width: 266.h,
margin: EdgeInsets.only(right: 11.h),
child: Stack(
alignment: Alignment.topCenter,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 34.v,
width: 266.h,
alignment: Alignment.center,
),
Align(
alignment: Alignment.topCenter,
child: Padding(
padding: EdgeInsets.only(top: 2.v),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: EdgeInsets.only(top: 4.v),
child: Text(
"msg_it_s_morning_in".tr,
style: theme.textTheme.bodyLarge,
),
),
CustomImageView(
imagePath: ImageConstant.img,
height: 19.v,
width: 17.h,
margin: EdgeInsets.only(
left: 10.h,
bottom: 7.v,
),
),
Padding(
padding: EdgeInsets.only(
left: 14.h,
top: 12.v,
),
child: Text(
"lbl_11_43".tr,
style: theme.textTheme.bodySmall,
),
),
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 7.v,
width: 14.h,
margin: EdgeInsets.only(
left: 2.h,
top: 13.v,
bottom: 5.v,
),
)
],
),
),
)
],
),
),
SizedBox(height: 20.v),
Align(
alignment: Alignment.centerLeft,
child: Container(
width: 281.h,
margin: EdgeInsets.only(
left: 17.h,
right: 76.h,
),
padding: EdgeInsets.symmetric(
horizontal: 11.h,
vertical: 2.v,
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(ImageConstant.imageNotFound),
fit: BoxFit.cover,
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Container(
width: 191.h,
margin: EdgeInsets.only(top: 3.v),
child: Text(
"msg_what_is_the_most".tr,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyLarge!.copyWith(
height: 1.29,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 38.h,
top: 34.v,
),
child: Text(
"lbl_11_45".tr,
style:
CustomTextStyles.bodySmallMulishBluegray800,
),
)
],
),
),
),
SizedBox(height: 8.v),
Align(
alignment: Alignment.centerLeft,
child: Container(
height: 34.v,
width: 178.h,
margin: EdgeInsets.only(left: 10.h),
child: Stack(
alignment: Alignment.bottomCenter,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 34.v,
width: 178.h,
alignment: Alignment.center,
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(bottom: 3.v),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 1.v),
child: Text(
"lbl_do_you_like_it".tr,
style: theme.textTheme.bodyLarge,
),
),
Padding(
padding: EdgeInsets.only(
left: 1.h,
top: 8.v,
),
child: Text(
"lbl_11_45".tr,
style: CustomTextStyles
.bodySmallMulishBluegray800,
),
)
],
),
),
)
],
),
),
),
SizedBox(height: 20.v),
Container(
height: 34.v,
width: 218.h,
margin: EdgeInsets.only(right: 17.h),
child: Stack(
alignment: Alignment.bottomCenter,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 34.v,
width: 218.h,
alignment: Alignment.center,
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(bottom: 4.v),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"msg_i_think_top_two".tr,
style: theme.textTheme.bodyLarge,
),
Padding(
padding: EdgeInsets.only(
left: 12.h,
top: 7.v,
),
child: Text(
"lbl_11_50".tr,
style: theme.textTheme.bodySmall,
),
),
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 7.v,
width: 14.h,
margin: EdgeInsets.only(
left: 2.h,
top: 9.v,
bottom: 4.v,
),
)
],
),
),
)
],
),
),
SizedBox(height: 8.v),
Container(
width: 235.h,
margin: EdgeInsets.only(
left: 123.h,
right: 16.h,
),
padding: EdgeInsets.symmetric(
horizontal: 9.h,
vertical: 2.v,
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(ImageConstant.imageNotFound),
fit: BoxFit.cover,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 20.v),
Padding(
padding: EdgeInsets.only(left: 14.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 40.adaptSize,
width: 40.adaptSize,
margin: EdgeInsets.only(bottom: 2.v),
),
Padding(
padding: EdgeInsets.only(
left: 31.h,
top: 5.v,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"lbl7".tr,
style: CustomTextStyles
.bodyMediumBluegray800,
),
Text(
"lbl_2_8_mb".tr,
style: CustomTextStyles
.bodyMediumBluegray800,
)
],
),
)
],
),
),
SizedBox(height: 4.v),
_buildRowcheckmark(
context,
time: "lbl_11_51".tr,
)
],
),
),
SizedBox(height: 30.v),
_buildRowattachone(context)
],
),
),
)
],
child: Container(
width: double.maxFinite,
decoration: AppDecoration.fillGray,
child: ListView(
children: [
SizedBox(height: 30.v),
],
),
),
),
bottomNavigationBar: _buildBottomBar(context),
bottomNavigationBar: _buildTextField(context),
);
}
@@ -531,13 +71,10 @@ class ChatScreen extends StatelessWidget {
child: Column(
children: [
AppbarSubtitle(
text: "lbl2".tr,
text: "Валерий Леонтьев",
),
SizedBox(height: 3.v),
AppbarSubtitle(
text: "msg_12_30".tr,
margin: EdgeInsets.only(right: 38.h),
)
Text("Был в сети вчера", style: theme.textTheme.bodySmall!)
],
),
)
@@ -548,7 +85,7 @@ class ChatScreen extends StatelessWidget {
}
/// Section Widget
Widget _buildRowattachone(BuildContext context) {
_buildTextField(BuildContext context) {
return Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(
@@ -561,7 +98,7 @@ class ChatScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomImageView(
imagePath: ImageConstant.imageNotFound,
imagePath: ImageConstant.imgAttach,
height: 29.adaptSize,
width: 29.adaptSize,
margin: EdgeInsets.only(
@@ -580,7 +117,7 @@ class ChatScreen extends StatelessWidget {
builder: (context, messageController) {
return CustomTextFormField(
controller: messageController,
hintText: "lbl_message".tr,
hintText: "Напишите сообщение...",
textInputAction: TextInputAction.done,
);
},
@@ -588,7 +125,7 @@ class ChatScreen extends StatelessWidget {
),
),
CustomImageView(
imagePath: ImageConstant.imageNotFound,
imagePath: ImageConstant.imgMic,
height: 24.v,
width: 18.h,
margin: EdgeInsets.only(
@@ -602,11 +139,6 @@ class ChatScreen extends StatelessWidget {
);
}
/// Section Widget
_buildBottomBar(BuildContext context) {
return CustomBottomBar(onChanged: (BottomBarEnum type) {});
}
/// Common widget
Widget _buildColumncheckmark(
BuildContext context, {
@@ -661,33 +193,6 @@ class ChatScreen extends StatelessWidget {
}
/// Common widget
Widget _buildRowcheckmark(
BuildContext context, {
required String time,
}) {
return Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
time,
style: theme.textTheme.bodySmall!.copyWith(
color: appTheme.blueA400,
),
),
CustomImageView(
imagePath: ImageConstant.imageNotFound,
height: 7.v,
width: 14.h,
margin: EdgeInsets.only(
left: 2.h,
top: 2.v,
bottom: 3.v,
),
)
],
);
}
///Handling route based on bottom click actions
String getCurrentRoute(BottomBarEnum type) {