diff --git a/assets/icons/drawerIcons/settings.svg b/assets/icons/drawerIcons/settings.svg new file mode 100644 index 0000000..503582b --- /dev/null +++ b/assets/icons/drawerIcons/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/lang.svg b/assets/icons/lang.svg new file mode 100644 index 0000000..91635eb --- /dev/null +++ b/assets/icons/lang.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/1.png b/assets/images/1.png deleted file mode 100644 index cdeb718..0000000 Binary files a/assets/images/1.png and /dev/null differ diff --git a/assets/images/2.jpg b/assets/images/2.jpg deleted file mode 100644 index bbd6c04..0000000 Binary files a/assets/images/2.jpg and /dev/null differ diff --git a/assets/images/3.jpg b/assets/images/3.jpg deleted file mode 100644 index ba02b2c..0000000 Binary files a/assets/images/3.jpg and /dev/null differ diff --git a/assets/images/banner.jpg b/assets/images/banner.jpg deleted file mode 100644 index 27161d8..0000000 Binary files a/assets/images/banner.jpg and /dev/null differ diff --git a/lib/common/custom_button.dart b/lib/common/custom_button.dart index abcdbaa..8267e9e 100644 --- a/lib/common/custom_button.dart +++ b/lib/common/custom_button.dart @@ -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(), ), ), ), diff --git a/lib/features/screens/details/details.dart b/lib/features/screens/details/details.dart index f619214..be2a35d 100644 --- a/lib/features/screens/details/details.dart +++ b/lib/features/screens/details/details.dart @@ -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
{ 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
{ 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()), + ], + ), ), ), ); diff --git a/lib/features/screens/drawer/sapaly_drawer.dart b/lib/features/screens/drawer/sapaly_drawer.dart index c17b784..516e9d3 100644 --- a/lib/features/screens/drawer/sapaly_drawer.dart +++ b/lib/features/screens/drawer/sapaly_drawer.dart @@ -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 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 iconNames = [ + 'Home', 'Categories', 'About us', 'Sales', 'New arrival', 'Shops', 'Contacts', + 'Settings' ]; List 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, diff --git a/lib/features/screens/settings/settings_screen.dart b/lib/features/screens/settings/settings_screen.dart new file mode 100644 index 0000000..bc96802 --- /dev/null +++ b/lib/features/screens/settings/settings_screen.dart @@ -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 createState() => _ProfileScreenState(); +} + +class _ProfileScreenState extends State { + @override + Widget build(BuildContext context) { + var me = Provider.of(context, listen: false); + final GlobalKey _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, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/features/widgets/sapaly_app_bar.dart b/lib/features/widgets/sapaly_app_bar.dart index 96cd787..e9d38c9 100644 --- a/lib/features/widgets/sapaly_app_bar.dart +++ b/lib/features/widgets/sapaly_app_bar.dart @@ -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, diff --git a/lib/main.dart b/lib/main.dart index 158e1fd..e9ef2c0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 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 { debugShowCheckedModeBanner: false, theme: AppTheme.appLightTheme, title: 'Sapaly Mahabat', - initialRoute: '/login', + initialRoute: '/home', onGenerateRoute: (settings) => generateRoute(settings), routes: { '/': (context) => const Dashboard(), @@ -61,6 +62,7 @@ class _MyAppState extends State { '/home': (context) => const HomeScreen(), '/category': (context) => const CategoryScreen(), '/login': (context) => LoginScreen(), + '/settings': (context) => const SettingsScreen(), }, localizationsDelegates: GlobalVariables.localizationsDelegate, supportedLocales: GlobalVariables.supportedLocales,