Skip to content

Commit

Permalink
Release Parent 3.9.0 (48)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskozmer authored Oct 30, 2023
2 parents 54d77d5 + 9943302 commit 81ab1aa
Show file tree
Hide file tree
Showing 1,392 changed files with 78,747 additions and 17,020 deletions.
10 changes: 5 additions & 5 deletions apps/flutter_parent/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 31
buildToolsVersion "30.0.2"
compileSdk 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -47,7 +46,7 @@ android {
defaultConfig {
applicationId "com.instructure.parentapp"
minSdkVersion 26
targetSdkVersion 31
targetSdk 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -92,22 +91,23 @@ android {
}
}
}
namespace 'com.instructure.parentapp'
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20"

testImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.squareup.okhttp3:okhttp:4.9.1"
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.google.gms:google-services:4.3.3'
implementation 'com.google.gms:google-services:4.3.14'
}

apply plugin: 'com.google.firebase.crashlytics'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.instructure.parentapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions apps/flutter_parent/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.instructure.parentapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.instructure.parentapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
10 changes: 5 additions & 5 deletions apps/flutter_parent/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath "com.google.firebase:firebase-crashlytics-gradle:2.1.0"
classpath "com.google.gms:google-services:4.3.10"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'
classpath "com.google.gms:google-services:4.3.14"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20"
}
}

Expand All @@ -27,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion apps/flutter_parent/android/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
mavenCentral()
}

val agpVersion = "4.1.0"
val agpVersion = "7.4.2"

