From 0b13921e654dedb92bb2151e1c1963ca367768c8 Mon Sep 17 00:00:00 2001 From: parkyuhyeon Date: Thu, 10 Jul 2025 20:10:03 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:lipstick:=20::=20Base=20Appbar=20=ED=8D=BC?= =?UTF-8?q?=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/config/widget/base_appbar.dart | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/core/config/widget/base_appbar.dart diff --git a/lib/core/config/widget/base_appbar.dart b/lib/core/config/widget/base_appbar.dart new file mode 100644 index 0000000..a014f1c --- /dev/null +++ b/lib/core/config/widget/base_appbar.dart @@ -0,0 +1,50 @@ +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? 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: IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: JusicoolIcon.backArrow( + width: 24.w, + height: 24.h, + color: JusicoolColor.black, + ), + ), + actionsPadding: EdgeInsets.only(right: 24), + actions: actionWidgets ?? [], + ); + } + + @override + Size get preferredSize => Size.fromHeight(57.h); +} From 7304f4c764e9769153205830f90a320debf13dc1 Mon Sep 17 00:00:00 2001 From: parkyuhyeon Date: Thu, 10 Jul 2025 20:10:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:lipstick:=20::=20Base=20Scaffold=20?= =?UTF-8?q?=ED=8D=BC=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/config/widget/base_scaffold.dart | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/core/config/widget/base_scaffold.dart diff --git a/lib/core/config/widget/base_scaffold.dart b/lib/core/config/widget/base_scaffold.dart new file mode 100644 index 0000000..e2cb585 --- /dev/null +++ b/lib/core/config/widget/base_scaffold.dart @@ -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; +} From 1c440ad611eae4910fd01fe6add0cd3d82c0a8dc Mon Sep 17 00:00:00 2001 From: parkyuhyeon Date: Thu, 10 Jul 2025 20:23:09 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:recycle:=20::=20backButton=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/config/widget/base_appbar.dart | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/core/config/widget/base_appbar.dart b/lib/core/config/widget/base_appbar.dart index a014f1c..7bed75e 100644 --- a/lib/core/config/widget/base_appbar.dart +++ b/lib/core/config/widget/base_appbar.dart @@ -30,16 +30,19 @@ class BaseAppbar extends StatelessWidget implements PreferredSizeWidget { elevation: elevation, scrolledUnderElevation: 0.0, titleTextStyle: textStyle ?? JusicoolTypography.subTitle, - leading: IconButton( - onPressed: () { - Navigator.of(context).pop(); - }, - icon: JusicoolIcon.backArrow( - width: 24.w, - height: 24.h, - color: JusicoolColor.black, - ), - ), + 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 ?? [], );