Skip to content

Commit 874a81b

Browse files
⬆️ updates gradle version of android project.
- removes deprecated params from example. - formats example code as per new guidelines
1 parent 4ecbfbf commit 874a81b

33 files changed

+408
-653
lines changed

example/.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.38.5"
3+
}

example/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ pubspec.lock
5353
/windows/flutter/generated_plugin_registrant.cc
5454
/windows/flutter/generated_plugin_registrant.h
5555
/windows/flutter/generated_plugins.cmake
56+
57+
# FVM Version Cache
58+
.fvm/

example/android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
/app/.cxx/
13+
/build/

example/android/app/build.gradle

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,37 @@ if (flutterVersionName == null) {
2323
}
2424

2525
android {
26-
compileSdkVersion 34
26+
namespace 'com.simformsolutions.calendarview'
27+
28+
compileSdkVersion 36
29+
ndkVersion "26.3.11579264"
2730

2831
sourceSets {
2932
main.java.srcDirs += 'src/main/kotlin'
3033
}
3134

35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_21
37+
targetCompatibility JavaVersion.VERSION_21
38+
}
39+
40+
kotlin {
41+
jvmToolchain(21)
42+
}
43+
3244
defaultConfig {
33-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3445
applicationId "com.simformsolutions.calendarview"
3546
minSdkVersion flutter.minSdkVersion
36-
targetSdkVersion 31
47+
targetSdkVersion 36
3748
versionCode flutterVersionCode.toInteger()
3849
versionName flutterVersionName
3950
}
4051

4152
buildTypes {
4253
release {
43-
// TODO: Add your own signing config for the release build.
44-
// Signing with the debug keys for now, so `flutter run --release` works.
4554
signingConfig signingConfigs.debug
4655
}
4756
}
48-
namespace 'com.simformsolutions.calendarview'
4957
}
5058

5159
flutter {

example/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-7.6.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.4.2" apply false
22-
id "org.jetbrains.kotlin.android" version "1.7.0" apply false
21+
id "com.android.application" version "8.9.2" apply false
22+
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
2323
}
2424

2525
include ":app"

example/ios/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ Runner/GeneratedPluginRegistrant.*
3030
!default.mode2v3
3131
!default.pbxuser
3232
!default.perspectivev3
33+
/Flutter/ephemeral

example/lib/constants.dart

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,25 @@ class AppConstants {
99

1010
static OutlineInputBorder inputBorder = OutlineInputBorder(
1111
borderRadius: BorderRadius.circular(7),
12-
borderSide: BorderSide(
13-
width: 2,
14-
color: AppColors.outlineVariant,
15-
),
12+
borderSide: BorderSide(width: 2, color: AppColors.outlineVariant),
1613
);
1714

1815
static InputDecoration get inputDecoration => InputDecoration(
19-
border: inputBorder,
20-
disabledBorder: inputBorder,
21-
errorBorder: inputBorder.copyWith(
22-
borderSide: BorderSide(
23-
width: 2,
24-
color: AppColors.red,
25-
),
26-
),
27-
enabledBorder: inputBorder,
28-
focusedBorder: inputBorder,
29-
focusedErrorBorder: inputBorder,
30-
hintText: "Event Title",
31-
hintStyle: TextStyle(
32-
color: AppColors.black,
33-
fontSize: 17,
34-
),
35-
labelStyle: TextStyle(
36-
color: AppColors.black,
37-
fontSize: 17,
38-
),
39-
helperStyle: TextStyle(
40-
color: AppColors.black,
41-
fontSize: 17,
42-
),
43-
errorStyle: TextStyle(
44-
color: AppColors.red,
45-
fontSize: 12,
46-
),
47-
contentPadding: EdgeInsets.symmetric(
48-
vertical: 10,
49-
horizontal: 20,
50-
),
51-
);
16+
border: inputBorder,
17+
disabledBorder: inputBorder,
18+
errorBorder: inputBorder.copyWith(
19+
borderSide: BorderSide(width: 2, color: AppColors.red),
20+
),
21+
enabledBorder: inputBorder,
22+
focusedBorder: inputBorder,
23+
focusedErrorBorder: inputBorder,
24+
hintText: "Event Title",
25+
hintStyle: TextStyle(color: AppColors.black, fontSize: 17),
26+
labelStyle: TextStyle(color: AppColors.black, fontSize: 17),
27+
helperStyle: TextStyle(color: AppColors.black, fontSize: 17),
28+
errorStyle: TextStyle(color: AppColors.red, fontSize: 12),
29+
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
30+
);
5231
}
5332

5433
class BreakPoints {

example/lib/enumerations.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
enum CalendarView {
2-
month,
3-
day,
4-
week,
5-
}
1+
enum CalendarView { month, day, week }

example/lib/extension.dart

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,16 @@ extension DateUtils on DateTime {
7979
int? second,
8080
int? millisecond,
8181
int? microsecond,
82-
}) =>
83-
DateTime(
84-
year ?? this.year,
85-
month ?? this.month,
86-
day ?? this.day,
87-
hour ?? this.hour,
88-
minute ?? this.minute,
89-
second ?? this.second,
90-
millisecond ?? this.millisecond,
91-
microsecond ?? this.microsecond,
92-
);
82+
}) => DateTime(
83+
year ?? this.year,
84+
month ?? this.month,
85+
day ?? this.day,
86+
hour ?? this.hour,
87+
minute ?? this.minute,
88+
second ?? this.second,
89+
millisecond ?? this.millisecond,
90+
microsecond ?? this.microsecond,
91+
);
9392

9493
String dateToStringWithFormat({String format = 'y-M-d'}) {
9594
return DateFormat(format).format(this);
@@ -98,13 +97,11 @@ extension DateUtils on DateTime {
9897
DateTime stringToDateWithFormat({
9998
required String format,
10099
required String dateString,
101-
}) =>
102-
DateFormat(format).parse(dateString);
100+
}) => DateFormat(format).parse(dateString);
103101

104-
String getTimeInFormat(TimeStampFormat format) =>
105-
DateFormat('h:mm${format == TimeStampFormat.parse_12 ? " a" : ""}')
106-
.format(this)
107-
.toUpperCase();
102+
String getTimeInFormat(TimeStampFormat format) => DateFormat(
103+
'h:mm${format == TimeStampFormat.parse_12 ? " a" : ""}',
104+
).format(this).toUpperCase();
108105

109106
bool compareWithoutTime(DateTime date) =>
110107
day == date.day && month == date.month && year == date.year;

0 commit comments

Comments
 (0)