D1APP-32 appbar fixed
This commit is contained in:
parent
c199785b98
commit
cb52525202
|
|
@ -14,11 +14,14 @@ class EditProfile extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DidvanScaffold(
|
||||
appBarData: AppBarData(),
|
||||
appBarData: AppBarData(title: 'ویرایش پروفایل'),
|
||||
slivers: [
|
||||
const SliverToBoxAdapter(
|
||||
const SliverPadding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: ProfilePhoto(),
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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: () {}),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ class DidvanAppBar extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final MediaQueryData d = MediaQuery.of(context);
|
||||
return AnimatedContainer(
|
||||
duration: DesignConfig.lowAnimationDuration,
|
||||
child: Padding(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: d.padding.top, right: 4, left: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
|
|
@ -24,6 +22,7 @@ class DidvanAppBar extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(width: 16),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (appBarData.title != null)
|
||||
DidvanText(
|
||||
|
|
@ -31,10 +30,15 @@ class DidvanAppBar extends StatelessWidget {
|
|||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class _DidvanScaffoldState extends State<DidvanScaffold> {
|
|||
body: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
backgroundColor: Theme.of(context).backgroundColor,
|
||||
automaticallyImplyLeading: false,
|
||||
pinned: true,
|
||||
flexibleSpace: DidvanAppBar(appBarData: widget.appBarData),
|
||||
|
|
|
|||
56
pubspec.lock
56
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"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue