added settings screen

This commit is contained in:
meylis98 2023-03-09 13:29:03 +05:00
parent 9844a5cff4
commit c6dc8bce58
12 changed files with 526 additions and 203 deletions

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><svg fill="none" height="28" viewBox="0 0 28 28" width="28" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14 20C17.3137 20 20 17.3137 20 14C20 10.6863 17.3137 8 14 8C10.6863 8 8 10.6863 8 14C8 17.3137 10.6863 20 14 20ZM18 14C18 16.2091 16.2091 18 14 18C11.7909 18 10 16.2091 10 14C10 11.7909 11.7909 10 14 10C16.2091 10 18 11.7909 18 14Z" fill="black" fill-rule="evenodd"/><path clip-rule="evenodd" d="M0 12.9996V14.9996C0 16.5478 1.17261 17.822 2.67809 17.9826C2.80588 18.3459 2.95062 18.7011 3.11133 19.0473C2.12484 20.226 2.18536 21.984 3.29291 23.0916L4.70712 24.5058C5.78946 25.5881 7.49305 25.6706 8.67003 24.7531C9.1044 24.9688 9.55383 25.159 10.0163 25.3218C10.1769 26.8273 11.4511 28 12.9993 28H14.9993C16.5471 28 17.8211 26.8279 17.9821 25.3228C18.4024 25.175 18.8119 25.0046 19.2091 24.8129C20.3823 25.6664 22.0344 25.564 23.0926 24.5058L24.5068 23.0916C25.565 22.0334 25.6674 20.3813 24.814 19.2081C25.0054 18.8113 25.1757 18.4023 25.3234 17.9824C26.8282 17.8211 28 16.5472 28 14.9996V12.9996C28 11.452 26.8282 10.1782 25.3234 10.0169C25.1605 9.55375 24.9701 9.10374 24.7541 8.66883C25.6708 7.49189 25.5882 5.78888 24.5061 4.70681L23.0919 3.29259C21.9846 2.18531 20.2271 2.12455 19.0485 3.1103C18.7017 2.94935 18.3459 2.80441 17.982 2.67647C17.8207 1.17177 16.5468 0 14.9993 0H12.9993C11.4514 0 10.1773 1.17231 10.0164 2.6775C9.60779 2.8213 9.20936 2.98653 8.82251 3.17181C7.64444 2.12251 5.83764 2.16276 4.70782 3.29259L3.2936 4.7068C2.16377 5.83664 2.12352 7.64345 3.17285 8.82152C2.98737 9.20877 2.82199 9.60763 2.67809 10.0167C1.17261 10.1773 0 11.4515 0 12.9996ZM15.9993 3C15.9993 2.44772 15.5516 2 14.9993 2H12.9993C12.447 2 11.9993 2.44772 11.9993 3V3.38269C11.9993 3.85823 11.6626 4.26276 11.2059 4.39542C10.4966 4.60148 9.81974 4.88401 9.18495 5.23348C8.76836 5.46282 8.24425 5.41481 7.90799 5.07855L7.53624 4.70681C7.14572 4.31628 6.51256 4.31628 6.12203 4.7068L4.70782 6.12102C4.31729 6.51154 4.31729 7.14471 4.70782 7.53523L5.07958 7.90699C5.41584 8.24325 5.46385 8.76736 5.23451 9.18395C4.88485 9.8191 4.6022 10.4963 4.39611 11.2061C4.2635 11.6629 3.85894 11.9996 3.38334 11.9996H3C2.44772 11.9996 2 12.4474 2 12.9996V14.9996C2 15.5519 2.44772 15.9996 3 15.9996H3.38334C3.85894 15.9996 4.26349 16.3364 4.39611 16.7931C4.58954 17.4594 4.85042 18.0969 5.17085 18.6979C5.39202 19.1127 5.34095 19.6293 5.00855 19.9617L4.70712 20.2632C4.3166 20.6537 4.3166 21.2868 4.70712 21.6774L6.12134 23.0916C6.51186 23.4821 7.14503 23.4821 7.53555 23.0916L7.77887 22.8483C8.11899 22.5081 8.65055 22.4633 9.06879 22.7008C9.73695 23.0804 10.4531 23.3852 11.2059 23.6039C11.6626 23.7365 11.9993 24.1411 11.9993 24.6166V25C11.9993 25.5523 12.447 26 12.9993 26H14.9993C15.5516 26 15.9993 25.5523 15.9993 25V24.6174C15.9993 24.1418 16.3361 23.7372 16.7929 23.6046C17.5032 23.3985 18.1809 23.1157 18.8164 22.7658C19.233 22.5365 19.7571 22.5845 20.0934 22.9208L20.2642 23.0916C20.6547 23.4821 21.2879 23.4821 21.6784 23.0916L23.0926 21.6774C23.4831 21.2868 23.4831 20.6537 23.0926 20.2632L22.9218 20.0924C22.5855 19.7561 22.5375 19.232 22.7669 18.8154C23.1166 18.1802 23.3992 17.503 23.6053 16.7931C23.7379 16.3364 24.1425 15.9996 24.6181 15.9996H25C25.5523 15.9996 26 15.5519 26 14.9996V12.9996C26 12.4474 25.5523 11.9996 25 11.9996H24.6181C24.1425 11.9996 23.7379 11.6629 23.6053 11.2061C23.3866 10.4529 23.0817 9.73627 22.7019 9.06773C22.4643 8.64949 22.5092 8.11793 22.8493 7.77781L23.0919 7.53523C23.4824 7.14471 23.4824 6.51154 23.0919 6.12102L21.6777 4.7068C21.2872 4.31628 20.654 4.31628 20.2635 4.7068L19.9628 5.00748C19.6304 5.33988 19.1137 5.39096 18.6989 5.16979C18.0976 4.84915 17.4596 4.58815 16.7929 4.39467C16.3361 4.2621 15.9993 3.85752 15.9993 3.38187V3Z" fill="black" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

3
assets/icons/lang.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 4C12.6026 4.00394 13.2029 4.07436 13.79 4.21C13.6162 4.60239 13.3483 4.94587 13.01 5.21C12.79 5.38 12.55 5.52 12.31 5.67C11.5502 6.04408 10.9096 6.62234 10.46 7.34C9.96744 8.36657 9.75361 9.50466 9.84 10.64C9.84 12 9.84 12.8 8.89 13.51C7.52 14.58 5.43 13.98 4.13 13.44C4.04502 12.9647 4.00152 12.4829 4 12C4 9.87827 4.84286 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4ZM5 15.8C5.65344 15.9699 6.32492 16.0605 7 16.07C8.1296 16.1011 9.23641 15.7486 10.14 15.07C11.85 13.73 11.85 12.01 11.85 10.63C11.7742 9.83128 11.9014 9.02635 12.22 8.29C12.5094 7.89592 12.895 7.58261 13.34 7.38C13.6579 7.1942 13.9651 6.99054 14.26 6.77C14.8815 6.27912 15.364 5.63455 15.66 4.9C17.067 5.61986 18.2292 6.74032 19 8.12C17.57 8.32 15.54 8.79 15.14 10.65C15.0497 11.0944 15.0028 11.5465 15 12C15.0324 12.5069 14.9324 13.0134 14.71 13.47L14.61 13.64C13.96 14.72 13.23 15.95 14.22 17.64C14.34 17.85 14.47 18.05 14.6 18.25C14.8662 18.5574 15.0456 18.9302 15.12 19.33C14.1365 19.7635 13.0748 19.9915 12 20C10.5636 19.9928 9.15568 19.5991 7.92398 18.86C6.69228 18.121 5.68227 17.064 5 15.8ZM16.93 18.32C16.757 17.9207 16.5461 17.5389 16.3 17.18C16.19 17.02 16.08 16.86 15.98 16.69C15.59 16.01 15.73 15.69 16.36 14.69L16.46 14.52C16.8519 13.7721 17.0383 12.9335 17 12.09C16.999 11.7546 17.0291 11.4198 17.09 11.09C17.25 10.36 18.8 10.16 19.76 10.09C20.148 11.5985 20.0837 13.1878 19.5752 14.6601C19.0667 16.1324 18.1363 17.4225 16.9 18.37L16.93 18.32Z" fill="#5677FC"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

