Skip to content

Commit 0add19c

Browse files
authored
refactor: update project (#24)
* chore: update gradle * chore: set android:exported on `AndroidManifest` * chore: update deps * style: fix formatting * refactor: replace `WillPopScope` with `PopScope`
1 parent a0c769b commit 0add19c

File tree

17 files changed

+244
-214
lines changed

17 files changed

+244
-214
lines changed

android/app/build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3434

3535
android {
3636
compileSdkVersion flutter.compileSdkVersion
37+
ndkVersion flutter.ndkVersion
38+
39+
compileOptions {
40+
sourceCompatibility JavaVersion.VERSION_1_8
41+
targetCompatibility JavaVersion.VERSION_1_8
42+
}
43+
44+
kotlinOptions {
45+
jvmTarget = '1.8'
46+
}
3747

3848
sourceSets {
3949
main.java.srcDirs += 'src/main/kotlin'
@@ -42,19 +52,13 @@ android {
4252
defaultConfig {
4353
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4454
applicationId "io.fireship.quizapp"
45-
minSdkVersion 19
55+
minSdkVersion 24
4656
targetSdkVersion flutter.targetSdkVersion
4757
versionCode flutterVersionCode.toInteger()
4858
versionName flutterVersionName
4959
multiDexEnabled true
5060
}
5161

52-
// TODO: Remove when below fix is available in stable channel.
53-
// https://github.com/flutter/flutter/pull/82309
54-
lintOptions {
55-
checkReleaseBuilds false
56-
}
57-
5862
signingConfigs {
5963
if (System.getenv("ANDROID_KEYSTORE_PATH")) {
6064
release {
@@ -78,24 +82,26 @@ android {
7882
production {
7983
dimension "default"
8084
applicationIdSuffix ""
85+
manifestPlaceholders = [appName: "Quiz App"]
8186
}
8287
development {
8388
dimension "default"
8489
applicationIdSuffix ".dev"
90+
manifestPlaceholders = [appName: "[DEV] Quiz App"]
8591
}
8692
}
8793

8894
buildTypes {
8995
release {
9096
signingConfig signingConfigs.release
9197
minifyEnabled true
92-
useProguard true
9398
proguardFiles getDefaultProguardFile('proguard-android.txt')
9499
}
95100
debug {
96101
signingConfig signingConfigs.debug
97102
}
98103
}
104+
namespace 'io.fireship.quizapp'
99105
}
100106

101107
flutter {

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.fireship.quizapp">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- Flutter needs it to communicate with the running application
43
to allow setting breakpoints, to provide hot reload, etc.
54
-->

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.fireship.quizapp">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<application
43
android:label="Quizapp"
54
android:icon="@mipmap/ic_launcher">
65
<activity
76
android:name=".MainActivity"
7+
android:exported="true"
88
android:launchMode="singleTop"
99
android:theme="@style/LaunchTheme"
1010
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.fireship.quizapp">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- Flutter needs it to communicate with the running application
43
to allow setting breakpoints, to provide hot reload, etc.
54
-->

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
9+
classpath 'com.android.tools.build:gradle:7.4.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
classpath 'com.google.gms:google-services:4.3.8'
11+
classpath 'com.google.gms:google-services:4.4.1'
1212
}
1313
}
1414

1515
allprojects {
1616
repositories {
1717
google()
18-
jcenter()
18+
mavenCentral()
1919
}
2020
}
2121

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Tue Apr 02 02:12:39 EEST 2024
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

lib/topics/view/topic_page.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ class TopicPage extends StatelessWidget {
2121

2222
@override
2323
Widget build(BuildContext context) {
24-
return WillPopScope(
25-
onWillPop: () async {
26-
context.flow<TopicsFlowState>().deselectTopic();
27-
return false;
24+
return PopScope(
25+
canPop: false,
26+
onPopInvoked: (didPop) {
27+
if (!didPop) {
28+
context.flow<TopicsFlowState>().deselectTopic();
29+
}
2830
},
2931
child: Scaffold(
3032
appBar: AppBar(
@@ -87,7 +89,7 @@ class QuizList extends StatelessWidget {
8789
final quizzes = context.select((Topic topic) => topic.quizzes);
8890
return Column(
8991
children: [
90-
for (final quiz in quizzes) QuizItem(quiz: quiz, topicId: topicId)
92+
for (final quiz in quizzes) QuizItem(quiz: quiz, topicId: topicId),
9193
],
9294
);
9395
}

packages/api_client/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ environment:
99
dependencies:
1010
app_core:
1111
path: ../app_core
12-
cloud_firestore: ^4.8.0
13-
firebase_auth: ^4.6.2
14-
firebase_core: ^2.13.1
12+
cloud_firestore: ^4.15.10
13+
firebase_auth: ^4.18.0
14+
firebase_core: ^2.27.2
1515
flutter:
1616
sdk: flutter
17-
google_sign_in: ^6.1.3
18-
sign_in_with_apple: ^4.3.0
17+
google_sign_in: ^6.2.1
18+
sign_in_with_apple: ^6.0.0
1919

2020
dev_dependencies:
21-
very_good_analysis: ^5.0.0+1
21+
very_good_analysis: ^5.1.0
2222

packages/app_core/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ environment:
77
sdk: '>=3.0.0 <4.0.0'
88

99
dependencies:
10-
bloc: ^8.1.2
10+
bloc: ^8.1.4
1111
crypto: ^3.0.3
1212
equatable: ^2.0.5
1313
flutter:
1414
sdk: flutter
1515
json_annotation: ^4.8.1
16-
provider: ^6.0.5
16+
provider: ^6.1.2
1717
rxdart: ^0.27.7
1818

1919
dev_dependencies:
20-
very_good_analysis: ^5.0.0+1
20+
very_good_analysis: ^5.1.0

packages/app_ui/lib/src/widgets.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class ActionButton extends StatelessWidget {
169169
onPressed: onPressed,
170170
style: style,
171171
child: label,
172-
)
172+
),
173173
],
174174
);
175175
}

0 commit comments

Comments
 (0)