Skip to content

Commit

Permalink
migrate to flutter 3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshj01 committed May 15, 2024
1 parent f4ecc3c commit f5326cc
Show file tree
Hide file tree
Showing 23 changed files with 74 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"editor.formatOnSaveMode": "modifications",
"workbench.colorTheme": "Winter is Coming (Dark Blue)",
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": false,
"source.fixAll.eslint": false
"source.organizeImports": "explicit",
"source.fixAll": "never",
"source.fixAll.eslint": "never"
},
"dart.lineLength": 100,
"files.exclude": {
Expand Down
5 changes: 2 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def keystoreProperties = new Properties()
}

android {
compileSdkVersion 33
compileSdkVersion 34
ndkVersion '25.1.8937393'
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -42,7 +42,7 @@ android {
defaultConfig {
applicationId "com.vocabhub.app"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -77,7 +77,6 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.window:window:1.0.0'
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
buildscript {
ext.kotlin_version = '1.8.20'
ext.kotlin_version = '1.9.0'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
}
}

Expand All @@ -20,6 +19,7 @@ allprojects {
}

rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
Expand Down
31 changes: 23 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
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.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
}

include ":app"
3 changes: 1 addition & 2 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ extension FindIcon on IconData {

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
as IntegrationTestWidgetsFlutterBinding;
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();

bool skip = false;

Expand Down
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
8 changes: 4 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -346,7 +346,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -423,7 +423,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -472,7 +472,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 2 additions & 1 deletion lib/base_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ class _AdaptiveLayoutState extends ConsumerState<AdaptiveLayout> {
return isExiting;
}
},
initialIndex: 0,
shouldPopToBaseRoute: true,
isDesktop: !SizeUtils.isMobile,
// destinationAnimationCurve: Curves.fastOutSlowIn,
Expand Down Expand Up @@ -295,7 +296,7 @@ class _AdaptiveLayoutState extends ConsumerState<AdaptiveLayout> {
decoration: FloatingNavbarDecoration(
height: kNavbarHeight * 1.2,
backgroundColor: SizeUtils.isDesktop
? colorScheme.surfaceVariant
? colorScheme.surfaceContainerHighest
: colorScheme.scrim.withOpacity(0.2),
margin: EdgeInsets.zero,
showSelectedLabels: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/add_word_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:vocabhub/services/services/add_word_service.dart';
import 'package:vocabhub/services/services/service_base.dart';
import 'package:vocabhub/utils/utils.dart';

class AddWordController extends ChangeNotifier with ServiceBase {
class AddWordController extends ChangeNotifier implements ServiceBase {
late List<Word> _drafts;
late AddWordService _addWordService;
late bool hasDrafts = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/auth_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:vocabhub/models/models.dart';
import 'package:vocabhub/services/services/auth_service.dart';
import 'package:vocabhub/services/services/service_base.dart';

class AuthController extends ChangeNotifier with ServiceBase {
class AuthController extends ChangeNotifier implements ServiceBase {
late AuthService _authService;
late UserModel _user;

Expand Down
2 changes: 1 addition & 1 deletion lib/controller/collections_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:vocabhub/services/services/service_base.dart';
import 'package:vocabhub/utils/extensions.dart';
import 'package:vocabhub/utils/utility.dart';

class CollectionsNotifier extends ChangeNotifier with ServiceBase {
class CollectionsNotifier extends ChangeNotifier implements ServiceBase {
late CollectionsService _collectionService;
List<VHCollection> _collections = [];
List<VHCollection> get collections => _collections;
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/dashboard_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:vocabhub/models/word.dart';
import 'package:vocabhub/services/services.dart';
import 'package:vocabhub/services/services/service_base.dart';

class DashboardController extends ChangeNotifier with ServiceBase {
class DashboardController extends ChangeNotifier implements ServiceBase {
bool _isLoading = true;

bool get isLoading => _isLoading;
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/explore_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:vocabhub/models/word.dart';
import 'package:vocabhub/services/services/explore_service.dart';
import 'package:vocabhub/services/services/service_base.dart';

class ExploreController extends ChangeNotifier with ServiceBase {
class ExploreController extends ChangeNotifier implements ServiceBase {
late DateTime _scrollMessageShownDate;
late bool _isScrollMessageShown = false;
late final ExploreService _exploreService;
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/searchfield_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:vocabhub/models/word.dart';
import 'package:vocabhub/services/services/search_service.dart';
import 'package:vocabhub/services/services/service_base.dart';

class SearchFieldController extends ChangeNotifier with ServiceBase {
class SearchFieldController extends ChangeNotifier implements ServiceBase {
late TextEditingController _searchController;
late SearchService _searchService;

Expand Down
5 changes: 2 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ class _VocabAppState extends ConsumerState<VocabApp> {
bodyColor: Colors.white,
displayColor: Colors.white,
),
scaffoldBackgroundColor: colorScheme.background,
scaffoldBackgroundColor: colorScheme.surface,
colorScheme: ColorScheme.fromSeed(
background: Colors.transparent,
surface: appThemeController.isDark
? Colors.black.withOpacity(0.3)
: Colors.white.withOpacity(0.3),
Expand All @@ -209,7 +208,7 @@ class _VocabAppState extends ConsumerState<VocabApp> {
theme: ThemeData(
useMaterial3: true,
textTheme: GoogleFonts.quicksandTextTheme(),
scaffoldBackgroundColor: colorScheme.background,
scaffoldBackgroundColor: colorScheme.surface,
colorScheme: ColorScheme.fromSeed(seedColor: appThemeController.themeSeed)),
routes: {
Notifications.route: (context) => Notifications(),
Expand Down
2 changes: 1 addition & 1 deletion lib/navbar/explore/explore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class _WordMasteredPreferenceState extends State<WordMasteredPreference> {
preferBelow: false,
decoration: BoxDecoration(color: colorScheme.tertiaryContainer),
richMessage: TextSpan(
style: Theme.of(context).textTheme.bodyText1!.copyWith(
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
fontWeight: FontWeight.w200,
),
children: [
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/notifications/notification_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class _NotificationDetailMobileState extends ConsumerState<NotificationDetailMob
if (value.state == RequestState.active) {
return LoadingWidget();
}
List<EditHistory> list = (value.data as List<EditHistory>);
final List<EditHistory> list = (value.data as List<EditHistory>);
return ListView.builder(
itemCount: list.length,
itemBuilder: (context, index) {
Expand Down Expand Up @@ -240,7 +240,7 @@ class DifferenceVisualizer extends ConsumerWidget {

final appThemeController = ref.watch(appThemeProvider);

bool hasChange = newVersion != oldVersion;
final bool hasChange = newVersion != oldVersion;
if (!hasChange) {
return ListTile(
title: Text(
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/notifications/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _NotificationsNavigatorState extends State<NotificationsNavigator> {
case Notifications.route:
return MaterialPageRoute(builder: (context) => Notifications());
case NotificationDetail.route:
final collection = settings.arguments as VHCollection;
// final collection = settings.arguments as VHCollection;
return MaterialPageRoute(
builder: (context) => NotificationDetail(
isNotification: widget.isNotification!,
Expand Down Expand Up @@ -323,7 +323,7 @@ class UserNotificationTile extends StatelessWidget {
height: 100,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: colorScheme.surfaceVariant, width: 1),
border: Border.all(color: colorScheme.surfaceContainerHighest, width: 1),
borderRadius: BorderRadius.circular(4),
boxShadow: [VocabTheme.notificationCardShadow],
),
Expand Down Expand Up @@ -418,7 +418,7 @@ class AdminNotificationTile extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(4),
border: Border.all(color: colorScheme.surfaceVariant, width: 1),
border: Border.all(color: colorScheme.surfaceContainerHighest, width: 1),
boxShadow: [VocabTheme.notificationCardShadow],
),
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
Expand Down
1 change: 0 additions & 1 deletion lib/services/services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ library services;

export 'package:vocabhub/main.dart';

export 'services/auth_service.dart';
export 'services/auth_service.dart';
export 'services/dashboard_service.dart';
export 'services/edit_history.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ RichText buildNotification(String notification, String word, {TextStyle? style})
return RichText(text: TextSpan(text: '', children: textSpans));
}

Widget heading(String title, {double fontSize: 20, Color? color}) {
Widget heading(String title, {double fontSize = 20, Color? color}) {
return Text(
title,
style: TextStyle(
Expand Down
29 changes: 18 additions & 11 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ publish_to: "none"
version: 0.7.8+30

environment:
sdk: ">=2.17.0 <3.0.0"

sdk: ">=3.3.0 <4.0.0"
dependencies:
animations: ^2.0.7
animations: ^2.0.11
cached_network_image: ^3.2.3
cupertino_icons: ^1.0.5
feature_discovery: ^0.14.1
firebase_analytics: ^10.4.4
firebase_core: ^2.4.1
firebase_messaging: ^14.2.1
firebase_messaging_web: ^3.5.1
firebase_remote_config: ^3.0.9
feature_discovery:
git:
url: https://github.com/maheshmnj/feature_discovery.git
ref: master
firebase_analytics: ^10.10.5
firebase_core: ^2.31.0
firebase_messaging: ^14.9.2
firebase_messaging_web: ^3.8.5
firebase_remote_config: ^4.4.5
flutter:
sdk: flutter
flutter_local_notifications: ^15.0.0
Expand All @@ -24,11 +26,16 @@ dependencies:
fluttertoast: ^8.0.9
go_router: ^7.0.2
google_fonts: ^4.0.4
google_sign_in: ^5.4.1
google_sign_in: ^5.4.4
http: ^0.13.6
intl: ^0.18.0
json_annotation: ^4.6.0
navbar_router: ^0.7.3
# navbar_router: ^0.7.3
navbar_router:
^0.7.4
# git:
# url: https://github.com/maheshmnj/navbar_router.git
# ref: issue-38
# navbar_router:
# path: ../../oss/my_packages/navbar_router
# url: https://github.com/maheshmnj/navbar_router.git
Expand Down

0 comments on commit f5326cc

Please sign in to comment.