Skip to content

Commit

Permalink
Merge pull request #37 from optimist-dev/migrate-example-to-null-safety
Browse files Browse the repository at this point in the history
Migrate example to null safety
  • Loading branch information
sanekyy committed Aug 23, 2021
2 parents 400216b + fd9152e commit 63c66e7
Show file tree
Hide file tree
Showing 82 changed files with 167 additions and 166 deletions.
23 changes: 12 additions & 11 deletions example/lib/examples_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:vk_bridge/vk_bridge.dart';

/// Main page of example app
class ExamplesPage extends StatefulWidget {
@override
_ExamplesPageState createState() => _ExamplesPageState();
Expand Down Expand Up @@ -180,8 +181,8 @@ class _ExamplesPageState extends State<ExamplesPage> {
call: (it) => it.showCommunityWidgetPreviewBox(
groupId: _vkMiniAppGroupId, type: 'text', code: '''
"return {
\"title\": \"Цитата\",
\"text\": \"Текст цитаты\"
"title": "Цитата",
"text": "Текст цитаты"
};"
'''),
),
Expand All @@ -208,9 +209,9 @@ class _ExamplesPageState extends State<ExamplesPage> {
_button(
title: 'setViewSettings',
call: (it) => it.setViewSettings(
statusBarStyle: "light",
actionBarColor: "#ff00ff",
navigationBarColor: "#ff0000",
statusBarStyle: 'light',
actionBarColor: '#ff00ff',
navigationBarColor: '#ff0000',
),
),
_button(
Expand All @@ -234,7 +235,7 @@ class _ExamplesPageState extends State<ExamplesPage> {
const Text('Interacting with Taptic Engine'),
_button(
title: 'tapticNotificationOccurred',
call: (it) => it.tapticNotificationOccurred("error"),
call: (it) => it.tapticNotificationOccurred('error'),
),
_button(
title: 'tapticSelectionChanged',
Expand Down Expand Up @@ -290,27 +291,27 @@ class _ExamplesPageState extends State<ExamplesPage> {
}

Widget _button({
@required String title,
@required Future<Object> Function(VKBridge vkBridge) call,
required String title,
required Future<dynamic> Function(VKBridge vkBridge) call,
}) {
return Padding(
padding: const EdgeInsets.all(16),
child: RaisedButton(
child: ElevatedButton(
child: Text(title),
onPressed: () => _callVKBridge(call),
),
);
}

void _callVKBridge(Future<Object> Function(VKBridge vkBridge) call) {
void _callVKBridge(Future<dynamic> Function(VKBridge vkBridge) call) {
try {
call(VKBridge.instance).then(_showResult).catchError(_showErrorDialog);
} catch (e) {
print('_callVKBridge: $e');
}
}

void _showResult(Object result) {
void _showResult(dynamic result) {
if (result == null) {
return;
}
Expand Down
16 changes: 8 additions & 8 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,14 +21,14 @@ packages:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "5.1.0"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.2"
version: "8.1.2"
characters:
dependency: transitive
description:
Expand All @@ -42,7 +42,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -101,7 +101,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
Expand All @@ -115,7 +115,7 @@ packages:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.26.0"
version: "0.27.1"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -162,7 +162,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.2"
typed_data:
dependency: transitive
description:
Expand All @@ -183,6 +183,6 @@ packages:
path: ".."
relative: true
source: path
version: "1.3.0"
version: "2.0.0"
sdks:
dart: ">=2.12.0 <3.0.0"
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/model/errors/error_data.g.dart

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

2 changes: 1 addition & 1 deletion lib/src/data/model/errors/vk_web_app_error.g.dart

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

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

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

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

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

6 changes: 3 additions & 3 deletions lib/src/data/model/launch_params.g.dart

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

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

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

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

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

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

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

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

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

Loading

0 comments on commit 63c66e7

Please sign in to comment.