View File

@ -43,7 +43,7 @@ class CustomButton extends StatelessWidget {
name,
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
color: isMain ? AppTheme.whiteColor : AppTheme.blackColor,
fontSize: 14.adaptedPx(),
fontSize: 15.adaptedPx(),
),
),
),

View File

@ -2,7 +2,9 @@ import 'package:adaptix/adaptix.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:sapaly_shop/common/custom_button.dart';
import 'package:sapaly_shop/common/photo.dart';
import 'package:sapaly_shop/constants/utils.dart';
import 'package:sapaly_shop/features/services/page_navigator.dart';
import 'package:sapaly_shop/features/widgets/sapaly_app_bar.dart';
import 'package:sapaly_shop/models/details_model.dart';
@ -69,70 +71,41 @@ class _DetailsState extends State<Details> {
margin: EdgeInsets.symmetric(
horizontal: 20.adaptedPx(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()),
child: GestureDetector(
onTap: () {
PageNavigator(ctx: context)
.nextPage(page: PhotoScreen(widget.image));
},
child: ClipRRect(
borderRadius: BorderRadius.circular(16.adaptedPx()),
child: CachedNetworkImage(
imageUrl: widget.image,
width: double.infinity,
errorWidget: (context, url, error) => Center(
child: SizedBox(
height: 150.adaptedPx(),
child: const CircularProgressIndicator(
color: AppTheme.lightPrimaryColor,
child: ScrollConfiguration(
behavior: CustomScrollBehavior(),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()),
child: GestureDetector(
onTap: () {
PageNavigator(ctx: context)
.nextPage(page: PhotoScreen(widget.image));
},
child: ClipRRect(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(16.adaptedPx()),
child: CachedNetworkImage(
imageUrl: widget.image,
width: double.infinity,
errorWidget: (context, url, error) => Center(
child: SizedBox(
height: 150.adaptedPx(),
child: const CircularProgressIndicator(
color: AppTheme.lightPrimaryColor,
),
),
),
),
),
),
),
),
Align(
alignment: Alignment.centerLeft,
child: Text(
widget.description,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontWeight: FontWeight.w600,
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()),
child: Align(
Align(
alignment: Alignment.centerLeft,
child: Text(
widget.description,
textAlign: TextAlign.left,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontWeight: FontWeight.w500,
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
widget.price,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
@ -142,128 +115,130 @@ class _DetailsState extends State<Details> {
color: AppTheme.blackColor,
),
),
const Spacer(),
Container(
decoration: BoxDecoration(
color: AppTheme.whiteColor,
borderRadius: BorderRadius.circular(16.adaptedPx()),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () {
setState(() {
amount++;
});
},
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.adaptedPx()),
bottomLeft: Radius.circular(16.adaptedPx()),
),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
widget.description,
textAlign: TextAlign.left,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontWeight: FontWeight.w500,
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
child: Text(
'+',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.adaptedPx()),
child: Text(
amount.toString(),
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
TextButton(
onPressed: () {
setState(() {
amount--;
});
},
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.adaptedPx()),
bottomRight:
Radius.circular(16.adaptedPx()),
),
),
),
child: Text(
'-',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
],
),
),
],
),
const Spacer(),
MaterialButton(
onPressed: () {
var snackBar = SnackBar(
content: Text(
'Added to Card',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
),
),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
},
height: 50.adaptedPx(),
color: AppTheme.lightPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.adaptedPx())),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Icon(
Icons.shopping_cart,
color: AppTheme.whiteColor,
),
SizedBox(width: 10.adaptedPx()),
Text(
'Add to Cart',
widget.price,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
color: AppTheme.whiteColor,
fontWeight: FontWeight.w600,
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
const Spacer(),
Container(
decoration: BoxDecoration(
color: AppTheme.whiteColor,
borderRadius: BorderRadius.circular(16.adaptedPx()),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () {
setState(() {
amount++;
});
},
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.adaptedPx()),
bottomLeft:
Radius.circular(16.adaptedPx()),
),
),
),
child: Text(
'+',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.adaptedPx()),
child: Text(
amount.toString(),
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
TextButton(
onPressed: () {
setState(() {
amount--;
});
},
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.adaptedPx()),
bottomRight:
Radius.circular(16.adaptedPx()),
),
),
),
child: Text(
'-',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 18.adaptedPx(),
color: AppTheme.blackColor,
),
),
),
],
),
),
],
),
),
SizedBox(height: 20.adaptedPx()),
],
const Spacer(),
SizedBox(height: 10.adaptedPx()),
CustomButton(
name: 'add_to_cart',
onTap: () {},
backgroundColor: AppTheme.lightPrimaryColor,
isMain: true,
),
SizedBox(height: 20.adaptedPx()),
],
),
),
),
);

