diff --git a/lib/pages/home/profile/edit_profile/edit_profile.dart b/lib/pages/home/profile/edit_profile/edit_profile.dart index 06caf69..1bd7628 100644 --- a/lib/pages/home/profile/edit_profile/edit_profile.dart +++ b/lib/pages/home/profile/edit_profile/edit_profile.dart @@ -14,10 +14,13 @@ class EditProfile extends StatelessWidget { @override Widget build(BuildContext context) { return DidvanScaffold( - appBarData: AppBarData(), + appBarData: AppBarData(title: 'ویرایش پروفایل'), slivers: [ - const SliverToBoxAdapter( - child: ProfilePhoto(), + const SliverPadding( + padding: EdgeInsets.only(top: 16), + sliver: SliverToBoxAdapter( + child: ProfilePhoto(), + ), ), SliverPadding( padding: const EdgeInsets.all(16), diff --git a/lib/pages/home/profile/profile.dart b/lib/pages/home/profile/profile.dart index fa74059..d6fc48c 100644 --- a/lib/pages/home/profile/profile.dart +++ b/lib/pages/home/profile/profile.dart @@ -39,7 +39,7 @@ class Profile extends StatelessWidget { MenuItem( title: 'تنظیمات', icon: DidvanIcons.setting_regular, - onTap: () => {}, + onTap: () => Navigator.of(context).pushNamed(Routes.settings), ), const DidvanDivider(), MenuItem( diff --git a/lib/pages/home/profile/settings/settings.dart b/lib/pages/home/profile/settings/settings.dart new file mode 100644 index 0000000..e445f8a --- /dev/null +++ b/lib/pages/home/profile/settings/settings.dart @@ -0,0 +1,23 @@ +import 'package:didvan/models/view/app_bar_data.dart'; +import 'package:didvan/pages/home/profile/widgets/menu_item.dart'; +import 'package:didvan/widgets/didvan/card.dart'; +import 'package:didvan/widgets/didvan/scaffold.dart'; +import 'package:flutter/material.dart'; + +class Settings extends StatelessWidget { + const Settings({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return DidvanScaffold( + appBarData: AppBarData(hasBack: true, title: 'تنظیمات'), + slivers: [ + SliverToBoxAdapter( + child: DidvanCard( + child: MenuItem(title: 'زمان دریافت اعلان', onTap: () {}), + ), + ), + ], + ); + } +} diff --git a/lib/routes/route_generator.dart b/lib/routes/route_generator.dart index 581c2bb..4fdba0a 100644 --- a/lib/routes/route_generator.dart +++ b/lib/routes/route_generator.dart @@ -3,6 +3,7 @@ import 'package:didvan/pages/authentication/authentication_state.dart'; import 'package:didvan/pages/home/home.dart'; import 'package:didvan/pages/home/home_state.dart'; import 'package:didvan/pages/home/profile/edit_profile/edit_profile.dart'; +import 'package:didvan/pages/home/profile/settings/settings.dart'; import 'package:didvan/pages/splash/splash.dart'; import 'package:didvan/pages/splash/splash_state.dart'; import 'package:didvan/routes/routes.dart'; @@ -37,6 +38,10 @@ class RouteGenerator { return _createRoute( const EditProfile(), ); + case Routes.settings: + return _createRoute( + const Settings(), + ); default: return _errorRoute(); } diff --git a/lib/routes/routes.dart b/lib/routes/routes.dart index 27e2f8f..92fbf3e 100644 --- a/lib/routes/routes.dart +++ b/lib/routes/routes.dart @@ -4,4 +4,5 @@ class Routes { static const String authenticaion = '/authentication'; static const String profile = '/profile'; static const String editProfile = '/edit-profile'; + static const String settings = '/settings'; } diff --git a/lib/widgets/didvan/app_bar.dart b/lib/widgets/didvan/app_bar.dart index 16e42fd..c14902d 100644 --- a/lib/widgets/didvan/app_bar.dart +++ b/lib/widgets/didvan/app_bar.dart @@ -11,30 +11,34 @@ class DidvanAppBar extends StatelessWidget { @override Widget build(BuildContext context) { final MediaQueryData d = MediaQuery.of(context); - return AnimatedContainer( - duration: DesignConfig.lowAnimationDuration, - child: Padding( - padding: EdgeInsets.only(top: d.padding.top, right: 4, left: 20), - child: Row( - children: [ - IconButton( - onPressed: () => Navigator.of(context).pop(), - color: Theme.of(context).colorScheme.title, - icon: const Icon(Icons.arrow_back), - ), - const SizedBox(width: 16), - Column( - children: [ - if (appBarData.title != null) - DidvanText( - appBarData.title!, - style: Theme.of(context).textTheme.headline3, - color: Theme.of(context).colorScheme.title, - ), - ], - ), - ], - ), + return Padding( + padding: EdgeInsets.only(top: d.padding.top, right: 4, left: 20), + child: Row( + children: [ + IconButton( + onPressed: () => Navigator.of(context).pop(), + color: Theme.of(context).colorScheme.title, + icon: const Icon(Icons.arrow_back), + ), + const SizedBox(width: 16), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (appBarData.title != null) + DidvanText( + appBarData.title!, + style: Theme.of(context).textTheme.headline3, + color: Theme.of(context).colorScheme.title, + ), + if (appBarData.subtitle != null) + DidvanText( + appBarData.title!, + style: Theme.of(context).textTheme.overline, + color: Theme.of(context).colorScheme.caption, + ), + ], + ), + ], ), ); } diff --git a/lib/widgets/didvan/scaffold.dart b/lib/widgets/didvan/scaffold.dart index 3836413..450b1d2 100644 --- a/lib/widgets/didvan/scaffold.dart +++ b/lib/widgets/didvan/scaffold.dart @@ -33,6 +33,7 @@ class _DidvanScaffoldState extends State { body: CustomScrollView( slivers: [ SliverAppBar( + backgroundColor: Theme.of(context).backgroundColor, automaticallyImplyLeading: false, pinned: true, flexibleSpace: DidvanAppBar(appBarData: widget.appBarData), diff --git a/pubspec.lock b/pubspec.lock index 91d1327..e771f17 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -43,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + cross_file: + dependency: transitive + description: + name: cross_file + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" crypto: dependency: transitive description: @@ -81,11 +88,23 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" graphs: dependency: transitive description: @@ -114,6 +133,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.4+4" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" intl: dependency: transitive description: @@ -121,6 +161,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.17.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" lints: dependency: transitive description: @@ -163,6 +210,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.3.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" provider: dependency: "direct main" description: @@ -240,4 +294,4 @@ packages: version: "2.1.1" sdks: dart: ">=2.14.0 <3.0.0" - flutter: ">=1.16.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2d58c87..aac10b9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: pin_code_fields: ^7.3.0 rive: ^0.7.33 hive: ^2.0.5 + image_picker: ^0.8.4+4 dev_dependencies: flutter_test: