Skip to content

245 모달 컴포넌트 제작 #251

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9227d0f
chore: change name from schedule start into schedule start screen
SeoHyeonSim Apr 2, 2025
a3b19d0
feat: create modal component and apply in schedule start screen
SeoHyeonSim Apr 2, 2025
19f9fa5
feat: add usecase for modal component
SeoHyeonSim Apr 2, 2025
0494fff
fix: get image asset from assets characters folder
SeoHyeonSim Apr 2, 2025
38e3522
refactor: modify modal component for alterdialog
SeoHyeonSim Apr 2, 2025
45a5060
chore: add character variable svg files
SeoHyeonSim Apr 2, 2025
5cc86c3
chore: fix minor error
SeoHyeonSim Apr 2, 2025
c6e3857
refactor: change modal component according to alert dialog style
SeoHyeonSim Apr 9, 2025
047ffb2
refactor: add modal button component and change image names
SeoHyeonSim Apr 9, 2025
2a54378
chore: remove unnecessary blank lines in launch configuration
jjoonleo Apr 29, 2025
aeef3cb
refactor: enhance dialog theme with custom styles and remove unused t…
jjoonleo Apr 29, 2025
7bbdaa9
feat: implement CustomAlertDialog component and remove ModalComponent
jjoonleo May 1, 2025
04029c3
refactor: remove unnecessary padding from background container in Wid…
jjoonleo May 1, 2025
cce037c
refactor: replace ModalComponent with CustomAlertDialog in ScheduleSt…
jjoonleo May 1, 2025
d9818ec
feat: add CustomAlertDialog component and remove ModalComponent
jjoonleo May 1, 2025
98e0b77
Merge pull request #256 from DevKor-github/245-모달-컴포넌트-제작-refactor
SeoHyeonSim May 2, 2025
1a80e05
refactor: delete unnecessary imports and texts in custom alert dialog
SeoHyeonSim May 3, 2025
5eec840
refactor: fix custom alert dialog according to design
SeoHyeonSim May 3, 2025
2317b4e
feat: add modal error button
SeoHyeonSim May 3, 2025
cf4144a
refactor: change widgetbook usecase according to design
SeoHyeonSim May 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "on_time_front",
"request": "launch",
Expand All @@ -14,7 +13,6 @@
".env/debug.env",
"--web-port",
"58102"

]
},
{
Expand Down
98 changes: 98 additions & 0 deletions assets/characters/character_headphone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions assets/characters/character_late_earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions assets/characters/character_whistle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 114 additions & 59 deletions lib/presentation/alarm/screens/schedule_start_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,81 +3,136 @@ import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';

import 'package:on_time_front/domain/entities/schedule_entity.dart';

import 'package:on_time_front/presentation/shared/components/button.dart';
import 'package:on_time_front/presentation/shared/components/modal_button.dart';
import 'package:on_time_front/presentation/shared/components/custom_alert_dialog.dart';

class ScheduleStart extends StatelessWidget {
class ScheduleStartScreen extends StatefulWidget {
final ScheduleEntity schedule;

const ScheduleStart({
const ScheduleStartScreen({
super.key,
required this.schedule,
});

@override
State<ScheduleStartScreen> createState() => _ScheduleStartScreenState();
}

class _ScheduleStartScreenState extends State<ScheduleStartScreen> {
void _showModal(BuildContext context) {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return _ScheduleStartScreenModal();
},
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 90),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
schedule.scheduleName,
style: const TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Color(0xff5C79FB),
return SafeArea(
child: Scaffold(
body: Stack(
children: [
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 60),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
widget.schedule.scheduleName,
style: const TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Color(0xff5C79FB),
),
),
const SizedBox(height: 8),
Text(
widget.schedule.place.placeName,
style: const TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 15),
Text(
'지금 준비 시작 안하면 늦어요!',
style: const TextStyle(
fontSize: 15,
),
textAlign: TextAlign.center,
),
Padding(
padding: const EdgeInsets.only(top: 50),
child: SvgPicture.asset(
'characters/character.svg',
package: 'assets',
width: 204,
height: 269,
),
),
],
),
),
const SizedBox(height: 8),
Text(
schedule.place.placeName,
style: const TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 15),
Text(
'지금 준비 시작 안하면 늦어요!',
style: const TextStyle(
fontSize: 15,
),
textAlign: TextAlign.center,
),
const Spacer(),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Button(
text: '준비 시작',
onPressed: () async {
context.go('/alarmScreen', extra: widget.schedule);
},
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: SvgPicture.asset(
'characters/character.svg',
package: 'assets',
width: 204,
height: 269,
),
)
],
),
),
],
),
),
const Spacer(),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Button(
text: '준비 시작',
onPressed: () async {
context.go('/alarmScreen', extra: schedule);
},
Positioned(
top: 10,
right: 10,
child: IconButton(
icon: const Icon(Icons.close),
onPressed: () => _showModal(context),
),
),
),
],
],
),
),
);
}
}

class _ScheduleStartScreenModal extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CustomAlertDialog(
title: const Text(
'정말 나가시겠어요?',
),
content: const Text(
'이 화면을 나가면\n함께 약속을 준비할 수 없게 돼요',
),
actions: [
ModalButton(
onPressed: () => context.go('/home'),
text: '나갈래요',
color: Theme.of(context).colorScheme.surfaceContainerLow,
textColor: Theme.of(context).colorScheme.outline,
),
ModalButton(
onPressed: () => Navigator.pop(context),
text: '있을래요',
color: Theme.of(context).colorScheme.primary,
textColor: Theme.of(context).colorScheme.onPrimary,
),
],
);
}
}
12 changes: 12 additions & 0 deletions lib/presentation/moving/screens/moving_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return Container(
child: Text('this is moving screen'),
);
}
}
Loading