Skip to content

Commit

Permalink
🎨 格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesZero committed Dec 28, 2024
1 parent 1965646 commit ca846a4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
1 change: 0 additions & 1 deletion example/integration_test/plugin_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// For more information about Flutter integration tests, please see
// https://flutter.dev/to/integration-testing


import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class _MyAppState extends State<MyApp> {
// Platform messages may fail, so we use a try/catch PlatformException.
// We also handle the message potentially returning null.
try {
platformVersion =
await _flutterOhosAdsPlugin.getPlatformVersion() ?? 'Unknown platform version';
platformVersion = await _flutterOhosAdsPlugin.getPlatformVersion() ??
'Unknown platform version';
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
Expand Down
4 changes: 2 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data!.startsWith('Running on:'),
(Widget widget) =>
widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
1 change: 0 additions & 1 deletion lib/flutter_ohos_ads.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'flutter_ohos_ads_platform_interface.dart';

class FlutterOhosAds {
Expand Down
3 changes: 2 additions & 1 deletion lib/flutter_ohos_ads_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class MethodChannelFlutterOhosAds extends FlutterOhosAdsPlatform {

@override
Future<String?> getPlatformVersion() async {
final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
final version =
await methodChannel.invokeMethod<String>('getPlatformVersion');
return version;
}
}
6 changes: 4 additions & 2 deletions test/flutter_ohos_ads_method_channel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ void main() {
const MethodChannel channel = MethodChannel('flutter_ohos_ads');

setUp(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
(MethodCall methodCall) async {
return '42';
Expand All @@ -18,7 +19,8 @@ void main() {
});

tearDown(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null);
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, null);
});

test('getPlatformVersion', () async {
Expand Down
4 changes: 2 additions & 2 deletions test/flutter_ohos_ads_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart';
class MockFlutterOhosAdsPlatform
with MockPlatformInterfaceMixin
implements FlutterOhosAdsPlatform {

@override
Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
final FlutterOhosAdsPlatform initialPlatform = FlutterOhosAdsPlatform.instance;
final FlutterOhosAdsPlatform initialPlatform =
FlutterOhosAdsPlatform.instance;

test('$MethodChannelFlutterOhosAds is the default instance', () {
expect(initialPlatform, isInstanceOf<MethodChannelFlutterOhosAds>());
Expand Down

0 comments on commit ca846a4

Please sign in to comment.