-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2024-summer' into feature/dynamiclink
- Loading branch information
Showing
89 changed files
with
2,671 additions
and
767 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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,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), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
This file contains 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,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, | ||
), | ||
); | ||
} | ||
} |
This file contains 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,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, | ||
), | ||
]), | ||
), | ||
); | ||
} | ||
} |
This file contains 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,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(), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.