View File

@ -2,11 +2,15 @@ import 'package:adaptix/adaptix.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:sapaly_shop/features/screens/auth/login/login_screen.dart';
import 'package:sapaly_shop/features/screens/category/category_screen.dart';
import 'package:sapaly_shop/features/screens/drawer/contacts.dart';
import 'package:sapaly_shop/features/screens/drawer/new_arrival.dart';
import 'package:sapaly_shop/features/screens/drawer/sales.dart';
import 'package:sapaly_shop/features/screens/drawer/shops.dart';
import 'package:sapaly_shop/features/screens/home/home_screen.dart';
import 'package:sapaly_shop/features/screens/settings/settings_screen.dart';
import 'package:sapaly_shop/features/widgets/sapaly_icon.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../constants/global_variables.dart';
@ -17,30 +21,36 @@ class SapalyDrawer extends StatelessWidget {
SapalyDrawer({super.key});
List<String> icons = [
'assets/icons/drawerIcons/home.svg',
'assets/icons/drawerIcons/category.svg',
'assets/icons/drawerIcons/info.svg',
'assets/icons/drawerIcons/sale.svg',
'assets/icons/drawerIcons/car.svg',
'assets/icons/drawerIcons/shops.svg',
'assets/icons/drawerIcons/mail.svg',
'assets/icons/drawerIcons/settings.svg',
];
List<String> iconNames = [
'Home',
'Categories',
'About us',
'Sales',
'New arrival',
'Shops',
'Contacts',
'Settings'
];
List<Widget> routes = [
const HomeScreen(),
const CategoryScreen(),
const AboutUsScreen(),
const SalesScreen(),
const NewArrivalScreen(),
const ShopsScreen(),
const ContactsScreen(),
const SettingsScreen(),
];
@override
@ -77,40 +87,52 @@ class SapalyDrawer extends StatelessWidget {
],
),
),
Row(
children: [
Icon(
Icons.account_circle,
size: 35.adaptedPx(),
color: AppTheme.lightPrimaryColor,
),
SizedBox(width: 10.adaptedPx()),
Text(
'Aman Amanow',
softWrap: true,
maxLines: 2,
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
fontSize: 14.adaptedPx(),
),
),
IconButton(
onPressed: () {},
color: AppTheme.lightPrimaryColor,
icon: const Icon(Icons.sports_baseball_outlined),
),
Text(
'En',
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
color: AppTheme.blackColor,
fontSize: 16.adaptedPx(),
),
),
],
GestureDetector(
onTap: () {
showBottomSheet(
context: context,
builder: (context) => Container(
child: Text('Drawer'),
));
},
child: Row(
children: [
Icon(
Icons.account_circle,
size: 40.adaptedPx(),
color: AppTheme.lightPrimaryColor,
),
SizedBox(width: 10.adaptedPx()),
Text(
'Aman Amanow',
softWrap: true,
maxLines: 2,
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
fontSize: 15.adaptedPx(),
),
),
const Spacer(),
SapalyIcon(
onTap: () {},
width: 25.adaptedPx(),
height: 25.adaptedPx(),
hasBadge: false,
child: SvgPicture.asset('assets/icons/lang.svg'),
),
Text(
'En',
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
color: AppTheme.blackColor,
fontSize: 16.adaptedPx(),
),
),
],
),
),
ListView.builder(
shrinkWrap: true,

View File

@ -0,0 +1,320 @@
import 'package:adaptix/adaptix.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:sapaly_shop/common/custom_button.dart';
import 'package:sapaly_shop/constants/global_variables.dart';
import 'package:sapaly_shop/features/screens/drawer/sapaly_drawer.dart';
import 'package:sapaly_shop/features/widgets/sapaly_app_bar.dart';
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 '../../../themes/app_theme.dart';
class SettingsScreen extends StatefulWidget {
const SettingsScreen({super.key});
@override
State<SettingsScreen> createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<SettingsScreen> {
@override
Widget build(BuildContext context) {
var me = Provider.of<UserProvider>(context, listen: false);
final GlobalKey<ScaffoldState> _key = GlobalKey();
return Scaffold(
drawer: SapalyDrawer(),
backgroundColor: AppTheme.lightBackgroundColor,
key: _key,
appBar: SapalyAppBar(
hasActionButton: true,
title: 'settings'.translation,
badge: '2',
leadingButton: SvgPicture.asset('assets/icons/menu.svg'),
actionButton: SvgPicture.asset('assets/icons/cart.svg'),
leadingOnTap: () {
_key.currentState?.openDrawer();
},
actionOnTap: () {},
),
body: Container(
margin: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1.adaptedPx(),
color: AppTheme.lightTextColor.withOpacity(0.3),
),
borderRadius: BorderRadius.circular(15.adaptedPx()),
),
padding: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'info_about_user'.translation,
textAlign: TextAlign.start,
style:
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
Text(
'name:'.translation,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.lightPrimaryColor,
fontWeight: FontWeight.w600,
),
),
Text(
me.user.user.name,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
),
],
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
Text(
'phone:'.translation,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.lightPrimaryColor,
fontWeight: FontWeight.w600,
),
),
Text(
me.user.user.phone,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 13.adaptedPx(),
color: AppTheme.blackColor,
),
),
],
),
SizedBox(height: 15.adaptedPx()),
CustomButton(
name: 'edit',
onTap: () {},
backgroundColor: AppTheme.lightPrimaryColor,
isMain: true,
),
],
),
),
InkWell(
splashColor: AppTheme.lightPrimaryColor.withOpacity(0.2),
highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(15.adaptedPx()),
onTap: () {},
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 1.adaptedPx(),
color: AppTheme.lightTextColor.withOpacity(0.3),
),
borderRadius: BorderRadius.circular(15.adaptedPx()),
),
padding: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Row(
children: [
SvgPicture.asset('assets/icons/lang.svg'),
SizedBox(width: 10.adaptedPx()),
Text(
'language'.translation,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
),
),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1.adaptedPx(),
color: AppTheme.lightTextColor.withOpacity(0.3),
),
borderRadius: BorderRadius.circular(15.adaptedPx()),
),
padding: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
GestureDetector(
onTap: () {
launchUrlString('tel://+99361445445');
Navigator.of(context).pop();
},
child: const Icon(Icons.phone_outlined,
color: AppTheme.lightPrimaryColor),
),
SizedBox(width: 10.adaptedPx()),
Text(
'+993 61 445445',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
GestureDetector(
onTap: () {
launchUrlString('mailto://demir.at@gmail.com');
Navigator.of(context).pop();
},
child: const Icon(Icons.mail_outline,
color: AppTheme.lightPrimaryColor),
),
SizedBox(width: 10.adaptedPx()),
Text(
'demir.at@gmail.com',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
const Icon(Icons.map_outlined,
color: AppTheme.lightPrimaryColor),
SizedBox(width: 10.adaptedPx()),
Text(
'Ataturk 16 - 2',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
const Icon(Icons.access_time_outlined,
color: AppTheme.lightPrimaryColor),
SizedBox(width: 10.adaptedPx()),
Text(
'8:00 - 18:00',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
],
),
),
InkWell(
splashColor: AppTheme.lightPrimaryColor.withOpacity(0.2),
highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(15.adaptedPx()),
onTap: () {},
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 1.adaptedPx(),
color: AppTheme.lightTextColor.withOpacity(0.3),
),
borderRadius: BorderRadius.circular(15.adaptedPx()),
),
padding: EdgeInsets.symmetric(
vertical: 15.adaptedPx(),
horizontal: 15.adaptedPx(),
),
child: Row(
children: [
const Icon(Icons.info_outline,
color: AppTheme.lightPrimaryColor),
SizedBox(width: 10.adaptedPx()),
Text(
'about_us'.translation,
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
),
)
],
),
),
);
}
}

