Skip to content

Commit 426877c

Browse files
committed
- updated dependencies to use latest flutter version
1 parent 5dac20d commit 426877c

File tree

16 files changed

+143
-204
lines changed

16 files changed

+143
-204
lines changed

android/app/build.gradle

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,11 +22,8 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26-
2725
android {
28-
compileSdkVersion 33
26+
compileSdkVersion 34
2927

3028
lintOptions {
3129
disable 'InvalidPackage'
@@ -34,8 +32,8 @@ android {
3432
defaultConfig {
3533
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3634
applicationId "com.iotecksolutions.todoapp"
37-
minSdkVersion 16
38-
targetSdkVersion 33
35+
minSdkVersion flutter.minSdkVersion
36+
targetSdkVersion 34
3937
versionCode flutterVersionCode.toInteger()
4038
versionName flutterVersionName
4139
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -58,4 +56,4 @@ dependencies {
5856
testImplementation 'junit:junit:4.12'
5957
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
6058
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
61-
}
59+
}

android/build.gradle

-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
buildscript {
2-
repositories {
3-
google()
4-
mavenCentral()
5-
}
6-
7-
dependencies {
8-
classpath 'com.android.tools.build:gradle:7.3.1'
9-
}
10-
}
11-
121
allprojects {
132
repositories {
143
google()

android/settings.gradle

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
411

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
917
}
1018

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
1523
}
24+
25+
include ":app"

lib/constants/app_theme.dart

+16-20
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AppThemeData {
2929
static final Color _darkFocusColor = Colors.white.withOpacity(0.12);
3030

3131
static ThemeData lightThemeData =
32-
themeData(lightColorScheme, _lightFocusColor);
32+
themeData(lightColorScheme, _lightFocusColor);
3333
static ThemeData darkThemeData = themeData(darkColorScheme, _darkFocusColor);
3434

3535
static ThemeData themeData(ColorScheme colorScheme, Color focusColor) {
@@ -39,13 +39,13 @@ class AppThemeData {
3939
// Matches manifest.json colors and background color.
4040
primaryColor: const Color(0xFF030303),
4141
appBarTheme: AppBarTheme(
42-
backgroundColor: colorScheme.background,
42+
backgroundColor: colorScheme.surface,
4343
elevation: 0,
4444
iconTheme: IconThemeData(color: colorScheme.primary),
4545
),
4646
iconTheme: IconThemeData(color: colorScheme.onPrimary),
47-
canvasColor: colorScheme.background,
48-
scaffoldBackgroundColor: colorScheme.background,
47+
canvasColor: colorScheme.surface,
48+
scaffoldBackgroundColor: colorScheme.surface,
4949
highlightColor: Colors.transparent,
5050
focusColor: focusColor,
5151
snackBarTheme: SnackBarThemeData(
@@ -54,7 +54,7 @@ class AppThemeData {
5454
_lightFillColor.withOpacity(0.80),
5555
_darkFillColor,
5656
),
57-
contentTextStyle: _textTheme.subtitle1!.apply(color: _darkFillColor),
57+
contentTextStyle: _textTheme.titleMedium!.apply(color: _darkFillColor),
5858
),
5959
);
6060
}
@@ -64,9 +64,7 @@ class AppThemeData {
6464
primaryContainer: Color(0xFF9e1718),
6565
secondary: Color(0xFFEFF3F3),
6666
secondaryContainer: Color(0xFFFAFBFB),
67-
background: Color(0xFFE6EBEB),
6867
surface: Color(0xFFFAFBFB),
69-
onBackground: Colors.white,
7068
error: _lightFillColor,
7169
onError: _lightFillColor,
7270
onPrimary: _lightFillColor,
@@ -80,9 +78,7 @@ class AppThemeData {
8078
primaryContainer: Color(0xFF1CDEC9),
8179
secondary: Color(0xFF4D1F7C),
8280
secondaryContainer: Color(0xFF451B6F),
83-
background: Color(0xFF241E30),
8481
surface: Color(0xFF1F1929),
85-
onBackground: Color(0x0DFFFFFF),
8682
// White with 0.05 opacity
8783
error: _darkFillColor,
8884
onError: _darkFillColor,
@@ -98,15 +94,15 @@ class AppThemeData {
9894
static const _bold = FontWeight.w700;
9995

10096
static final TextTheme _textTheme = TextTheme(
101-
headline4: GoogleFonts.montserrat(fontWeight: _bold, fontSize: 20.0),
102-
caption: GoogleFonts.oswald(fontWeight: _semiBold, fontSize: 16.0),
103-
headline5: GoogleFonts.oswald(fontWeight: _medium, fontSize: 16.0),
104-
subtitle1: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 16.0),
105-
overline: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 12.0),
106-
bodyText1: GoogleFonts.montserrat(fontWeight: _regular, fontSize: 14.0),
107-
subtitle2: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 14.0),
108-
bodyText2: GoogleFonts.montserrat(fontWeight: _regular, fontSize: 16.0),
109-
headline6: GoogleFonts.montserrat(fontWeight: _bold, fontSize: 16.0),
110-
button: GoogleFonts.montserrat(fontWeight: _semiBold, fontSize: 14.0),
97+
headlineMedium: GoogleFonts.montserrat(fontWeight: _bold, fontSize: 20.0),
98+
bodySmall: GoogleFonts.oswald(fontWeight: _semiBold, fontSize: 16.0),
99+
headlineSmall: GoogleFonts.oswald(fontWeight: _medium, fontSize: 16.0),
100+
titleMedium: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 16.0),
101+
labelSmall: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 12.0),
102+
bodyLarge: GoogleFonts.montserrat(fontWeight: _regular, fontSize: 14.0),
103+
titleSmall: GoogleFonts.montserrat(fontWeight: _medium, fontSize: 14.0),
104+
bodyMedium: GoogleFonts.montserrat(fontWeight: _regular, fontSize: 16.0),
105+
titleLarge: GoogleFonts.montserrat(fontWeight: _bold, fontSize: 16.0),
106+
labelLarge: GoogleFonts.montserrat(fontWeight: _semiBold, fontSize: 14.0),
111107
);
112-
}
108+
}