dependencies {
implementation("com.android.tools.build:gradle:$agpVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ class TimingsListener implements TaskExecutionListener, BuildListener {

}

@Override
void buildStarted(Gradle gradle) {}

@Override
void projectsEvaluated(Gradle gradle) {}

Expand Down
2 changes: 1 addition & 1 deletion apps/flutter_parent/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
android.enableR8=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
1 change: 1 addition & 0 deletions apps/flutter_parent/flutter_parent_sdk_url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.13.2-stable.tar.xz
27 changes: 12 additions & 15 deletions apps/flutter_parent/lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_parent/l10n/generated/messages_all.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -78,38 +79,34 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
@override
bool shouldReload(LocalizationsDelegate<AppLocalizations> old) => false;

LocaleResolutionCallback resolution({Locale fallback, bool matchCountry = true}) {
return (Locale locale, Iterable<Locale> supported) {
LocaleResolutionCallback resolution({Locale? fallback, bool matchCountry = true}) {
return (Locale? locale, Iterable<Locale> supported) {
return _resolve(locale, fallback, supported, matchCountry);
};
}

///
/// Returns true if the specified locale is supported, false otherwise.
///
Locale _isSupported(Locale locale, bool shouldMatchCountry) {
if (locale == null) {
return null;
}

Locale? _isSupported(Locale? locale, bool shouldMatchCountry) {
// Must match language code and script code.
// Must match country code if specified or will fall back to the generic language pack if we don't match country code.
// i.e., match a passed in 'zh-Hans' to the supported 'zh' if [matchCountry] is false
return supportedLocales.firstWhere((Locale supportedLocale) {
final matchLanguage = (supportedLocale.languageCode == locale.languageCode);
final matchScript = (locale.scriptCode == supportedLocale.scriptCode);
final matchCountry = (supportedLocale.countryCode == locale.countryCode);
return supportedLocales.firstWhereOrNull((Locale supportedLocale) {
final matchLanguage = (supportedLocale.languageCode == locale?.languageCode);
final matchScript = (locale?.scriptCode == supportedLocale.scriptCode);
final matchCountry = (supportedLocale.countryCode == locale?.countryCode);
final matchCountryFallback =
(true != shouldMatchCountry && (supportedLocale.countryCode == null || supportedLocale.countryCode.isEmpty));
(true != shouldMatchCountry && (supportedLocale.countryCode == null || supportedLocale.countryCode?.isEmpty == true));

return matchLanguage && matchScript && (matchCountry || matchCountryFallback);
}, orElse: () => null);
});
}

///
/// Internal method to resolve a locale from a list of locales.
///
Locale _resolve(Locale locale, Locale fallback, Iterable<Locale> supported, bool matchCountry) {
Locale? _resolve(Locale? locale, Locale? fallback, Iterable<Locale> supported, bool matchCountry) {
if (locale == Locale('zh', 'Hant')) {
// Special case Traditional Chinese (server sends us zh-Hant but translators give us zh-HK)
locale = Locale('zh', 'HK');
Expand All @@ -122,7 +119,7 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
}
}

AppLocalizations L10n(BuildContext context) => Localizations.of<AppLocalizations>(context, AppLocalizations);
AppLocalizations L10n(BuildContext context) => Localizations.of<AppLocalizations>(context, AppLocalizations) ?? AppLocalizations();

///
/// App Localization class.
Expand Down
6 changes: 3 additions & 3 deletions apps/flutter_parent/lib/l10n/generated/messages_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import 'messages_sv_instk12.dart' as messages_sv_instk12;
import 'messages_zh.dart' as messages_zh;
import 'messages_zh_HK.dart' as messages_zh_hk;

typedef Future<dynamic> LibraryLoader();
typedef Future<dynamic>? LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'ar': () => new Future.value(null),
'ca': () => new Future.value(null),
Expand Down Expand Up @@ -90,7 +90,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
'zh_HK': () => new Future.value(null),
};

MessageLookupByLibrary _findExact(String localeName) {
MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'ar':
return messages_ar.messages;
Expand Down Expand Up @@ -191,7 +191,7 @@ bool _messagesExistFor(String locale) {
}
}

MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
if (actualLocale == null) return null;
Expand Down
36 changes: 15 additions & 21 deletions apps/flutter_parent/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import 'dart:io';
import 'dart:isolate';
import 'dart:ui';

import 'package:device_info/device_info.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_parent/network/utils/analytics.dart';
import 'package:flutter_parent/network/utils/api_prefs.dart';
import 'package:flutter_parent/parent_app.dart';
Expand All @@ -34,21 +34,22 @@ import 'package:flutter_parent/utils/old_app_migration.dart';
import 'package:flutter_parent/utils/remote_config_utils.dart';
import 'package:flutter_parent/utils/service_locator.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter_downloader/flutter_downloader.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();

setupLocator();
runZonedGuarded<Future<void>>(() async {
await Future.wait([
ApiPrefs.init(),
ThemePrefs.init(),
RemoteConfigUtils.initialize(),
CrashUtils.init(),
FlutterDownloader.initialize(),
DbUtil.init()
]);

await ApiPrefs.init();
await ThemePrefs.init();
await RemoteConfigUtils.initialize();
await CrashUtils.init();
await FlutterDownloader.initialize();
await DbUtil.init();

PandaRouter.init();

await FlutterDownloader.registerCallback(downloadCallback);
Expand All @@ -59,13 +60,6 @@ void main() async {

await locator<OldAppMigration>().performMigrationIfNecessary(); // ApiPrefs must be initialized before calling this

if (Platform.isAndroid) {
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
if (info.version.sdkInt >= 29) {
WebView.platform = SurfaceAndroidWebView();
}
}

// Set environment properties for analytics. No need to await this.
locator<Analytics>().setEnvironmentProperties();

Expand All @@ -74,8 +68,8 @@ void main() async {
}

@pragma('vm:entry-point')
void downloadCallback(String id, DownloadTaskStatus status, int progress) {
final SendPort send =
void downloadCallback(String id, int status, int progress) {
final SendPort? send =
IsolateNameServer.lookupPortByName('downloader_send_port');
send.send([id, status, progress]);
send?.send([id, status, progress]);
}
Loading

0 comments on commit 81ab1aa

Please sign in to comment.