contacts ui bug solved

This commit is contained in:
meylis98 2023-03-13 18:06:30 +05:00
parent 2678e04975
commit 66da382029
6 changed files with 272 additions and 242 deletions

View File

@ -1,21 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off --> <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <!-- Show a splash screen on the activity. Automatically removed when
<!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame -->
the Flutter engine draws its first frame --> <item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowFullscreen">true</item>
<item name="android:forceDarkAllowed">false</item> </style>
<item name="android:windowFullscreen">false</item> </resources>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@ -7,6 +7,7 @@ import 'package:provider/provider.dart';
import 'package:sapaly_shop/common/custom_button.dart'; import 'package:sapaly_shop/common/custom_button.dart';
import 'package:sapaly_shop/common/widgets/custom_text_field.dart'; import 'package:sapaly_shop/common/widgets/custom_text_field.dart';
import 'package:sapaly_shop/constants/global_variables.dart'; import 'package:sapaly_shop/constants/global_variables.dart';
import 'package:sapaly_shop/constants/utils.dart';
import 'package:sapaly_shop/features/screens/drawer/sapaly_drawer.dart'; import 'package:sapaly_shop/features/screens/drawer/sapaly_drawer.dart';
import 'package:sapaly_shop/features/screens/home/home_screen.dart'; import 'package:sapaly_shop/features/screens/home/home_screen.dart';
import 'package:sapaly_shop/features/services/auth_service.dart'; import 'package:sapaly_shop/features/services/auth_service.dart';
@ -75,219 +76,238 @@ class _ContactsScreenState extends State<ContactsScreen> {
vertical: GlobalVariables.verticalPadding(context), vertical: GlobalVariables.verticalPadding(context),
horizontal: GlobalVariables.horizontalPadding(context), horizontal: GlobalVariables.horizontalPadding(context),
), ),
child: Column( child: ScrollConfiguration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, behavior: CustomScrollBehavior(),
children: [ child: ListView(
CustomTextField( // mainAxisAlignment: MainAxisAlignment.spaceBetween,
labelText: 'first_name'.translation, children: [
hintText: 'first_name'.translation, CustomTextField(
controller: firstNameController, labelText: 'first_name'.translation,
obscureText: false, hintText: 'first_name'.translation,
inputType: TextInputType.text, controller: firstNameController,
isPassword: false,
contentPadding: 0,
),
CustomTextField(
labelText: 'email'.translation,
hintText: 'email'.translation,
controller: emailController,
obscureText: false,
inputType: TextInputType.emailAddress,
isPassword: false,
contentPadding: 0,
),
CustomTextField(
labelText: 'subject'.translation,
hintText: 'subject'.translation,
controller: subjectController,
obscureText: false,
inputType: TextInputType.text,
isPassword: false,
contentPadding: 0,
),
SizedBox(
height: GlobalVariables.deviceHeight(context) / 6,
child: CustomTextField(
labelText: 'message'.translation,
hintText: 'message'.translation,
controller: messageController,
obscureText: false, obscureText: false,
inputType: TextInputType.text, inputType: TextInputType.text,
isPassword: false, isPassword: false,
contentPadding: 100.adaptedPx(), contentPadding: 0,
), ),
), Padding(
CustomButton( padding: EdgeInsets.symmetric(
name: 'send_message'.translation, vertical: GlobalVariables.verticalPadding(context),
onTap: () { ),
Navigator.of(context).push( child: CustomTextField(
MaterialPageRoute( labelText: 'email'.translation,
builder: (context) => me.user.token.isEmpty hintText: 'email'.translation,
? const UnAuthenticated() controller: emailController,
: const HomeScreen(), obscureText: false,
inputType: TextInputType.emailAddress,
isPassword: false,
contentPadding: 0,
),
),
CustomTextField(
labelText: 'subject'.translation,
hintText: 'subject'.translation,
controller: subjectController,
obscureText: false,
inputType: TextInputType.text,
isPassword: false,
contentPadding: 0,
),
Padding(
padding: EdgeInsets.symmetric(
vertical: GlobalVariables.verticalPadding(context),
),
child: SizedBox(
height: GlobalVariables.deviceHeight(context) / 6,
child: CustomTextField(
labelText: 'message'.translation,
hintText: 'message'.translation,
controller: messageController,
obscureText: false,
inputType: TextInputType.text,
isPassword: false,
contentPadding: 100.adaptedPx(),
), ),
); ),
},
backgroundColor: AppTheme.lightPrimaryColor,
isMain: true,
),
ListTile(
leading: const Icon(
Icons.location_on_outlined,
color: AppTheme.lightPrimaryColor,
), ),
title: Text( CustomButton(
'our_location'.translation, name: 'send_message'.translation,
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( onTap: () {
fontSize: 15.adaptedPx(), Navigator.of(context).push(
fontWeight: FontWeight.w600, MaterialPageRoute(
color: AppTheme.blackColor, builder: (context) => me.user.token.isEmpty
? const UnAuthenticated()
: const HomeScreen(),
), ),
);
},
backgroundColor: AppTheme.lightPrimaryColor,
isMain: true,
), ),
subtitle: Text( ListTile(
'Turkmenistan, Ashgabat city, Galkynysh, street 66(old printing house)', leading: const Icon(
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( Icons.location_on_outlined,
fontSize: 13.adaptedPx(), color: AppTheme.lightPrimaryColor,
color: AppTheme.blackColor, ),
), title: Text(
'our_location'.translation,
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
subtitle: Text(
'Turkmenistan, Ashgabat city, Galkynysh, street 66(old printing house)',
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
),
), ),
), ListTile(
ListTile( leading: const Icon(
leading: const Icon( Icons.email_outlined,
Icons.email_outlined, color: AppTheme.lightPrimaryColor,
color: AppTheme.lightPrimaryColor, ),
), title: Text(
title: Text( 'email'.translation,
'email'.translation, style:
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 15.adaptedPx(), fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppTheme.blackColor, color: AppTheme.blackColor,
), ),
), ),
subtitle: Text( subtitle: Text(
'enquery@gmail.com help@yourdomain.com', 'enquery@gmail.com help@yourdomain.com',
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( style:
fontSize: 13.adaptedPx(), Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
color: AppTheme.blackColor, fontSize: 13.adaptedPx(),
), color: AppTheme.blackColor,
), ),
onTap: () { ),
showModalBottomSheet( onTap: () {
context: context, showModalBottomSheet(
builder: (context) => Column( context: context,
mainAxisSize: MainAxisSize.min, builder: (context) => Column(
children: [ mainAxisSize: MainAxisSize.min,
SizedBox(height: 10.adaptedPx()), children: [
TextButton( SizedBox(height: 10.adaptedPx()),
onPressed: () async { TextButton(
if (await canLaunchUrlString("mailto:$mail1")) { onPressed: () async {
await launchUrlString("mailto:$mail1"); if (await canLaunchUrlString("mailto:$mail1")) {
} await launchUrlString("mailto:$mail1");
Navigator.of(context).pop(); }
}, Navigator.of(context).pop();
child: Text( },
mail1, child: Text(
style: Theme.of(context) mail1,
.primaryTextTheme style: Theme.of(context)
.bodyMedium! .primaryTextTheme
.copyWith( .bodyMedium!
fontSize: 20.adaptedPx(), .copyWith(
color: AppTheme.blackColor, fontSize: 20.adaptedPx(),
), color: AppTheme.blackColor,
),
),
), ),
), SizedBox(height: 10.adaptedPx()),
SizedBox(height: 10.adaptedPx()), TextButton(
TextButton( onPressed: () async {
onPressed: () async { if (await canLaunchUrlString("mailto:$mail2")) {
if (await canLaunchUrlString("mailto:$mail2")) { await launchUrlString("mailto:$mail2");
await launchUrlString("mailto:$mail2"); }
} Navigator.of(context).pop();
Navigator.of(context).pop(); },
}, child: Text(
child: Text( mail2,
mail2, style: Theme.of(context)
style: Theme.of(context) .primaryTextTheme
.primaryTextTheme .bodyMedium!
.bodyMedium! .copyWith(
.copyWith( fontSize: 20.adaptedPx(),
fontSize: 20.adaptedPx(), color: AppTheme.blackColor,
color: AppTheme.blackColor, ),
), ),
), ),
), SizedBox(height: 10.adaptedPx()),
SizedBox(height: 10.adaptedPx()), ],
],
),
);
},
),
ListTile(
leading: const Icon(
Icons.phone_outlined,
color: AppTheme.lightPrimaryColor,
),
title: Text(
'contacts'.translation,
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
), ),
);
},
), ),
subtitle: Text( ListTile(
'$number1 $number2', leading: const Icon(
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( Icons.phone_outlined,
fontSize: 13.adaptedPx(), color: AppTheme.lightPrimaryColor,
color: AppTheme.blackColor, ),
title: Text(
'contacts'.translation,
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
subtitle: Text(
'$number1 $number2',
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
),
onTap: () {
showModalBottomSheet(
context: context,
builder: (context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
TextButton(
onPressed: () {
launchUrlString('tel://$number1');
Navigator.of(context).pop();
},
child: Text(
number1,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium!
.copyWith(
fontSize: 20.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
SizedBox(height: 10.adaptedPx()),
TextButton(
onPressed: () {
launchUrlString('tel://$number2');
Navigator.of(context).pop();
},
child: Text(
number2,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium!
.copyWith(
fontSize: 20.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
SizedBox(height: 10.adaptedPx()),
],
), ),
);
},
), ),
onTap: () { ],
showModalBottomSheet( ),
context: context,
builder: (context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
TextButton(
onPressed: () {
launchUrlString('tel://$number1');
Navigator.of(context).pop();
},
child: Text(
number1,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium!
.copyWith(
fontSize: 20.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
SizedBox(height: 10.adaptedPx()),
TextButton(
onPressed: () {
launchUrlString('tel://$number2');
Navigator.of(context).pop();
},
child: Text(
number2,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium!
.copyWith(
fontSize: 20.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
SizedBox(height: 10.adaptedPx()),
],
),
);
},
),
],
), ),
), ),
); );

View File

@ -156,34 +156,55 @@ class _SapalyDrawerState extends State<SapalyDrawer> {
], ],
), ),
), ),
Row( Padding(
children: [ padding: EdgeInsets.symmetric(
SapalyIcon( vertical: 15.adaptedPx(),
onTap: () async { horizontal: 5.adaptedPx(),
var lang = ),
await languagePicker(context, settings.currentLanguage); child: GestureDetector(
onTap: () async {
var lang =
await languagePicker(context, settings.currentLanguage);
if (lang != null) { if (lang != null) {
await settings.setLanguage(lang); await settings.setLanguage(lang);
Navigator.of(context, rootNavigator: true) Navigator.of(context, rootNavigator: true)
.pushNamedAndRemoveUntil('/home', (route) => false); .pushNamedAndRemoveUntil('/home', (route) => false);
} }
}, },
width: 25.adaptedPx(), child: Row(
height: 25.adaptedPx(), children: [
hasBadge: false, SapalyIcon(
child: SvgPicture.asset('assets/icons/lang.svg'), onTap: () async {
), var lang = await languagePicker(
SizedBox(width: 10.adaptedPx()), context, settings.currentLanguage);
Text(
'currentLang'.translation, if (lang != null) {
style: await settings.setLanguage(lang);
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( Navigator.of(context, rootNavigator: true)
.pushNamedAndRemoveUntil(
'/home', (route) => false);
}
},
width: 25.adaptedPx(),
height: 25.adaptedPx(),
hasBadge: false,
child: SvgPicture.asset('assets/icons/lang.svg'),
),
SizedBox(width: 10.adaptedPx()),
Text(
'currentLang'.translation,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
color: AppTheme.blackColor, color: AppTheme.blackColor,
fontSize: 15.adaptedPx(), fontSize: 15.adaptedPx(),
), ),
),
],
), ),
], ),
), ),
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,

