Skip to content

Commit

Permalink
Feat: home, friend screen + Mission Dialog UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ujaa committed May 15, 2023
1 parent 9ec1a74 commit 79e3530
Show file tree
Hide file tree
Showing 32 changed files with 1,573 additions and 470 deletions.
106 changes: 106 additions & 0 deletions lib/components/action_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import 'dart:ui';

import 'package:dagather_frontend/utilities/colors.dart';
import 'package:dagather_frontend/utilities/fonts.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ActionDialog extends StatelessWidget {
final String content;
final String buttonText;
final Color buttonColor;
final void Function() onPressed;

const ActionDialog(
{super.key,
required this.content,
required this.buttonText,
required this.buttonColor,
required this.onPressed});

@override
Widget build(BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
),
insetPadding: EdgeInsets.symmetric(horizontal: 50.w),
contentPadding:
EdgeInsets.only(right: 20.w, left: 20.w, top: 44.h, bottom: 36.h),
content: Text(content),
contentTextStyle: TextStyle(
fontFamily: pretendardFont,
fontSize: 15.sp,
height: 1.55,
fontVariations: const [
FontVariation('wght', 700),
],
color: AppColor.g900,
),
actionsPadding: EdgeInsets.only(right: 12.w, left: 12.w, bottom: 12.h),
actions: [
Row(
children: [
Flexible(
flex: 1,
fit: FlexFit.tight,
child: TextButton(
onPressed: () {
Navigator.of(context).pop();
},
style: TextButton.styleFrom(
backgroundColor: AppColor.g200,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8).r,
),
padding: EdgeInsets.symmetric(
vertical: 14.h,
),
),
child: Text(
"취소",
style: TextStyle(
fontFamily: pretendardFont,
fontSize: 13.sp,
fontVariations: const [
FontVariation('wght', 700),
],
color: AppColor.g700,
),
),
),
),
SizedBox(
width: 8.w,
),
Flexible(
flex: 2,
fit: FlexFit.tight,
child: TextButton(
onPressed: onPressed,
style: TextButton.styleFrom(
backgroundColor: buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8).r,
),
padding: EdgeInsets.symmetric(vertical: 14.h),
),
child: Text(
buttonText,
style: TextStyle(
fontFamily: pretendardFont,
fontSize: 13.sp,
fontVariations: const [
FontVariation('wght', 700),
],
color: AppColor.g900,
),
),
),
),
],
),
],
);
}
}
13 changes: 10 additions & 3 deletions lib/components/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';

class BaseAppBar extends StatelessWidget with PreferredSizeWidget {
final String appBarTitle;
final List<Widget>? actions;
final int height = 56;

BaseAppBar(this.appBarTitle, {Key? key}) : super(key: key);
BaseAppBar(this.appBarTitle, {super.key, this.actions});

@override
Widget build(BuildContext context) {
return AppBar(
toolbarHeight: 56.h,
actions: actions,
actionsIconTheme: IconThemeData(
color: AppColor.g800,
size: 24.w,
),
toolbarHeight: height.h,
iconTheme: const IconThemeData(
color: AppColor.g800,
),
Expand All @@ -34,5 +41,5 @@ class BaseAppBar extends StatelessWidget with PreferredSizeWidget {
}

@override
Size get preferredSize => Size.fromHeight(56.h);
Size get preferredSize => Size.fromHeight(height.h);
}
75 changes: 75 additions & 0 deletions lib/components/base_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import 'dart:ui';

import 'package:dagather_frontend/utilities/colors.dart';
import 'package:dagather_frontend/utilities/fonts.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class BaseDialog extends StatelessWidget {
final String content;
final String buttonText;
final void Function() onPressed;

const BaseDialog(
{super.key,
required this.content,
required this.buttonText,
required this.onPressed});

@override
Widget build(BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
),
insetPadding: EdgeInsets.symmetric(horizontal: 50.w),
contentPadding:
EdgeInsets.only(right: 20.w, left: 20.w, top: 44.h, bottom: 36.h),
content: Text(
content,
textAlign: TextAlign.center,
),
contentTextStyle: TextStyle(
fontFamily: pretendardFont,
fontSize: 15.sp,
height: 1.55,
fontVariations: const [
FontVariation('wght', 700),
],
color: AppColor.g900,
),
actionsPadding: EdgeInsets.only(right: 12.w, left: 12.w, bottom: 12.h),
actions: [
Row(
children: [
Expanded(
child: TextButton(
onPressed: onPressed,
style: TextButton.styleFrom(
backgroundColor: AppColor.g200,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8).r,
),
padding: EdgeInsets.symmetric(
vertical: 14.h,
),
),
child: Text(
buttonText,
style: TextStyle(
fontFamily: pretendardFont,
fontSize: 13.sp,
fontVariations: const [
FontVariation('wght', 700),
],
color: AppColor.g700,
),
),
),
),
],
),
],
);
}
}
44 changes: 44 additions & 0 deletions lib/components/base_medium_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'dart:ui';

import 'package:dagather_frontend/utilities/fonts.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class BaseMidiumButton extends StatelessWidget {
final Color textColor;
final Color backgroundColor;
final String text;
final void Function() onPressed;

const BaseMidiumButton(
{super.key,
required this.textColor,
required this.backgroundColor,
required this.text,
required this.onPressed});

@override
Widget build(BuildContext context) {
return TextButton(
onPressed: onPressed,
style: TextButton.styleFrom(
backgroundColor: backgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8).r,
),
padding: EdgeInsets.symmetric(vertical: 14.h, horizontal: 16.w),
),
child: Text(
text,
style: TextStyle(
fontFamily: pretendardFont,
fontSize: 14.sp,
fontVariations: const [
FontVariation('wght', 700),
],
color: textColor,
),
),
);
}
}
2 changes: 1 addition & 1 deletion lib/components/base_small_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BaseSmallButton extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8).r,
),
padding: EdgeInsets.symmetric(vertical: 14.h),
padding: EdgeInsets.symmetric(vertical: 12.h, horizontal: 16.w),
),
child: Text(
text,
Expand Down
52 changes: 52 additions & 0 deletions lib/components/information_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'dart:ui';

import 'package:dagather_frontend/utilities/colors.dart';
import 'package:dagather_frontend/utilities/fonts.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class InformationDialog extends StatelessWidget {
final String title;
final String content;

const InformationDialog({
super.key,
required this.title,
required this.content,
});

@override
Widget build(BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
),
insetPadding: EdgeInsets.symmetric(horizontal: 50.w),
title: Text(title),
titleTextStyle: TextStyle(
fontFamily: pretendardFont,
fontSize: 15.sp,
height: 1.55,
fontVariations: const [
FontVariation('wght', 800),
],
color: AppColor.g800,
),
titlePadding: EdgeInsets.only(right: 28.w, left: 28.w, top: 28.h),
contentPadding:
EdgeInsets.only(right: 28.w, left: 28.w, top: 4.h, bottom: 28.h),
content: Text(
content,
),
contentTextStyle: TextStyle(
fontFamily: pretendardFont,
fontSize: 15.sp,
height: 1.55,
fontVariations: const [
FontVariation('wght', 500),
],
color: AppColor.g700,
),
);
}
}
Loading

0 comments on commit 79e3530

Please sign in to comment.