Skip to content

Commit

Permalink
Merge pull request #142 from sparcs-kaist/feat@popup-recruiting
Browse files Browse the repository at this point in the history
Add popup for 2023 fall recruiting
  • Loading branch information
sboh1214 authored Aug 23, 2023
2 parents d5bd48d + cc357b0 commit 9ebb62f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 5 deletions.
Binary file added assets/popups/23f-recruiting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 3 additions & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class _OTLHomeState extends State<OTLHome> with SingleTickerProviderStateMixin {

WidgetsBinding.instance.addPostFrameCallback(
(_) async {
if ((await SharedPreferences.getInstance()).getBool('popup') ?? true) {
if ((await SharedPreferences.getInstance())
.getBool('popup_recruiting_23f') ??
true) {
await OTLNavigator.pushDialog(
context: context,
builder: (context) => PopUp(),
Expand Down
56 changes: 52 additions & 4 deletions lib/widgets/pop_up.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class _PopUpState extends State<PopUp> {
contentPadding: EdgeInsets.all(0.0),
actionsPadding: EdgeInsets.only(top: 8.0),
elevation: 0.0,
content: _buildAppEvent(context),
content: _build23fRecruiting(),
actions: [
Container(
decoration: BoxDecoration(
Expand Down Expand Up @@ -72,6 +72,54 @@ class _PopUpState extends State<PopUp> {
}
}

Widget _build23fRecruiting() {
return SingleChildScrollView(
child: Container(
child: Stack(
alignment: AlignmentDirectional.center,
children: [
Image.asset(
'assets/popups/23f-recruiting.png',
height: 328.0,
width: 285.0,
),
Column(
children: [
const SizedBox(height: 262.0),
FilledButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Color(0xFFEBA12A)),
),
onPressed: () => launchUrl(
Uri.parse(
'https://apply.sparcs.org/',
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'지원하러 가기',
style: evenBodyBold.copyWith(color: Colors.black),
textAlign: TextAlign.center,
),
const SizedBox(width: 8.0),
Icon(
Icons.arrow_forward,
color: Colors.black,
)
],
),
),
],
),
],
),
),
);
}

// ignore: unused_element
Widget _buildAppEvent(BuildContext context) {
final isEn = EasyLocalization.of(context)?.currentLocale == Locale('en');

Expand All @@ -82,8 +130,8 @@ Widget _buildAppEvent(BuildContext context) {
children: [
Image.asset(
isEn
? 'assets/app-event-image-en.png'
: 'assets/app-event-image.png',
? 'assets/popups/app-event-image-en.png'
: 'assets/popups/app-event-image.png',
height: 328.0,
width: 285.0,
),
Expand Down Expand Up @@ -130,7 +178,7 @@ Widget _buildGraduatePlanner() {
textAlign: TextAlign.center,
),
const SizedBox(height: 16.0),
Image.asset('assets/graduate-planner.png', height: 128.0),
Image.asset('assets/popups/graduate-planner.png', height: 128.0),
const SizedBox(height: 8.0),
Text(
'웹에서 지금 바로 만나보세요!',
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ flutter:
- assets/images/
- assets/translations/
- assets/icons/
- assets/popups/

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down

0 comments on commit 9ebb62f

Please sign in to comment.