Skip to content

Commit

Permalink
refactor: Upgrade Flutter SDK and Kotlin version (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
0niel authored May 27, 2022
1 parent db7e298 commit 22aacee
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 35 deletions.
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class HomeWidgetPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
}
}

override fun onNewIntent(intent: Intent?): Boolean {
override fun onNewIntent(intent: Intent): Boolean {
receiver?.onReceive(context, intent)
return receiver != null
}
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
1 change: 0 additions & 1 deletion lib/common/utils/calendar_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:math';

import 'package:clock/clock.dart';
import 'package:intl/intl.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/data/repositories/forum_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ForumRepositoryImpl implements ForumRepository {
final patrons = await localDataSource.getPatronsFromCache();
return Right(patrons);
} on CacheException {
return Left(CacheFailure());
return const Left(CacheFailure());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/data/repositories/github_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class GithubRepositoryImpl implements GithubRepository {
localDataSource.setContributorsToCache(contributors);
return Right(contributors);
} on ServerException {
return Left(ServerFailure());
return const Left(ServerFailure());
}
} else {
try {
final contributors = await localDataSource.getContributorsFromCache();
return Right(contributors);
} on CacheException {
return Left(CacheFailure());
return const Left(CacheFailure());
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/news_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class NewsRepositoryImpl implements NewsRepository {
await remoteDataSource.getNews(offset, limit, isImportant, tag);
return Right(newsList);
} on ServerException {
return const Left(const ServerFailure());
return const Left(ServerFailure());
}
} else {
return const Left(const ServerFailure());
return const Left(ServerFailure());
}
}

Expand All @@ -39,10 +39,10 @@ class NewsRepositoryImpl implements NewsRepository {
final tagsList = await remoteDataSource.getTags();
return Right(tagsList);
} on ServerException {
return const Left(const ServerFailure());
return const Left(ServerFailure());
}
} else {
return const Left(const ServerFailure());
return const Left(ServerFailure());
}
}
}
7 changes: 3 additions & 4 deletions lib/data/repositories/schedule_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ScheduleRepositoryImpl implements ScheduleRepository {

@override
Future<Either<Failure, List<String>>> getAllGroups() async {
connectionChecker.checkInterval = const Duration(seconds: 2);
if (await connectionChecker.hasConnection) {
try {
final groupsList = await remoteDataSource.getGroups();
Expand Down Expand Up @@ -86,7 +85,7 @@ class ScheduleRepositoryImpl implements ScheduleRepository {
// we can try to get the schedule from the local storage
final localSchedule = await _tryGetLocalSchedule(group);
if (localSchedule.isRight()) return localSchedule;
return Left(ServerFailure());
return const Left(ServerFailure());
}
} else {
return await _tryGetLocalSchedule(group);
Expand All @@ -108,7 +107,7 @@ class ScheduleRepositoryImpl implements ScheduleRepository {
try {
return Right(await localDataSource.getActiveGroupFromCache());
} on CacheException {
return Left(CacheFailure());
return const Left(CacheFailure());
}
}

Expand All @@ -123,7 +122,7 @@ class ScheduleRepositoryImpl implements ScheduleRepository {
final localSchedule = await localDataSource.getScheduleFromCache();
return Right(localSchedule);
} on CacheException {
return Left(CacheFailure());
return const Left(CacheFailure());
}
}

Expand Down
2 changes: 0 additions & 2 deletions lib/domain/repositories/app_settings_repository.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:dartz/dartz.dart';
import 'package:rtu_mirea_app/common/errors/failures.dart';
import 'package:rtu_mirea_app/domain/entities/app_settings.dart';

abstract class AppSettingsRepository {
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import 'package:rtu_mirea_app/presentation/core/routes/routes.gr.dart';
import 'package:rtu_mirea_app/presentation/theme.dart';
import 'package:intl/intl_standalone.dart';
import 'package:rtu_mirea_app/service_locator.dart' as dependency_injection;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_strategy/url_strategy.dart';
import 'service_locator.dart';
import 'package:firebase_core/firebase_core.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/bloc/news_bloc/news_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:async';

import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/colors.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/presentation/core/routes/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Route<T> transparentRoute<T>(
BuildContext context, Widget child, CustomPage<T> page) {
return TransparentRoute(
settings: page,
transitionDuration: const Duration(milliseconds: 250),
reverseTransitionDuration: const Duration(milliseconds: 250),
builder: (context) => child,
backgroundColor: Colors.black.withOpacity(0.45),
);
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/pages/news/news_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:async';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/pages/news/widgets/story_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:auto_route/auto_route.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/material.dart';
import 'package:rtu_mirea_app/domain/entities/story.dart';
import 'package:rtu_mirea_app/presentation/colors.dart';
Expand Down
16 changes: 8 additions & 8 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: rtu_mirea_app
description: Mobile application for students of RTU MIREA
publish_to: 'none'

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand Down Expand Up @@ -80,7 +81,7 @@ dependencies:
# dates or a range of dates. It has four built-in views that allow quick
# navigation to the desired date.
# See https://pub.dev/packages/syncfusion_flutter_datepicker
syncfusion_flutter_datepicker: ^19.3.54
syncfusion_flutter_datepicker: ^20.1.57

# A Flutter widget rendering static HTML and CSS as Flutter widgets.
# See https://pub.dev/packages/flutter_html
Expand Down Expand Up @@ -128,12 +129,11 @@ dependencies:
# ListView that implicitly animates between the changes of two lists
# See https://pub.dev/packages/implicitly_animated_reorderable_list
implicitly_animated_reorderable_list: ^0.4.2

syncfusion_flutter_core: ^19.4.38
syncfusion_flutter_datagrid:
syncfusion_flutter_sliders: ^19.4.38
syncfusion_flutter_charts: ^19.4.38
syncfusion_flutter_gauges: ^19.4.38
syncfusion_flutter_datagrid: ^20.1.57
syncfusion_flutter_core: ^20.1.57
syncfusion_flutter_sliders: ^20.1.57
syncfusion_flutter_charts: ^20.1.57
syncfusion_flutter_gauges: ^20.1.57

auto_route: ^3.2.2

Expand Down Expand Up @@ -168,7 +168,7 @@ dependencies:
get_storage:

# https://pub.dev/packages/home_widget
home_widget: ^0.1.5
home_widget: ^0.1.6

freezed_annotation: ^1.1.0
firebase_core: ^1.12.0
Expand Down
2 changes: 0 additions & 2 deletions test/mirea_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:rtu_mirea_app/service_locator.dart' as service_locator;
import 'package:shared_preferences/shared_preferences.dart';

import 'utils/calendar_test.dart' as cal_utils;

Expand Down

0 comments on commit 22aacee

Please sign in to comment.