lib/core/data/network/dio/interceptors/logging_interceptor.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class LoggingInterceptor extends Interceptor {
175175

176176
@override
177177
void onError(
178-
DioError err,
178+
DioException err,
179179
ErrorInterceptorHandler handler,
180180
) {
181181
if (level == Level.none) {

lib/core/data/network/dio/interceptors/retry_interceptor.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class RetryInterceptor extends Interceptor {
1515
}) : options = options ?? const RetryOptions();
1616

1717
@override
18-
Future<void> onError(DioError err, ErrorInterceptorHandler handler) async {
18+
Future<void> onError(
19+
DioException err, ErrorInterceptorHandler handler) async {
1920
var extra = RetryOptions.fromExtra(err.requestOptions, options);
2021

2122
final shouldRetry = extra.retries > 0 && await options.retryEvaluator(err);
@@ -52,7 +53,7 @@ class RetryInterceptor extends Interceptor {
5253
}
5354
}
5455

55-
typedef RetryEvaluator = FutureOr<bool> Function(DioError error);
56+
typedef RetryEvaluator = FutureOr<bool> Function(DioException error);
5657

5758
extension RequestOptionsExtensions on RequestOptions {
5859
Options toOptions() {
@@ -89,8 +90,7 @@ class RetryOptions {
8990
/// with concurrency though).
9091
///
9192
/// Defaults to [defaultRetryEvaluator].
92-
RetryEvaluator get retryEvaluator =>
93-
_retryEvaluator ?? defaultRetryEvaluator;
93+
RetryEvaluator get retryEvaluator => _retryEvaluator ?? defaultRetryEvaluator;
9494

9595
final RetryEvaluator? _retryEvaluator;
9696

@@ -110,9 +110,9 @@ class RetryOptions {
110110

111111
/// Returns [true] only if the response hasn't been cancelled or got
112112
/// a bad status code.
113-
static FutureOr<bool> defaultRetryEvaluator(DioError error) {
114-
final cancelError = error.type != DioErrorType.cancel;
115-
final responseError = error.type != DioErrorType.badResponse;
113+
static FutureOr<bool> defaultRetryEvaluator(DioException error) {
114+
final cancelError = error.type != DioExceptionType.cancel;
115+
final responseError = error.type != DioExceptionType.badResponse;
116116
final shouldRetry = cancelError && responseError;
117117
return shouldRetry;
118118
}

lib/core/widgets/textfield_widget.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ class TextFieldWidget extends StatelessWidget {
3131
obscureText: this.isObscure,
3232
maxLength: 25,
3333
keyboardType: this.inputType,
34-
style: Theme.of(context).textTheme.bodyText1,
34+
style: Theme.of(context).textTheme.bodyLarge,
3535
decoration: InputDecoration(
3636
hintText: this.hint,
37-
hintStyle:
38-
Theme.of(context).textTheme.bodyText1!.copyWith(color: hintColor),
37+
hintStyle: Theme.of(context)
38+
.textTheme
39+
.bodyLarge!
40+
.copyWith(color: hintColor),
3941
errorText: errorText,
4042
counterText: '',
4143
icon: this.isIcon ? Icon(this.icon, color: iconColor) : null),
@@ -61,5 +63,4 @@ class TextFieldWidget extends StatelessWidget {
6163
this.autoFocus = false,
6264
this.inputAction,
6365
}) : super(key: key);
64-
6566
}

lib/data/network/interceptors/error_interceptor.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ class ErrorInterceptor extends Interceptor {
77
ErrorInterceptor(this._eventBus);
88

99
@override
10-
void onError(DioError err, ErrorInterceptorHandler handler) {
10+
void onError(DioException err, ErrorInterceptorHandler handler) {
1111
_eventBus.fire(
12-
ErrorEvent(
13-
path: err.requestOptions.path,
14-
response: err.response),
12+
ErrorEvent(path: err.requestOptions.path, response: err.response),
1513
);
1614
super.onError(err, handler);
1715
}

lib/presentation/home/home.dart

+15-18
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:boilerplate/utils/locale/app_localization.dart';
77
import 'package:boilerplate/utils/routes/routes.dart';
88
import 'package:flutter/material.dart';
99
import 'package:flutter_mobx/flutter_mobx.dart';
10-
import 'package:material_dialog/material_dialog.dart';
1110
import 'package:shared_preferences/shared_preferences.dart';
1211

1312
class HomeScreen extends StatefulWidget {
@@ -87,31 +86,29 @@ class _HomeScreenState extends State<HomeScreen> {
8786
_buildLanguageDialog() {
8887
_showDialog<String>(
8988
context: context,
90-
child: MaterialDialog(
91-
borderRadius: 5.0,
92-
enableFullWidth: true,
89+
child: AlertDialog(
90+
// borderRadius: 5.0,
91+
// enableFullWidth: true,
92+
9393
title: Text(
9494
AppLocalizations.of(context).translate('home_tv_choose_language'),
95-
style: TextStyle(
96-
color: Colors.white,
97-
fontSize: 16.0,
98-
),
9995
),
100-
headerColor: Theme.of(context).primaryColor,
96+
// headerColor: Theme.of(context).primaryColor,
10197
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
102-
closeButtonColor: Colors.white,
103-
enableCloseButton: true,
104-
enableBackButton: false,
105-
onCloseButtonClicked: () {
106-
Navigator.of(context).pop();
107-
},
108-
children: _languageStore.supportedLanguages
98+
// closeButtonColor: Colors.white,
99+
// enableCloseButton: true,
100+
// enableBackButton: false,
101+
// onCloseButtonClicked: () {
102+
// Navigator.of(context).pop();
103+
// },
104+
actions: _languageStore.supportedLanguages
105+
// children: _languageStore.supportedLanguages
109106
.map(
110107
(object) => ListTile(
111108
dense: true,
112109
contentPadding: EdgeInsets.all(0.0),
113110
title: Text(
114-
object.language!,
111+
object.language,
115112
style: TextStyle(
116113
color: _languageStore.locale == object.locale
117114
? Theme.of(context).primaryColor
@@ -123,7 +120,7 @@ class _HomeScreenState extends State<HomeScreen> {
123120
onTap: () {
124121
Navigator.of(context).pop();
125122
// change user language based on selected locale
126-
_languageStore.changeLanguage(object.locale!);
123+
_languageStore.changeLanguage(object.locale);
127124
},
128125
),
129126
)

lib/presentation/login/login.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class _LoginScreenState extends State<LoginScreen> {
173173
AppLocalizations.of(context).translate('login_btn_forgot_password'),
174174
style: Theme.of(context)
175175
.textTheme
176-
.caption
176+
.bodySmall
177177
?.copyWith(color: Colors.orangeAccent),
178178
),
179179
onPressed: () {},

lib/presentation/post/post_list.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class _PostListScreenState extends State<PostListScreen> {
7777
maxLines: 1,
7878
overflow: TextOverflow.ellipsis,
7979
softWrap: false,
80-
style: Theme.of(context).textTheme.subtitle1,
80+
style: Theme.of(context).textTheme.titleMedium,
8181
),
8282
subtitle: Text(
8383
'${_postStore.postList?.posts?[position].body}',

lib/presentation/post/store/post_store.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ abstract class _PostStore with Store {
4646
future.then((postList) {
4747
this.postList = postList;
4848
}).catchError((error) {
49-
errorStore.errorMessage = DioErrorUtil.handleError(error);
49+
errorStore.errorMessage = DioExceptionUtil.handleError(error);
5050
});
5151
}
5252
}

0 commit comments

Comments
 (0)