-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:firebase_analytics/firebase_analytics.dart' as g; | ||
|
||
// A really hack way to handle that in unsupported platforms, firebase throws | ||
// exception while calling `FirebaseAnalytics.instance`. | ||
class FirebaseAnalytics { | ||
static dynamic get instance { | ||
try { | ||
return g.FirebaseAnalytics.instance; | ||
} catch (e) { | ||
return Noop(); | ||
} | ||
} | ||
} | ||
|
||
class Noop { | ||
// So, everything goes noop... | ||
// Thankfully we don't rely on the return value of any firebase methods. | ||
@override | ||
noSuchMethod(Invocation invocation) { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters