Skip to content

Commit 8e8e832

Browse files
authored
feat: 부모 초기 화면 연결 완료 및 기타 오류 수정 (#187)
1 parent 2b95747 commit 8e8e832

File tree

5 files changed

+102
-69
lines changed

5 files changed

+102
-69
lines changed

frontend/ongi/android/app/build.gradle.kts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import java.util.Properties
2+
import java.io.FileInputStream
3+
14
plugins {
25
id("com.android.application")
36
// START: FlutterFire Configuration
@@ -8,12 +11,24 @@ plugins {
811
id("dev.flutter.flutter-gradle-plugin")
912
}
1013

14+
val keystoreProperties = Properties()
15+
val keystorePropertiesFile = rootProject.file("key.properties")
16+
if (keystorePropertiesFile.exists()) {
17+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
18+
}
19+
1120
android {
12-
namespace = "com.example.ongi"
21+
namespace = "com.ongi2025.ongi"
1322
compileSdk = flutter.compileSdkVersion
1423
ndkVersion = flutter.ndkVersion
1524

25+
defaultConfig {
26+
multiDexEnabled = true
27+
}
28+
1629
compileOptions {
30+
isCoreLibraryDesugaringEnabled = true
31+
1732
sourceCompatibility = JavaVersion.VERSION_11
1833
targetCompatibility = JavaVersion.VERSION_11
1934
}
@@ -24,7 +39,7 @@ android {
2439

2540
defaultConfig {
2641
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
27-
applicationId = "com.example.ongi"
42+
applicationId = "com.ongi2025.ongi"
2843
// You can update the following values to match your application needs.
2944
// For more information, see: https://flutter.dev/to/review-gradle-config.
3045
minSdk = flutter.minSdkVersion
@@ -33,15 +48,28 @@ android {
3348
versionName = flutter.versionName
3449
}
3550

51+
signingConfigs {
52+
create("release") {
53+
keyAlias = keystoreProperties["keyAlias"] as String
54+
keyPassword = keystoreProperties["keyPassword"] as String
55+
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
56+
storePassword = keystoreProperties["storePassword"] as String
57+
}
58+
}
59+
3660
buildTypes {
3761
release {
3862
// TODO: Add your own signing config for the release build.
3963
// Signing with the debug keys for now, so `flutter run --release` works.
40-
signingConfig = signingConfigs.getByName("debug")
64+
signingConfig = signingConfigs.getByName("release")
4165
}
4266
}
4367
}
4468

69+
dependencies {
70+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
71+
}
72+
4573
flutter {
4674
source = "../.."
4775
}

frontend/ongi/android/app/src/main/kotlin/com/example/ongi/MainActivity.kt renamed to frontend/ongi/android/app/src/main/kotlin/com/ongi2025/ongi/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.ongi
1+
package com.ongi2025.ongi
22

33
import io.flutter.embedding.android.FlutterActivity
44

frontend/ongi/lib/screens/parent_init_screen.dart

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:ongi/screens/health/health_home_screen.dart';
3-
import 'package:ongi/screens/home/home_screen.dart';
2+
import 'package:ongi/screens/bottom_nav.dart';
43
import 'package:ongi/core/app_colors.dart';
54
import 'package:ongi/core/app_background.dart';
65

@@ -42,66 +41,64 @@ class ParentInitScreen extends StatelessWidget {
4241
),
4342
),
4443

45-
Expanded(
46-
child: Center(
47-
child: Row(
48-
mainAxisAlignment: MainAxisAlignment.center,
49-
children: [
50-
ElevatedButton(
51-
onPressed: () {
52-
Navigator.push(
53-
context,
54-
MaterialPageRoute(
55-
builder: (_) => const HealthHomeScreen(),
56-
),
57-
);
58-
},
59-
style: ElevatedButton.styleFrom(
60-
elevation: 0,
61-
minimumSize: const Size(160, 200),
62-
padding: const EdgeInsets.all(24),
63-
foregroundColor: AppColors.ongiOrange,
64-
backgroundColor: Colors.white,
65-
textStyle: const TextStyle(
66-
fontSize: 36,
67-
fontWeight: FontWeight.w800,
68-
),
69-
shape: RoundedRectangleBorder(
70-
borderRadius: BorderRadius.circular(20),
71-
),
44+
const SizedBox(height: 85),
45+
Row(
46+
mainAxisAlignment: MainAxisAlignment.center,
47+
children: [
48+
ElevatedButton(
49+
onPressed: () {
50+
Navigator.pushReplacement(
51+
context,
52+
MaterialPageRoute(
53+
builder: (_) => const BottomNavScreen(initialIndex: 1),
7254
),
73-
child: const Text('건강\n기록', textAlign: TextAlign.left),
55+
);
56+
},
57+
style: ElevatedButton.styleFrom(
58+
elevation: 0,
59+
minimumSize: const Size(160, 200),
60+
padding: const EdgeInsets.all(24),
61+
foregroundColor: AppColors.ongiOrange,
62+
backgroundColor: Colors.white,
63+
textStyle: const TextStyle(
64+
fontSize: 36,
65+
fontWeight: FontWeight.w800,
66+
),
67+
shape: RoundedRectangleBorder(
68+
borderRadius: BorderRadius.circular(20),
7469
),
75-
const SizedBox(width: 30),
76-
ElevatedButton(
77-
onPressed: () {
78-
Navigator.push(
79-
context,
80-
MaterialPageRoute(
81-
builder: (_) => const HomeScreen(),
82-
),
83-
);
84-
},
85-
style: ElevatedButton.styleFrom(
86-
elevation: 0,
87-
minimumSize: const Size(160, 200),
88-
padding: const EdgeInsets.all(24),
89-
foregroundColor: AppColors.ongiOrange,
90-
backgroundColor: Colors.white,
91-
textStyle: const TextStyle(
92-
fontSize: 36,
93-
fontWeight: FontWeight.w800,
94-
),
95-
shape: RoundedRectangleBorder(
96-
borderRadius: BorderRadius.circular(20),
97-
),
70+
),
71+
child: const Text('건강\n기록', textAlign: TextAlign.left),
72+
),
73+
const SizedBox(width: 30),
74+
ElevatedButton(
75+
onPressed: () {
76+
Navigator.pushReplacement(
77+
context,
78+
MaterialPageRoute(
79+
builder: (_) => const BottomNavScreen(initialIndex: 0),
9880
),
99-
child: const Text('홈', textAlign: TextAlign.left),
81+
);
82+
},
83+
style: ElevatedButton.styleFrom(
84+
elevation: 0,
85+
minimumSize: const Size(160, 200),
86+
padding: const EdgeInsets.all(24),
87+
foregroundColor: AppColors.ongiOrange,
88+
backgroundColor: Colors.white,
89+
textStyle: const TextStyle(
90+
fontSize: 36,
91+
fontWeight: FontWeight.w800,
92+
),
93+
shape: RoundedRectangleBorder(
94+
borderRadius: BorderRadius.circular(20),
10095
),
101-
],
96+
),
97+
child: const Text('홈', textAlign: TextAlign.left),
10298
),
103-
),
99+
],
104100
),
101+
const Spacer(),
105102
],
106103
),
107104
),

frontend/ongi/lib/screens/photo/photo_date_screen.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
224224
borderRadius: BorderRadius.circular(32),
225225
child: (isActive && hasUploadedOwn)
226226
? Image.network(
227-
maumLog.frontPresignedUrl,
227+
maumLog.backPresignedUrl,
228228
width: cardWidth,
229229
height: cardHeight,
230230
fit: BoxFit.cover,
@@ -246,7 +246,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
246246
children: [
247247
// 선명한 이미지 (상단)
248248
Image.network(
249-
maumLog.frontPresignedUrl,
249+
maumLog.backPresignedUrl,
250250
width: cardWidth,
251251
height: cardHeight,
252252
fit: BoxFit.cover,
@@ -284,7 +284,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
284284
child: ImageFiltered(
285285
imageFilter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),
286286
child: Image.network(
287-
maumLog.frontPresignedUrl,
287+
maumLog.backPresignedUrl,
288288
width: cardWidth + 60,
289289
height: cardHeight + 60,
290290
fit: BoxFit.cover,
@@ -322,7 +322,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
322322
borderRadius: BorderRadius.circular(12),
323323
child: hasUploadedOwn
324324
? Image.network(
325-
maumLog.backPresignedUrl,
325+
maumLog.frontPresignedUrl,
326326
fit: BoxFit.cover,
327327
errorBuilder: (context, error, stackTrace) {
328328
return Container(
@@ -340,7 +340,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
340340
children: [
341341
// 선명한 이미지 (상단)
342342
Image.network(
343-
maumLog.backPresignedUrl,
343+
maumLog.frontPresignedUrl,
344344
fit: BoxFit.cover,
345345
width: double.infinity,
346346
height: double.infinity,
@@ -376,7 +376,7 @@ class _PhotoDateScreenState extends State<PhotoDateScreen> {
376376
child: ImageFiltered(
377377
imageFilter: ImageFilter.blur(sigmaX: 25, sigmaY: 25),
378378
child: Image.network(
379-
maumLog.backPresignedUrl,
379+
maumLog.frontPresignedUrl,
380380
width: 88 + 40,
381381
height: 100 + 40,
382382
fit: BoxFit.cover,

frontend/ongi/lib/screens/splash_screen.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:async';
22
import 'package:flutter/material.dart';
33
import 'package:ongi/core/app_colors.dart';
44
import 'package:ongi/screens/bottom_nav.dart';
5+
import 'package:ongi/screens/parent_init_screen.dart';
56
import 'package:ongi/screens/start_screen.dart';
67
import 'package:ongi/utils/prefs_manager.dart';
78

@@ -32,9 +33,16 @@ class _SplashScreenState extends State<SplashScreen> {
3233

3334
if (!mounted) return;
3435
if (hasToken) {
35-
Navigator.of(context).pushReplacement(
36-
MaterialPageRoute(builder: (_) => const BottomNavScreen()),
37-
);
36+
final isParent = await PrefsManager.getIsParent();
37+
if (isParent) {
38+
Navigator.of(context).pushReplacement(
39+
MaterialPageRoute(builder: (_) => const ParentInitScreen()),
40+
);
41+
} else {
42+
Navigator.of(context).pushReplacement(
43+
MaterialPageRoute(builder: (_) => const BottomNavScreen()),
44+
);
45+
}
3846
} else {
3947
Navigator.of(
4048
context,

0 commit comments

Comments
 (0)