View File

@ -10,7 +10,7 @@ class SapalyAppBar extends StatelessWidget with PreferredSizeWidget {
required this.hasActionButton,
required this.title,
required this.actionButton,
required this.leadingButton,
this.leadingButton,
required this.leadingOnTap,
required this.actionOnTap,
required this.badge,
@ -18,7 +18,7 @@ class SapalyAppBar extends StatelessWidget with PreferredSizeWidget {
final bool hasActionButton;
final String title, badge;
final Widget leadingButton;
final Widget? leadingButton;
final void Function() leadingOnTap;
final void Function() actionOnTap;
final Widget actionButton;
@ -48,7 +48,7 @@ class SapalyAppBar extends StatelessWidget with PreferredSizeWidget {
width: 50.adaptedPx(),
onTap: leadingOnTap,
hasBadge: false,
child: leadingButton,
child: leadingButton!,
),
title: Text(
title,

View File

@ -7,6 +7,7 @@ import 'package:sapaly_shop/features/screens/dashboard/dashboard.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/auth/login/login_screen.dart';
import 'package:sapaly_shop/features/screens/settings/settings_screen.dart';
import 'package:sapaly_shop/features/services/auth_service.dart';
import 'package:sapaly_shop/providers/user_provider.dart';
import 'package:sapaly_shop/router.dart';
@ -19,7 +20,7 @@ import 'models/settings_model.dart';
Future<void> main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
Future.delayed(const Duration(seconds: 3));
SharedPreferences prefs = await SharedPreferences.getInstance();
await SettingsModel.initLocalization(
prefs.getString('language') ?? kDefaultLanguage);
@ -53,7 +54,7 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false,
theme: AppTheme.appLightTheme,
title: 'Sapaly Mahabat',
initialRoute: '/login',
initialRoute: '/home',
onGenerateRoute: (settings) => generateRoute(settings),
routes: <String, WidgetBuilder>{
'/': (context) => const Dashboard(),
@ -61,6 +62,7 @@ class _MyAppState extends State<MyApp> {
'/home': (context) => const HomeScreen(),
'/category': (context) => const CategoryScreen(),
'/login': (context) => LoginScreen(),
'/settings': (context) => const SettingsScreen(),
},
localizationsDelegates: GlobalVariables.localizationsDelegate,
supportedLocales: GlobalVariables.supportedLocales,