View File

@ -28,7 +28,7 @@
"first_name":"First name", "first_name":"First name",
"subject":"Subject of message", "subject":"Subject of message",
"message":"Your message...", "message":"Your message...",
"needToEnter":"Log in to use the service", "needToEnter":"Log in to use\nthe service",
"error_occured":"Error occured", "error_occured":"Error occured",
"info_about_user":"Information about user", "info_about_user":"Information about user",
"edit":"Edit" "edit":"Edit"

View File

@ -28,7 +28,7 @@
"first_name":"Ваше имя", "first_name":"Ваше имя",
"subject":"Тема сообщения", "subject":"Тема сообщения",
"message":"Ваше сообщение...", "message":"Ваше сообщение...",
"needToEnter":"Чтобы воспользоваться услугой авторизуйтесь", "needToEnter":"Чтобы воспользоваться\nуслугой авторизуйтесь",
"error_occured":"Произошла ошибка", "error_occured":"Произошла ошибка",
"info_about_user":"Информация о пользователе", "info_about_user":"Информация о пользователе",
"edit":"Редактировать" "edit":"Редактировать"

View File

@ -28,7 +28,7 @@
"first_name":"Ady", "first_name":"Ady",
"subject":"Hatyň mowzugy", "subject":"Hatyň mowzugy",
"message":"Siziň hatyňyz...", "message":"Siziň hatyňyz...",
"needToEnter":"Hyzmaty ulanmak üçin ulgama giriň", "needToEnter":"Hyzmaty ulanmak\nüçin ulgama giriň",
"error_occured":"Näsazlyk ýüze çykdy", "error_occured":"Näsazlyk ýüze çykdy",
"info_about_user":"Ulanyjy barada maglumat", "info_about_user":"Ulanyjy barada maglumat",
"edit":"Üýtgetmek" "edit":"Üýtgetmek"