Skip to content

Commit

Permalink
Merge branch 'release/2024-summer' into feature/dynamiclink
Browse files Browse the repository at this point in the history
  • Loading branch information
jwson-automation authored Aug 12, 2024
2 parents 83c3f8e + f9a24f8 commit 4d25c85
Show file tree
Hide file tree
Showing 89 changed files with 2,671 additions and 767 deletions.
3 changes: 3 additions & 0 deletions assets/icon/ic_down_arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icon/ic_left_arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icon/ic_right_arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/mbti_logo.webp
Binary file not shown.
6 changes: 5 additions & 1 deletion lib/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ unnecessary_const: true # 불필요한 const 사용 피함
unnecessary_new: true # 불필요한 new 사용 피함
use_full_hex_values_for_flutter_colors: true # Flutter 색상에 전체 16진수 값 사용
unused_field: true # 사용되지 않는 필드 피함
unused_local_variable: true # 사용되지 않는 지역 변수 피함
unused_local_variable: true # 사용되지 않는 지역 변수 피함

analyzer:
plugins:
- custom_lint
34 changes: 5 additions & 29 deletions lib/core/TopScreen.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import 'package:blueberry_flutter_template/feature/chat/ChatRoomScreen.dart';
import 'package:blueberry_flutter_template/feature/mbti/MBTIScreen.dart';
import 'package:blueberry_flutter_template/feature/profile/ProfileDetailScreen.dart';
import 'package:blueberry_flutter_template/feature/rank/RankScreen.dart';
import 'package:blueberry_flutter_template/feature/post/PostScreen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../feature/admin/AdminUserListPage.dart';
import '../feature/friend/FriendsListScreen.dart';
import '../feature/login/LoginScreen.dart';
import '../feature/match/MatchScreen.dart';

Expand All @@ -29,14 +25,10 @@ class TopScreen extends ConsumerWidget {
final selectedIndex = ref.watch(selectedIndexProvider);

final List<Widget> pages = [
const ChatRoomScreen(),
const FriendsListScreen(),
const PostScreen(),
const MatchScreen(),
const MBTIScreen(),
const LoginScreen(),
const ProfileDetailScreen(),
const RankingScreen(),
const AdminUserListPage(),
const AdminUserListPage()
];

return Scaffold(
Expand All @@ -51,33 +43,17 @@ class TopScreen extends ConsumerWidget {
backgroundColor: Colors.blueGrey[100],
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.chat),
label: 'Chat',
),
BottomNavigationBarItem(
icon: Icon(Icons.people),
label: 'Friends',
icon: Icon(Icons.podcasts),
label: 'Post',
),
BottomNavigationBarItem(
icon: Icon(Icons.pets),
label: 'match',
),
BottomNavigationBarItem(
icon: Icon(Icons.person_search),
label: 'mbti',
),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle),
label: 'MyPage',
),
BottomNavigationBarItem(
icon: Icon(Icons.supervised_user_circle_rounded),
label: 'ProfileDetail',
),
BottomNavigationBarItem(
icon: Icon(Icons.emoji_events),
label: 'Rank',
),
BottomNavigationBarItem(
icon: Icon(Icons.admin_panel_settings),
label: 'Admin',
Expand Down
103 changes: 103 additions & 0 deletions lib/core/widget/CustomFab.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import 'package:flutter/material.dart';

class CustomFab extends StatefulWidget {
final List<FabButton> fabButtons;
final Color mainColor;
final IconData mainIcon;

const CustomFab({
super.key,
required this.fabButtons,
this.mainColor = Colors.blue,
this.mainIcon = Icons.add,
});

@override
_CustomFabState createState() => _CustomFabState();
}

class FabButton {
final IconData icon;
final String label;
final VoidCallback onPressed;
final Color color;

FabButton({
required this.icon,
required this.label,
required this.onPressed,
this.color = Colors.blue,
});
}

class _CustomFabState extends State<CustomFab>
with SingleTickerProviderStateMixin {
bool _isExpanded = false;
late AnimationController _animationController;
late Animation<double> _animation;

@override
void initState() {
super.initState();
_animationController = AnimationController(
duration: const Duration(milliseconds: 300),
vsync: this,
);
_animation = CurvedAnimation(
parent: _animationController,
curve: Curves.easeInOut,
);
_animation.addListener(() {
setState(() {});
});
}

@override
void dispose() {
_animationController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Stack(
children: [
for (int i = 0; i < widget.fabButtons.length; i++)
AnimatedPositioned(
bottom: _isExpanded ? (i + 1) * 60.0 + 20.0 : 20.0,
right: 20,
duration: const Duration(milliseconds: 300),
child: AnimatedOpacity(
opacity: _isExpanded ? 1.0 : 0.0,
duration: const Duration(milliseconds: 300),
child: FloatingActionButton(
heroTag: 'btn$i',
onPressed: widget.fabButtons[i].onPressed,
backgroundColor: widget.fabButtons[i].color,
tooltip: widget.fabButtons[i].label,
child: Icon(widget.fabButtons[i].icon),
),
),
),
Positioned(
bottom: 20,
right: 20,
child: FloatingActionButton(
onPressed: () {
setState(() {
_isExpanded = !_isExpanded;
if (_isExpanded) {
_animationController.forward();
} else {
_animationController.reverse();
}
});
},
backgroundColor: widget.mainColor,
child: Icon(widget.mainIcon),
),
),
],
);
}
}
69 changes: 69 additions & 0 deletions lib/feature/calendar/CalendarBodyWidget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
part of 'CalendarScreen.dart';

class CalendarBodyWidget extends StatefulWidget {
CalendarBodyWidget({super.key});

@override
State<CalendarBodyWidget> createState() => _CalendarBodyWidgetState();
}

class _CalendarBodyWidgetState extends State<CalendarBodyWidget> {
List<DateTime> dateTime = [];

//TODO: 해당 로직 provider로 분리 예정
void setDate(int month, int year) {
final lastDay = DateTime(year, month + 1, 0);
final firstDay = DateTime(year, month, 1);
final int totalDate = lastDay.difference(firstDay).inDays;
dateTime = List.generate(
totalDate, (index) => firstDay.add(Duration(days: index)));
}

@override
void initState() {
super.initState();
setDate(DateTime.now().month, DateTime.now().year);
}

@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
children: List.generate(
DateTime.daysPerWeek,
(idx) => _dateItem(AppStrings.date[idx]),
),
),
Wrap(
children: [
...List.generate(
//TODO: 1일의 요일에 따른 배치 변경
dateTime.length,
(idx) => _dateItem(dateTime[idx].day.toString()),
),
],
)
],
);
}

