Skip to content

Commit be19764

Browse files
author
ruta_v
committed
Release 1.0.1 version with updated documentation
1 parent 1a5e672 commit be19764

6 files changed

Lines changed: 35 additions & 34 deletions

File tree

example/integration_test/plugin_integration_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// For more information about Flutter integration tests, please see
77
// https://docs.flutter.dev/cookbook/testing/integration/introduction
88

9-
109
import 'package:flutter_test/flutter_test.dart';
1110
import 'package:integration_test/integration_test.dart';
1211

example/lib/main.dart

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,37 @@ class _MyAppState extends State<MyAppState> {
4141

4242
final _bannerController = PrebidAdController();
4343
final _interstitialController = PrebidAdController();
44-
44+
4545
@override
4646
void initState() {
47-
super.initState();
47+
super.initState();
4848

49-
WidgetsFlutterBinding.ensureInitialized()
50-
.addPostFrameCallback((_) => initPlugin());
49+
WidgetsFlutterBinding.ensureInitialized()
50+
.addPostFrameCallback((_) => initPlugin());
5151
}
5252

5353
Future<void> showCustomTrackingDialog(BuildContext context) async =>
54-
await showDialog<void>(
55-
context: context,
56-
builder: (context) => AlertDialog(
57-
title: const Text('Dear User'),
58-
content: const Text(
59-
'We care about your privacy and data security. We keep this app free by showing ads. '
60-
'Can we continue to use your data to tailor ads for you?\n\nYou can change your choice anytime in the app settings. '
61-
'Our partners will collect data and use a unique identifier on your device to show you ads.',
62-
),
63-
actions: [
64-
TextButton(
65-
onPressed: () => Navigator.pop(context),
66-
child: const Text('Continue'),
54+
await showDialog<void>(
55+
context: context,
56+
builder: (context) => AlertDialog(
57+
title: const Text('Dear User'),
58+
content: const Text(
59+
'We care about your privacy and data security. We keep this app free by showing ads. '
60+
'Can we continue to use your data to tailor ads for you?\n\nYou can change your choice anytime in the app settings. '
61+
'Our partners will collect data and use a unique identifier on your device to show you ads.',
6762
),
68-
],
69-
),
70-
);
63+
actions: [
64+
TextButton(
65+
onPressed: () => Navigator.pop(context),
66+
child: const Text('Continue'),
67+
),
68+
],
69+
),
70+
);
7171

7272
Future<void> initPlugin() async {
7373
final TrackingStatus status =
74-
await AppTrackingTransparency.trackingAuthorizationStatus;
74+
await AppTrackingTransparency.trackingAuthorizationStatus;
7575
if (status == TrackingStatus.notDetermined) {
7676
await showCustomTrackingDialog(context);
7777
await Future.delayed(const Duration(milliseconds: 200));
@@ -82,7 +82,6 @@ class _MyAppState extends State<MyAppState> {
8282

8383
bool _showInterstitial = false;
8484

85-
8685
@override
8786
Widget build(BuildContext context) {
8887
return Scaffold(
@@ -145,4 +144,3 @@ class _MyAppState extends State<MyAppState> {
145144
);
146145
}
147146
}
148-

example/test/widget_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ void main() {
1818
// Verify that platform version is retrieved.
1919
expect(
2020
find.byWidgetPredicate(
21-
(Widget widget) => widget is Text &&
22-
widget.data!.startsWith('Running on:'),
21+
(Widget widget) =>
22+
widget is Text && widget.data!.startsWith('Running on:'),
2323
),
2424
findsOneWidget,
2525
);

lib/prebid_mobile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class PrebidMobile {
77
///initializeSDK() passes to the native side Prebid account ID
88
Future<void> initializeSDK(
99
String prebidAccountID, int timeoutMillis, bool pbsDebug) {
10-
const MethodChannel channel = MethodChannel(
11-
'setupad.plugin.setupad_prebid_flutter/myChannel_0');
10+
const MethodChannel channel =
11+
MethodChannel('setupad.plugin.setupad_prebid_flutter/myChannel_0');
1212
return channel.invokeMethod('startPrebid', {
1313
"accountID": prebidAccountID,
1414
"timeoutMillis": timeoutMillis,

test/setupad_prebid_flutter_method_channel_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import 'package:setupad_prebid_flutter/setupad_prebid_flutter_method_channel.dar
55
void main() {
66
TestWidgetsFlutterBinding.ensureInitialized();
77

8-
MethodChannelSetupadPrebidFlutter platform = MethodChannelSetupadPrebidFlutter();
8+
MethodChannelSetupadPrebidFlutter platform =
9+
MethodChannelSetupadPrebidFlutter();
910
const MethodChannel channel = MethodChannel('setupad_prebid_flutter');
1011

1112
setUp(() {
12-
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
13+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
14+
.setMockMethodCallHandler(
1315
channel,
1416
(MethodCall methodCall) async {
1517
return '42';
@@ -18,7 +20,8 @@ void main() {
1820
});
1921

2022
tearDown(() {
21-
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null);
23+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
24+
.setMockMethodCallHandler(channel, null);
2225
});
2326

2427
test('getPlatformVersion', () async {

test/setupad_prebid_flutter_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart';
77
class MockSetupadPrebidFlutterPlatform
88
with MockPlatformInterfaceMixin
99
implements SetupadPrebidFlutterPlatform {
10-
1110
@override
1211
Future<String?> getPlatformVersion() => Future.value('42');
1312
}
1413

1514
void main() {
16-
final SetupadPrebidFlutterPlatform initialPlatform = SetupadPrebidFlutterPlatform.instance;
15+
final SetupadPrebidFlutterPlatform initialPlatform =
16+
SetupadPrebidFlutterPlatform.instance;
1717

1818
test('$MethodChannelSetupadPrebidFlutter is the default instance', () {
1919
expect(initialPlatform, isInstanceOf<MethodChannelSetupadPrebidFlutter>());
2020
});
2121

2222
test('getPlatformVersion', () async {
2323
SetupadPrebidFlutter setupadPrebidFlutterPlugin = SetupadPrebidFlutter();
24-
MockSetupadPrebidFlutterPlatform fakePlatform = MockSetupadPrebidFlutterPlatform();
24+
MockSetupadPrebidFlutterPlatform fakePlatform =
25+
MockSetupadPrebidFlutterPlatform();
2526
SetupadPrebidFlutterPlatform.instance = fakePlatform;
2627

2728
expect(await setupadPrebidFlutterPlugin.getPlatformVersion(), '42');

0 commit comments

Comments
 (0)