Skip to content

Commit

Permalink
Merge pull request #5 from andre-paraense/null-safety
Browse files Browse the repository at this point in the history
Null safety migration
  • Loading branch information
andre-paraense authored Mar 23, 2021
2 parents 06eeb89 + 5483708 commit e2d198b
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 235 deletions.
73 changes: 19 additions & 54 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0

* Null-safety migration

## 1.0.1

* Bumping Survicate Android and iOS SDKs
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.oakam.survicate.survicate_flutter_sdk'
version '1.0.1'
version '2.0.0'

buildscript {
ext.kotlin_version = '1.3.50'
Expand Down Expand Up @@ -41,5 +41,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.survicate:survicate-sdk:1.2.3'
implementation 'com.survicate:survicate-sdk:1.2.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SurvicateFlutterSdkPlugin: FlutterPlugin, ActivityAware, MethodCallHandler
try {
channel.invokeMethod("onSurveyDisplayed", arguments)
} catch (e: Exception) {
Log.e("onSurveyDisplayed", e.message)
e.message?.let { Log.e("onSurveyDisplayed", it) }
}
})
}
Expand All @@ -84,7 +84,7 @@ class SurvicateFlutterSdkPlugin: FlutterPlugin, ActivityAware, MethodCallHandler
try {
channel.invokeMethod("onQuestionAnswered", arguments)
} catch (e: Exception) {
Log.e("onQuestionAnswered", e.message)
e.message?.let { Log.e("onQuestionAnswered", it) }
}
})
}
Expand All @@ -96,7 +96,7 @@ class SurvicateFlutterSdkPlugin: FlutterPlugin, ActivityAware, MethodCallHandler
try {
channel.invokeMethod("onSurveyClosed", arguments)
} catch (e: Exception) {
Log.e("onSurveyClosed", e.message)
e.message?.let { Log.e("onSurveyClosed", it) }
}
})
}
Expand All @@ -108,7 +108,7 @@ class SurvicateFlutterSdkPlugin: FlutterPlugin, ActivityAware, MethodCallHandler
try {
channel.invokeMethod("onSurveyCompleted", arguments)
} catch (e: Exception) {
Log.e("onSurveyCompleted", e.message)
e.message?.let { Log.e("onSurveyCompleted", it) }
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.oakam.survicate.survicate_flutter_sdk_example"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 14 additions & 20 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
SurvicateFlutterSdk survicateFlutterSdk;
String surveyIdDisplayed;
String surveyIdAnswered;
num questionIdAnswered;
SurvicateAnswerModel answer;
String surveyIdClosed;
String surveyIdCompleted;

@override
void initState() {
super.initState();
survicateFlutterSdk ??= SurvicateFlutterSdk();
}
SurvicateFlutterSdk survicateFlutterSdk= SurvicateFlutterSdk();
String? surveyIdDisplayed;
String? surveyIdAnswered;
num? questionIdAnswered;
SurvicateAnswerModel? answer;
String? surveyIdClosed;
String? surveyIdCompleted;

@override
Widget build(BuildContext context) {
Expand All @@ -41,7 +35,7 @@ class _MyAppState extends State<MyApp> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
RaisedButton(
ElevatedButton(
onPressed: () {
survicateFlutterSdk.invokeEvent('SURVEY');
},
Expand All @@ -50,13 +44,13 @@ class _MyAppState extends State<MyApp> {
SizedBox(
height: 5.0,
),
RaisedButton(
ElevatedButton(
onPressed: () {
survicateFlutterSdk.enterScreen('SCREEN');
},
child: Text('Enter screen SCREEN'),
),
RaisedButton(
ElevatedButton(
onPressed: () {
survicateFlutterSdk.leaveScreen('SCREEN');
},
Expand All @@ -65,7 +59,7 @@ class _MyAppState extends State<MyApp> {
SizedBox(
height: 5.0,
),
RaisedButton(
ElevatedButton(
onPressed: () {
survicateFlutterSdk.setUserTraits(
UserTraitsModel(userId: '1', firstName: 'USER'));
Expand All @@ -75,7 +69,7 @@ class _MyAppState extends State<MyApp> {
SizedBox(
height: 5.0,
),
RaisedButton(
ElevatedButton(
onPressed: () {
setState(() {
surveyIdDisplayed = null;
Expand All @@ -92,7 +86,7 @@ class _MyAppState extends State<MyApp> {
SizedBox(
height: 5.0,
),
RaisedButton(
ElevatedButton(
onPressed: () {
setState(() {
surveyIdDisplayed = null;
Expand Down Expand Up @@ -129,7 +123,7 @@ class _MyAppState extends State<MyApp> {
SizedBox(
height: 5.0,
),
RaisedButton(
ElevatedButton(
onPressed: () {
setState(() {
surveyIdDisplayed = null;
Expand Down
Loading

0 comments on commit e2d198b

Please sign in to comment.