deniza / app_tracking_transparency

A Flutter plugin to show ios 14+ tracking authorization dialog.
https://pub.dev/packages/app_tracking_transparency/
MIT License
83 stars 28 forks source link

Rework plateform checking #30

Closed ghost closed 1 year ago

ghost commented 2 years ago

Flutter doc suggest to use Platform.iOS inside views and defaultTargetPlatform for API. This allow use to override defaultTargetPlatform on unit test and manage Platform through context inside widget testing.

// Change this
Platform.isIOS

// To this
defaultTargetPlatform == TargetPlatform.iOS

https://api.flutter.dev/flutter/foundation/defaultTargetPlatform.html

deniza commented 1 year ago

merged. thanks for the contribution :)