Skip to content

Commit 4b78220

Browse files
committed
Upgrade packages to work with Flutter 3
1 parent b29740a commit 4b78220

File tree

11 files changed

+198
-135
lines changed

11 files changed

+198
-135
lines changed

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (github_keystorePropertiesFile.exists()) {
3232
}
3333

3434
android {
35-
compileSdkVersion 29
35+
compileSdkVersion 33
3636

3737
sourceSets {
3838
main.java.srcDirs += 'src/main/kotlin'
@@ -45,8 +45,8 @@ android {
4545
defaultConfig {
4646
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4747
applicationId "com.propakistani.wordpress_flutter"
48-
minSdkVersion 16
49-
targetSdkVersion 29
48+
minSdkVersion 23
49+
targetSdkVersion 30
5050
versionCode flutterVersionCode.toInteger()
5151
versionName flutterVersionName
5252
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.0'
9+
classpath 'com.android.tools.build:gradle:7.0.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

lib/network/wp_api.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class WpApi {
1313
try {
1414
String extra = category != 0 ? '&categories=' + '$category' : '';
1515

16-
dynamic response = await http.get(BASE_URL + 'posts?_embed&page=$page' + extra);
16+
dynamic response = await http.get(Uri.parse(BASE_URL + 'posts?_embed&page=$page' + extra));
1717
dynamic json = jsonDecode(response.body);
1818

1919
(json as List).forEach((v) {
@@ -28,7 +28,7 @@ class WpApi {
2828
static Future<List<PostCategory>> getCategoriesList({int page = 1}) async {
2929
List<PostCategory> categories = List();
3030
try {
31-
dynamic response = await http.get(BASE_URL + 'categories?orderby=count&order=desc&per_page=15&page=$page');
31+
dynamic response = await http.get(Uri.parse(BASE_URL + 'categories?orderby=count&order=desc&per_page=15&page=$page'));
3232
dynamic json = jsonDecode(response.body);
3333

3434
(json as List).forEach((v) {

lib/pages/home.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class _HomePageState extends State<HomePage> {
1818
Widget build(BuildContext context) {
1919
final themeChanger = Provider.of<ThemeChanger>(context);
2020
return Scaffold(
21-
resizeToAvoidBottomPadding: false,
21+
resizeToAvoidBottomInset: false,
2222
appBar: AppBar(
2323
title: Text(TITLE),
2424
titleSpacing: 8.0,
@@ -46,11 +46,11 @@ class _HomePageState extends State<HomePage> {
4646
items: [
4747
BottomNavigationBarItem(
4848
icon: Icon(Icons.home),
49-
title: Text('Home'),
49+
label: 'Home',
5050
),
5151
BottomNavigationBarItem(
5252
icon: Icon(Icons.category),
53-
title: Text('Categories'),
53+
label: 'Categories',
5454
),
5555
],
5656
),

lib/pages/post_details.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class PostDetails extends StatelessWidget {
1717
return Directionality(
1818
textDirection: textDirection,
1919
child: Scaffold(
20-
resizeToAvoidBottomPadding: false,
20+
resizeToAvoidBottomInset: false,
2121
body: NestedScrollView(
2222
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
2323
Size size = MediaQuery.of(context).size;

lib/tabs/home_tab.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ListHeading extends StatelessWidget {
4747
children: <Widget>[
4848
Text(
4949
title,
50-
style: Theme.of(context).textTheme.display1,
50+
style: Theme.of(context).textTheme.titleMedium,
5151
),
5252
GestureDetector(
5353
onTap: () {

lib/theme.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Style {
1313
accentColor: Color(0xFF249991),
1414
appBarTheme: AppBarTheme(
1515
textTheme: TextTheme(
16-
title: TextStyle(
16+
titleMedium: TextStyle(
1717
color: foregroundColor,
1818
fontSize: 24.0,
1919
fontWeight: FontWeight.bold,
@@ -23,8 +23,8 @@ class Style {
2323
elevation: 0,
2424
iconTheme: IconThemeData(color: foregroundColor)),
2525
textTheme: TextTheme(
26-
display1: TextStyle(color: foregroundColor, fontWeight: FontWeight.bold),
27-
body2: TextStyle(
26+
bodyText1: TextStyle(color: foregroundColor, fontWeight: FontWeight.bold),
27+
bodyText2: TextStyle(
2828
color: foregroundColor,
2929
fontWeight: FontWeight.bold,
3030
fontSize: 18.0,

lib/widgets/post_list_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PostListItem extends StatelessWidget {
4242
textAlign: TextAlign.left,
4343
maxLines: 3,
4444
overflow: TextOverflow.ellipsis,
45-
style: Theme.of(context).textTheme.body2, //TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0, fontFamily: 'Roboto'),
45+
style: Theme.of(context).textTheme.bodyText1, //TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0, fontFamily: 'Roboto'),
4646
),
4747
Row(
4848
mainAxisAlignment: MainAxisAlignment.spaceBetween,

0 commit comments

Comments
 (0)