Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor use generic app bar over all app screens ✅ #238

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:monumento/presentation/profile_screen/desktop/widgets/user_detai
import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/constants.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class DiscoverProfileViewDesktop extends StatefulWidget {
final UserEntity user;
Expand All @@ -34,8 +35,7 @@ class _DiscoverProfileViewDesktopState
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
appBar: CustomMobileAppBar(
elevation: 0,
leading: IconButton(
icon: const Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/app_text_styles.dart';
import 'package:monumento/utils/constants.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class DiscoverProfileViewMobile extends StatefulWidget {
final UserEntity user;
Expand Down Expand Up @@ -41,26 +42,18 @@ class _DiscoverProfileViewMobileState extends State<DiscoverProfileViewMobile>
Widget build(BuildContext context) {
List<PostEntity> posts = [];
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
leading: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: const Icon(
Icons.arrow_back,
color: AppColor.appBlack,
),
appBar: CustomMobileAppBar(
logoPath: Assets.mobile.logoProfile.path,
leading: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: const Icon(
Icons.arrow_back,
color: AppColor.appBlack,
),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Assets.mobile.logoProfile.svg(
height: 25,
width: 161,
),
],
)),
),
),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
41 changes: 20 additions & 21 deletions lib/presentation/discover/mobile/discover_view_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/app_text_styles.dart';
import 'package:monumento/utils/constants.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';
import 'package:monumento/utils/debouncer.dart';

class DiscoverViewMobile extends StatefulWidget {
Expand Down Expand Up @@ -205,28 +206,26 @@ class _DiscoverViewMobileState extends State<DiscoverViewMobile> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
title:
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Assets.mobile.logoDiscover.svg(
height: 25,
width: 161,
appBar: CustomMobileAppBar(
logoPath: Assets.mobile.logoDiscover.path,
actions: [
IconButton(
icon: const Icon(
Icons.notifications_outlined,
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) {
return const NotificationViewDesktop();
},
),
);
},
icon: const Icon(Icons.notifications_outlined,
color: AppColor.appBlack)),
])),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) {
return const NotificationViewDesktop();
},
),
);
},
),
],
),
body: CompositedTransformTarget(
link: layerLink,
child: BlocBuilder<DiscoverPostsBloc, DiscoverPostsState>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:monumento/domain/entities/post_entity.dart';
import 'package:monumento/gen/assets.gen.dart';
import 'package:monumento/presentation/feed/mobile/widgets/feed_post_card_mobile.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class DiscoverPostDetailsView extends StatelessWidget {
final PostEntity post;
Expand All @@ -12,21 +12,16 @@ class DiscoverPostDetailsView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
appBar: CustomMobileAppBar(
logoPath: Assets.mobile.logoDiscover.path,
leading: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: const Icon(
Icons.arrow_back,
color: AppColor.appBlack,
),
),
title: SvgPicture.asset(
Assets.mobile.logoDiscover.path,
height: 25,
width: 161,
onPressed: () {
Navigator.pop(context);
},
),
),
body: PageView(
Expand Down
44 changes: 20 additions & 24 deletions lib/presentation/feed/mobile/your_feed_view_mobile.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:monumento/application/feed/feed_bloc.dart';
import 'package:monumento/domain/entities/post_entity.dart';
import 'package:monumento/gen/assets.gen.dart';
import 'package:monumento/presentation/feed/mobile/widgets/feed_post_card_mobile.dart';
import 'package:monumento/presentation/notification/desktop/notification_view_desktop.dart';
import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class YourFeedViewMobile extends StatefulWidget {
const YourFeedViewMobile({super.key});
Expand Down Expand Up @@ -39,29 +38,26 @@ class _YourFeedViewMobileState extends State<YourFeedViewMobile> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
title:
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
SvgPicture.asset(
Assets.mobile.logoFeed.path,
height: 25,
width: 161,
appBar: CustomMobileAppBar(
logoPath: Assets.mobile.logoFeed.path,
actions: [
IconButton(
icon: Icon(
Icons.notifications_outlined,
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) {
return const NotificationViewDesktop();
},
),
);
},
icon: const Icon(Icons.notifications_outlined,
color: AppColor.appBlack)),
])),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) {
return const NotificationViewDesktop();
},
),
);
},
),
],
),
body: BlocBuilder<FeedBloc, FeedState>(
bloc: locator<FeedBloc>(),
builder: (context, state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:monumento/domain/entities/notification_entity.dart';
import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/constants.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';
import 'package:monumento/utils/enums.dart';
import 'package:timeago/timeago.dart' as timeago;

Expand All @@ -29,8 +30,7 @@ class _NotificationViewDesktopState extends State<NotificationViewDesktop> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.appBackground,
appBar: CustomMobileAppBar(
elevation: 0,
leading: IconButton(
icon: const Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:model_viewer_plus/model_viewer_plus.dart';
import 'package:monumento/domain/entities/monument_entity.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class MonumentModelViewDesktop extends StatefulWidget {
final MonumentEntity monument;
Expand All @@ -22,12 +23,7 @@ class _MonumentModelViewDesktopState extends State<MonumentModelViewDesktop> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
widget.monument.name,
style: TextStyle(color: AppColor.appBlack),
),
backgroundColor: AppColor.appWhite,
appBar: CustomMobileAppBar(
elevation: 0,
leading: IconButton(
icon: const Icon(
Expand All @@ -38,6 +34,12 @@ class _MonumentModelViewDesktopState extends State<MonumentModelViewDesktop> {
Navigator.of(context).pop();
},
),
actions: [
Text(
widget.monument.name,
style: TextStyle(color: AppColor.appBlack),
),
],
),
body: ModelViewer(
backgroundColor: const Color.fromARGB(0xFF, 0xEE, 0xEE, 0xEE),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:model_viewer_plus/model_viewer_plus.dart';
import 'package:monumento/domain/entities/monument_entity.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class MonumentModelViewMobile extends StatefulWidget {
final MonumentEntity monument;
Expand All @@ -15,8 +16,15 @@ class _MonumentModelViewMobileState extends State<MonumentModelViewMobile> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.monument.name),
// appBar: AppBar(
// title: Text(widget.monument.name),
// ),
appBar: CustomMobileAppBar(
actions: [
Text(
widget.monument.name,
),
],
),
body: Center(
child: ModelViewer(
Expand All @@ -32,6 +40,3 @@ class _MonumentModelViewMobileState extends State<MonumentModelViewMobile> {
);
}
}



Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:monumento/application/popular_monuments/monument_3d_model/monument_3d_model_bloc.dart';
import 'package:monumento/presentation/popular_monuments/mobile/widgets/popular_monument_view_mobile_app_bar.dart';
import 'package:monumento/gen/assets.gen.dart';
import 'package:monumento/presentation/notification/desktop/notification_view_desktop.dart';
import 'package:monumento/presentation/popular_monuments/mobile/widgets/populat_monuments_view_body_mobile.dart';
import 'package:monumento/presentation/popular_monuments/mobile/widgets/scan_monuments_screen.dart';
import 'package:monumento/service_locator.dart';
import 'package:monumento/utils/app_colors.dart';
import 'package:monumento/utils/app_text_styles.dart';
import 'package:monumento/utils/custom_mobile_appBar.dart';

class PopularMonumentsViewMobile extends StatefulWidget {
const PopularMonumentsViewMobile({super.key});
Expand All @@ -27,7 +29,26 @@ class _PopularMonumentsViewMobileState
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PopularMonumnetsViewMobileAppBar(),
appBar: CustomMobileAppBar(
logoPath: Assets.desktop.logoDesktop.path,
actions: [
IconButton(
icon: const Icon(
Icons.notifications_outlined,
),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) {
return const NotificationViewDesktop();
},
),
);
},
),
],
),
body: PopularMonumentsViewMobileBodyBlocBuilder(),
floatingActionButton: FloatingActionButton.extended(
onPressed: () async {
Expand Down
Loading