-
Notifications
You must be signed in to change notification settings - Fork 0
๐ :: (#34) Base Scaffold, Base Appbar ํผ๋ธ๋ฆฌ์ฑ #35
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
Merged
iloveuhyeon
merged 3 commits into
develop
from
feature/#34-publishing-base-scaffold-and-base-appbar
Jul 10, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| import 'package:jusicool_design_system/jusicool_design_system.dart'; | ||
|
|
||
| class BaseAppbar extends StatelessWidget implements PreferredSizeWidget { | ||
| const BaseAppbar({ | ||
| super.key, | ||
| this.title = '', | ||
| this.centerTitle = true, | ||
| this.textStyle, | ||
| this.backgroundColor, | ||
| this.actionWidgets, | ||
| this.backButton = false, | ||
| }); | ||
|
|
||
| final String title; | ||
| final bool centerTitle; | ||
| final TextStyle? textStyle; | ||
| final Color? backgroundColor; | ||
| final bool backButton; | ||
| final List<Widget>? actionWidgets; | ||
| final double elevation = 0.0; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return AppBar( | ||
| title: Text(title), | ||
| centerTitle: centerTitle, | ||
| backgroundColor: backgroundColor ?? JusicoolColor.white, | ||
| elevation: elevation, | ||
| scrolledUnderElevation: 0.0, | ||
| titleTextStyle: textStyle ?? JusicoolTypography.subTitle, | ||
| leading: | ||
| backButton | ||
| ? IconButton( | ||
| onPressed: () { | ||
| Navigator.of(context).pop(); | ||
| }, | ||
| icon: JusicoolIcon.backArrow( | ||
| width: 24.w, | ||
| height: 24.h, | ||
| color: JusicoolColor.black, | ||
| ), | ||
| ) | ||
| : null, | ||
| actionsPadding: EdgeInsets.only(right: 24), | ||
| actions: actionWidgets ?? [], | ||
| ); | ||
| } | ||
|
|
||
| @override | ||
| Size get preferredSize => Size.fromHeight(57.h); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
|
||
| abstract class BaseScaffold extends ConsumerWidget { | ||
| const BaseScaffold({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context, WidgetRef ref) { | ||
| return Scaffold( | ||
| backgroundColor: backgroundColor, | ||
| resizeToAvoidBottomInset: resizeToAvoidBottomInset, | ||
| appBar: buildAppBar(context, ref), | ||
| body: | ||
| useSafeArea | ||
| ? SafeArea( | ||
| top: setTopSafeArea, | ||
| bottom: setBottomSafeArea, | ||
| child: buildBody(context, ref), | ||
| ) | ||
| : buildBody(context, ref), | ||
| bottomNavigationBar: buildBottomNavigationBar(context, ref), | ||
| ); | ||
| } | ||
|
|
||
| @protected | ||
| Color get backgroundColor => Colors.white; | ||
|
|
||
| @protected | ||
| bool get resizeToAvoidBottomInset => true; | ||
|
|
||
| @protected | ||
| bool get useSafeArea => true; | ||
|
|
||
| @protected | ||
| bool get setBottomSafeArea => true; | ||
|
|
||
| @protected | ||
| bool get setTopSafeArea => true; | ||
|
|
||
| @protected | ||
| PreferredSizeWidget? buildAppBar(BuildContext context, WidgetRef ref) => null; | ||
|
|
||
| @protected | ||
| Widget buildBody(BuildContext context, WidgetRef ref); | ||
|
|
||
| @protected | ||
| Widget? buildBottomNavigationBar(BuildContext context, WidgetRef ref) => null; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Use responsive padding with ScreenUtil (e.g.,
EdgeInsets.only(right: 24.w)) to maintain consistency across screen sizes.