Compare commits
3 Commits
001897bbcd
...
a593b52812
Author | SHA1 | Date | |
---|---|---|---|
|
a593b52812 | ||
|
520dc80303 | ||
|
bab29c23e3 |
@@ -1,6 +1,8 @@
|
|||||||
|
import 'dart:io' show Platform;
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/screens/about.dart';
|
import 'package:island/screens/about.dart';
|
||||||
@@ -70,13 +72,21 @@ Widget _tabPagesTransitionBuilder(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get _supportsAnalytics =>
|
||||||
|
kIsWeb ||
|
||||||
|
Platform.isAndroid ||
|
||||||
|
Platform.isIOS ||
|
||||||
|
Platform.isMacOS ||
|
||||||
|
Platform.isWindows;
|
||||||
|
|
||||||
// Provider for the router
|
// Provider for the router
|
||||||
final routerProvider = Provider<GoRouter>((ref) {
|
final routerProvider = Provider<GoRouter>((ref) {
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
navigatorKey: rootNavigatorKey,
|
navigatorKey: rootNavigatorKey,
|
||||||
initialLocation: '/',
|
initialLocation: '/',
|
||||||
observers: [
|
observers: [
|
||||||
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
|
if (_supportsAnalytics)
|
||||||
|
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
|
||||||
],
|
],
|
||||||
routes: [
|
routes: [
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
|
Reference in New Issue
Block a user