D1APP-32 appbar fixed
This commit is contained in:
parent
c199785b98
commit
cb52525202
|
|
@ -14,10 +14,13 @@ class EditProfile extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return DidvanScaffold(
|
return DidvanScaffold(
|
||||||
appBarData: AppBarData(),
|
appBarData: AppBarData(title: 'ویرایش پروفایل'),
|
||||||
slivers: [
|
slivers: [
|
||||||
const SliverToBoxAdapter(
|
const SliverPadding(
|
||||||
child: ProfilePhoto(),
|
padding: EdgeInsets.only(top: 16),
|
||||||
|
sliver: SliverToBoxAdapter(
|
||||||
|
child: ProfilePhoto(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class Profile extends StatelessWidget {
|
||||||
MenuItem(
|
MenuItem(
|
||||||
title: 'تنظیمات',
|
title: 'تنظیمات',
|
||||||
icon: DidvanIcons.setting_regular,
|
icon: DidvanIcons.setting_regular,
|
||||||
onTap: () => {},
|
onTap: () => Navigator.of(context).pushNamed(Routes.settings),
|
||||||
),
|
),
|
||||||
const DidvanDivider(),
|
const DidvanDivider(),
|
||||||
MenuItem(
|
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.dart';
|
||||||
import 'package:didvan/pages/home/home_state.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/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.dart';
|
||||||
import 'package:didvan/pages/splash/splash_state.dart';
|
import 'package:didvan/pages/splash/splash_state.dart';
|
||||||
import 'package:didvan/routes/routes.dart';
|
import 'package:didvan/routes/routes.dart';
|
||||||
|
|
@ -37,6 +38,10 @@ class RouteGenerator {
|
||||||
return _createRoute(
|
return _createRoute(
|
||||||
const EditProfile(),
|
const EditProfile(),
|
||||||
);
|
);
|
||||||
|
case Routes.settings:
|
||||||
|
return _createRoute(
|
||||||
|
const Settings(),
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return _errorRoute();
|
return _errorRoute();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@ class Routes {
|
||||||
static const String authenticaion = '/authentication';
|
static const String authenticaion = '/authentication';
|
||||||
static const String profile = '/profile';
|
static const String profile = '/profile';
|
||||||
static const String editProfile = '/edit-profile';
|
static const String editProfile = '/edit-profile';
|
||||||
|
static const String settings = '/settings';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,30 +11,34 @@ class DidvanAppBar extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final MediaQueryData d = MediaQuery.of(context);
|
final MediaQueryData d = MediaQuery.of(context);
|
||||||
return AnimatedContainer(
|
return Padding(
|
||||||
duration: DesignConfig.lowAnimationDuration,
|
padding: EdgeInsets.only(top: d.padding.top, right: 4, left: 20),
|
||||||
child: Padding(
|
child: Row(
|
||||||
padding: EdgeInsets.only(top: d.padding.top, right: 4, left: 20),
|
children: [
|
||||||
child: Row(
|
IconButton(
|
||||||
children: [
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
IconButton(
|
color: Theme.of(context).colorScheme.title,
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
icon: const Icon(Icons.arrow_back),
|
||||||
color: Theme.of(context).colorScheme.title,
|
),
|
||||||
icon: const Icon(Icons.arrow_back),
|
const SizedBox(width: 16),
|
||||||
),
|
Column(
|
||||||
const SizedBox(width: 16),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Column(
|
children: [
|
||||||
children: [
|
if (appBarData.title != null)
|
||||||
if (appBarData.title != null)
|
DidvanText(
|
||||||
DidvanText(
|
appBarData.title!,
|
||||||
appBarData.title!,
|
style: Theme.of(context).textTheme.headline3,
|
||||||
style: Theme.of(context).textTheme.headline3,
|
color: Theme.of(context).colorScheme.title,
|
||||||
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(
|
body: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
flexibleSpace: DidvanAppBar(appBarData: widget.appBarData),
|
flexibleSpace: DidvanAppBar(appBarData: widget.appBarData),
|
||||||
|
|
|
||||||
56
pubspec.lock
56
pubspec.lock
|
|
@ -43,6 +43,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.15.0"
|
||||||
|
cross_file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cross_file
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.2"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -81,11 +88,23 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
graphs:
|
graphs:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -114,6 +133,27 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
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:
|
intl:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -121,6 +161,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.17.0"
|
version: "0.17.0"
|
||||||
|
js:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: js
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.3"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -163,6 +210,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.3.0"
|
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:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -240,4 +294,4 @@ packages:
|
||||||
version: "2.1.1"
|
version: "2.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.14.0 <3.0.0"
|
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
|
pin_code_fields: ^7.3.0
|
||||||
rive: ^0.7.33
|
rive: ^0.7.33
|
||||||
hive: ^2.0.5
|
hive: ^2.0.5
|
||||||
|
image_picker: ^0.8.4+4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue