File tree Expand file tree Collapse file tree 5 files changed +7
-15
lines changed
Expand file tree Collapse file tree 5 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ class _MyAppState extends State<MyApp> {
3232 // Platform messages may fail, so we use a try/catch PlatformException.
3333 // We also handle the message potentially returning null.
3434 try {
35- platformVersion = await _screenshotGuardPlugin.getPlatformVersion () ??
36- 'Unknown platform version' ;
35+ platformVersion = await _screenshotGuardPlugin.getPlatformVersion () ?? 'Unknown platform version' ;
3736 } on PlatformException {
3837 platformVersion = 'Failed to get platform version.' ;
3938 }
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ void main() {
1818 // Verify that platform version is retrieved.
1919 expect (
2020 find.byWidgetPredicate (
21- (Widget widget) =>
22- widget is Text && widget.data! .startsWith ('Running on:' ),
21+ (Widget widget) => widget is Text && widget.data! .startsWith ('Running on:' ),
2322 ),
2423 findsOneWidget,
2524 );
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ class MethodChannelScreenshotGuard extends ScreenshotGuardPlatform {
1111
1212 @override
1313 Future <String ?> getPlatformVersion () async {
14- final version =
15- await methodChannel.invokeMethod <String >('getPlatformVersion' );
14+ final version = await methodChannel.invokeMethod <String >('getPlatformVersion' );
1615 return version;
1716 }
1817
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ void main() {
99 const MethodChannel channel = MethodChannel ('screenshot_guard' );
1010
1111 setUp (() {
12- TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger
13- .setMockMethodCallHandler (
12+ TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger.setMockMethodCallHandler (
1413 channel,
1514 (MethodCall methodCall) async {
1615 return '42' ;
@@ -19,8 +18,7 @@ void main() {
1918 });
2019
2120 tearDown (() {
22- TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger
23- .setMockMethodCallHandler (channel, null );
21+ TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger.setMockMethodCallHandler (channel, null );
2422 });
2523
2624 test ('getPlatformVersion' , () async {
Original file line number Diff line number Diff line change @@ -4,9 +4,7 @@ import 'package:screenshot_guard/screenshot_guard_platform_interface.dart';
44import 'package:screenshot_guard/screenshot_guard_method_channel.dart' ;
55import 'package:plugin_platform_interface/plugin_platform_interface.dart' ;
66
7- class MockScreenshotGuardPlatform
8- with MockPlatformInterfaceMixin
9- implements ScreenshotGuardPlatform {
7+ class MockScreenshotGuardPlatform with MockPlatformInterfaceMixin implements ScreenshotGuardPlatform {
108 // Mock for enableSecureFlag method
119 @override
1210 Future <void > enableSecureFlag (bool enable) async {
@@ -20,8 +18,7 @@ class MockScreenshotGuardPlatform
2018}
2119
2220void main () {
23- final ScreenshotGuardPlatform initialPlatform =
24- ScreenshotGuardPlatform .instance;
21+ final ScreenshotGuardPlatform initialPlatform = ScreenshotGuardPlatform .instance;
2522
2623 test ('$MethodChannelScreenshotGuard is the default instance' , () {
2724 expect (initialPlatform, isInstanceOf <MethodChannelScreenshotGuard >());
You can’t perform that action at this time.
0 commit comments