Skip to content

Commit

Permalink
Merge pull request #27 from Mazahir26/dev2
Browse files Browse the repository at this point in the history
Upgrade Flutter to v3.22.1
  • Loading branch information
Mazahir26 authored Jun 26, 2024
2 parents 3071228 + 87e0e3e commit da232a2
Show file tree
Hide file tree
Showing 30 changed files with 423 additions and 363 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ migrate_working_dir/
*.ipr
*.iws
.idea/
*.jks

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
Expand Down
60 changes: 36 additions & 24 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,9 +12,12 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
def keyStoreProperties= new Properties()
def keyStorePropertiesFile = rootProject.file('key.properties')
if (keyStorePropertiesFile.exists()) {
keyStorePropertiesFile.withReader('UTF-8') {reader ->
keyStoreProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand All @@ -20,15 +29,7 @@ def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


android {
Expand Down Expand Up @@ -60,25 +61,36 @@ android {
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
release {
storeFile file(keyStoreProperties['storeFile'])
storePassword keyStoreProperties['storePassword']
keyAlias keyStoreProperties['keyAlias']
keyPassword keyStoreProperties['keyPassword']
v1SigningEnabled true
v2SigningEnabled true
enableV3Signing true
enableV4Signing true
}
}

}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
// buildTypes {
// release {
// // TODO: Add your own signing config for the release build.
// // Signing with the debug keys for now, so `flutter run --release` works.
// signingConfig signingConfigs.debug
// shrinkResources false
// }
// }
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
23 changes: 5 additions & 18 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
buildscript {
ext.kotlin_version = '1.9.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
Expand All @@ -28,4 +15,4 @@ subprojects {

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.20" apply false
}

include ":app"
5 changes: 2 additions & 3 deletions lib/components/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TaskCard extends StatelessWidget {
late final Color textColor;
final bool isSwipeDisabled;
TaskCard(
{Key? key,
{super.key,
required this.name,
required this.controller,
required this.color,
Expand All @@ -29,8 +29,7 @@ class TaskCard extends StatelessWidget {
required this.onTap,
required this.isCompleted,
required this.isSkipped,
required this.isSwipeDisabled})
: super(key: key) {
required this.isSwipeDisabled}) {
if (controller != null) {
if (isCompleted) {
tween = Tween(
Expand Down
24 changes: 12 additions & 12 deletions lib/components/create_routine_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ enum RepeatType {

class CreateRoutineBottomSheet extends StatefulWidget {
const CreateRoutineBottomSheet({
Key? key,
super.key,
this.editRoutine,
}) : super(key: key);
});
final Routine? editRoutine;

@override
Expand Down Expand Up @@ -346,12 +346,12 @@ class _CreateRoutineBottomSheetState extends State<CreateRoutineBottomSheet> {

class Buttons extends StatelessWidget {
const Buttons({
Key? key,
super.key,
required this.pageIndex,
required this.onNext,
required this.onPrevious,
required this.text,
}) : super(key: key);
});

final int pageIndex;
final void Function()? onNext;
Expand Down Expand Up @@ -420,12 +420,12 @@ class Buttons extends StatelessWidget {

class TaskSelectPage extends StatelessWidget {
const TaskSelectPage({
Key? key,
super.key,
required this.selectedTask,
required this.onTapAdd,
required this.onTapDelete,
required this.onChangeOrder,
}) : super(key: key);
});
final List<Task> selectedTask;
final void Function(Task task) onTapAdd;
final void Function(int index) onTapDelete;
Expand Down Expand Up @@ -468,7 +468,7 @@ class TaskSelectPage extends StatelessWidget {
children: [
Text('Select Tasks',
style: Theme.of(context).textTheme.headlineMedium!.apply(
color: Theme.of(context).colorScheme.onBackground)),
color: Theme.of(context).colorScheme.onSurface)),
TextButton.icon(
onPressed: (() {
Navigator.pushNamed(
Expand Down Expand Up @@ -549,7 +549,7 @@ class TaskSelectPage extends StatelessWidget {
.apply(
color: Theme.of(context)
.colorScheme
.onBackground
.onSurface
.withOpacity(0.8)),
),
title: Text(
Expand All @@ -558,7 +558,7 @@ class TaskSelectPage extends StatelessWidget {
)),
)))
.values
.toList()

],
),
onReorder: onChangeOrder,
Expand Down Expand Up @@ -593,7 +593,7 @@ class TaskSelectPage extends StatelessWidget {
style: Theme.of(context).textTheme.bodyMedium!.apply(
color: Theme.of(context)
.colorScheme
.onBackground
.onSurface
.withOpacity(0.8)),
),
title: Text(
Expand All @@ -610,15 +610,15 @@ class TaskSelectPage extends StatelessWidget {

class RepeatPage extends StatelessWidget {
const RepeatPage({
Key? key,
super.key,
required this.onDayChange,
required this.selectedDays,
required this.onChangeRepeatType,
required this.time,
required this.onChangeTime,
required this.onToggleNotification,
required this.notification,
}) : super(key: key);
});
final void Function(String, bool) onDayChange;
final Map<String, bool> selectedDays;
final void Function(RepeatType) onChangeRepeatType;
Expand Down
Loading

0 comments on commit da232a2

Please sign in to comment.