Widget _dateItem(String item) {
final color = Color(0xFF5E5E5E);
final textStyle = TextStyle(
fontSize: 14.sp,
height: 16 / 14,
fontWeight: FontWeight.w500,
color: color,
//fontFamily: 'Urbanist',
);
return Container(
padding: EdgeInsets.symmetric(vertical: 14.w, horizontal: 5.4.w),
width: 50.29.w,
child: Text(
item,
style: textStyle,
),
);
}
}
74 changes: 74 additions & 0 deletions lib/feature/calendar/CalendarHeaderWidget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
part of 'CalendarScreen.dart';

class CalendarHeaderWidget extends StatelessWidget {
final int selectYear;
final int selectMonth;
final VoidCallback setYear;
final VoidCallback setMonth;

const CalendarHeaderWidget(
{super.key,
required this.selectYear,
required this.selectMonth,
required this.setYear,
required this.setMonth});

@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(
Assets.icon.icLeftArrow,
),
//TODO: 하드코딩 변경
Expanded(
child: Row(children: [
_changeDate(
date: selectMonth,
changeDate: setMonth,
),
_changeDate(
date: selectYear,
changeDate: setYear,
),
]),
),
SvgPicture.asset(Assets.icon.icRightArrow),
],
),
);
}

Widget _changeDate({required int date, required VoidCallback changeDate}) {
const color = Color(0xFF000000);
final textStyle = TextStyle(
fontSize: 16.sp,
height: 20 / 16,
fontWeight: FontWeight.w700,
color: color,
//fontFamily: 'Urbanist',
);
return GestureDetector(
onTap: changeDate,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(children: [
Text(
'$date',
style: textStyle,
),
SizedBox(
width: 8.w,
),
SvgPicture.asset(
Assets.icon.icDownArrow,
height: 20.w,
),
]),
),
);
}
}
30 changes: 30 additions & 0 deletions lib/feature/calendar/CalendarScreen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';

import '../../gen/assets.gen.dart';
import '../../utils/AppStrings.dart';

part 'CalendarHeaderWidget.dart';

part 'CalendarBodyWidget.dart';

class CalendarScreen extends StatelessWidget {
const CalendarScreen({super.key});

@override
Widget build(BuildContext context) {
return Column(
children: [
//TODO: 하드 코딩 변경
CalendarHeaderWidget(
selectYear: DateTime.now().year,
selectMonth: DateTime.now().month,
setYear: () {},
setMonth: () {},
),
CalendarBodyWidget(),
],
);
}
}
Loading

0 comments on commit 4d25c85

Please sign in to comment.