added some locals, details decrease button resolved

This commit is contained in:
meylis98 2023-03-11 03:53:03 +05:00
parent 1b0b3993d3
commit e5face5657
14 changed files with 85 additions and 50 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

@ -5,6 +5,9 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

@ -161,7 +161,7 @@ class _DetailsState extends State<Details> {
TextButton(
onPressed: () {
setState(() {
amount--;
amount++;
});
},
style: TextButton.styleFrom(
@ -201,7 +201,7 @@ class _DetailsState extends State<Details> {
TextButton(
onPressed: () {
setState(() {
amount--;
amount == 0 ? amount : amount--;
});
},
style: TextButton.styleFrom(
@ -229,13 +229,7 @@ class _DetailsState extends State<Details> {
),
],
),
SizedBox(height: 150.adaptedPx()),
// CustomButton(
// name: 'add_to_cart',
// onTap: () {},
// backgroundColor: AppTheme.lightPrimaryColor,
// isMain: true,
// ),
const Spacer(),
InkWell(
splashColor: AppTheme.lightPrimaryColor.withOpacity(0.2),
highlightColor:
@ -259,31 +253,6 @@ class _DetailsState extends State<Details> {
),
);
},
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 1.adaptedPx(),
color: AppTheme.lightPrimaryColor,
),
borderRadius: BorderRadius.circular(15.adaptedPx()),
),
padding: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Text(
'add_to_cart'.translation,
textAlign: TextAlign.center,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.lightPrimaryColor,
),
),
),
),
SizedBox(height: 10.adaptedPx()),
],

View File

@ -44,13 +44,13 @@ class _SapalyDrawerState extends State<SapalyDrawer> {
];
List<String> iconNames = [
'Home',
'Categories',
'About us',
'Sales',
'New arrival',
'Shops',
'Contacts',
'home',
'categories',
'about_us',
'sales',
'new_arrival',
'shops',
'contacts',
'settings'
];
@ -142,6 +142,7 @@ class _SapalyDrawerState extends State<SapalyDrawer> {
onTap: () async {
var lang =
await languagePicker(context, settings.currentLanguage);
if (lang != null) {
await settings.setLanguage(lang);
}
@ -153,11 +154,14 @@ class _SapalyDrawerState extends State<SapalyDrawer> {
hasBadge: false,
child: SvgPicture.asset('assets/icons/lang.svg'),
),
SizedBox(width: 10.adaptedPx()),
Text(
'En',
settings.currentLanguage == 'tk'
? 'TM'
: settings.currentLanguage.toUpperCase(),
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
fontSize: 13.adaptedPx(),
),

View File

@ -9,6 +9,7 @@ import 'package:sapaly_shop/models/settings_model.dart';
import 'package:sapaly_shop/providers/user_provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../constants/modals.dart';
import '../../../themes/app_theme.dart';
class SettingsScreen extends StatefulWidget {
@ -22,6 +23,7 @@ class _ProfileScreenState extends State<SettingsScreen> {
@override
Widget build(BuildContext context) {
var me = Provider.of<UserProvider>(context, listen: false);
SettingsModel settings = Provider.of<SettingsModel>(context, listen: true);
final GlobalKey<ScaffoldState> _key = GlobalKey();
String email = 'demir.at@gmail.com';
return Scaffold(
@ -45,7 +47,7 @@ class _ProfileScreenState extends State<SettingsScreen> {
horizontal: 15.adaptedPx(),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
me != null
? Container(
@ -142,7 +144,16 @@ class _ProfileScreenState extends State<SettingsScreen> {
splashColor: AppTheme.lightPrimaryColor.withOpacity(0.2),
highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(15.adaptedPx()),
onTap: () {},
onTap: () async {
var lang =
await languagePicker(context, settings.currentLanguage);
if (lang != null) {
await settings.setLanguage(lang);
// ignore: use_build_context_synchronously
Navigator.of(context, rootNavigator: true)
.pushNamedAndRemoveUntil('/home', (route) => false);
}
},
child: Container(
decoration: BoxDecoration(
border: Border.all(

View File

@ -51,7 +51,7 @@ class ProductCard extends StatelessWidget {
errorWidget: (context, url, error) => Container(
height: GlobalVariables.deviceHeight(context) / 7,
),
height: GlobalVariables.deviceHeight(context) / 7,
height: GlobalVariables.deviceHeight(context) / 8,
width: double.infinity,
),
),
@ -114,7 +114,7 @@ class ProductCard extends StatelessWidget {
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.adaptedPx()),
padding: EdgeInsets.symmetric(horizontal: 5.adaptedPx()),
child: Align(
alignment: Alignment.centerLeft,
child: Text(

View File

@ -11,6 +11,15 @@
"register":"Register",
"your_phone_number":"Your phone number",
"repeat_password":"Repeat password",
"repeat_password_to_confirm":"Repeat password to confirm"
"repeat_password_to_confirm":"Repeat password to confirm",
"add_to_cart":"Add to cart",
"home":"Home",
"about_us":"About us",
"sales":"Sales",
"new_arrival":"New arrival",
"shops":"My purchases",
"contacts":"Contacts",
"settings":"Settings",
"currentLang":"Language"
}

View File

@ -11,5 +11,14 @@
"register":"Регистрация",
"your_phone_number":"Ваш номер телефона",
"repeat_password":"Повторите пароль",
"repeat_password_to_confirm":"Повторите пароль для подтверждения"
"repeat_password_to_confirm":"Повторите пароль для подтверждения",
"add_to_cart":"Добавить в корзину",
"home":"Главная",
"about_us":"О нас",
"sales":"Продажи",
"new_arrival":"Новое поступление",
"shops":"Мои покупки",
"contacts":"Контакты",
"settings":"Настройки",
"currentLang":"Язык"
}

View File

@ -12,4 +12,13 @@
"your_phone_number":"Siziň telefon belgiňiz",
"repeat_password":"Açar sözi gaýtalaň",
"repeat_password_to_confirm":"Açar sözi tassyklamak üçin gaýtalaň",
"add_to_cart":"Sebede goş",
"home":"Esasy sahypa",
"about_us":"Biz barada",
"sales":"Satuwlar",
"new_arrival":"Täze harytlar",
"shops":"Meniň satyn almalarym",
"contacts":"Habarlaşmak",
"settings":"Sazlamalar",
"currentLang":"Dili saýlaň"
}

View File

@ -5,7 +5,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
const kDefaultLanguage = 'tk';
const kDefaultLanguage = 'ru';
class SettingsModel extends ChangeNotifier {
String _language = kDefaultLanguage;
@ -73,6 +73,15 @@ extension LocalMessageExt on String {
"repeat_password": SettingsModel._localization?.repeat_password,
"repeat_password_to_confirm":
SettingsModel._localization?.repeat_password_to_confirm,
"add_to_cart": SettingsModel._localization?.add_to_cart,
"home": SettingsModel._localization?.home,
"about_us": SettingsModel._localization?.about_us,
"sales": SettingsModel._localization?.sales,
"new_arrival": SettingsModel._localization?.new_arrival,
"shops": SettingsModel._localization?.shops,
"contacts": SettingsModel._localization?.contacts,
"settings": SettingsModel._localization?.settings,
"currentLang": SettingsModel._localization?.currentLang,
}[this] ??
this;
}