Skip to content

Commit

Permalink
feat: Show osm attribution + removed matomo_tracker fork (#2740)
Browse files Browse the repository at this point in the history
* feat: Show osm attribution + removed matomo_tracker fork

* shorten attribution

* Added back contributors
  • Loading branch information
M123-dev authored Aug 8, 2022
1 parent a6e22dd commit f6f8511
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 56 deletions.
6 changes: 2 additions & 4 deletions packages/smooth_app/lib/helpers/analytics_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ class AnalyticsHelper {
siteId: 2,
visitorId: uuid,
);
MatomoTracker.instance.visitor = Visitor(
id: uuid,
userId: OpenFoodAPIConfiguration.globalUser?.userId,
);
MatomoTracker.instance
.setVisitorUserId(OpenFoodAPIConfiguration.globalUser?.userId);
} catch (err) {
// With Hot Reload, this may trigger a late field already initialized
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:openfoodfacts/model/KnowledgePanelElement.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/helpers/launch_url_helper.dart';

class KnowledgePanelWorldMapCard extends StatelessWidget {
const KnowledgePanelWorldMapCard(this.mapElement);
Expand Down Expand Up @@ -38,6 +39,41 @@ class KnowledgePanelWorldMapCard extends StatelessWidget {
markers: getMarkers(mapElement.pointers),
),
],
nonRotatedChildren: <Widget>[
AttributionWidget(
attributionBuilder: (BuildContext context) {
return Align(
alignment: Alignment.bottomRight,
child: ColoredBox(
color: const Color(0xCCFFFFFF),
child: GestureDetector(
onTap: () => LaunchUrlHelper.launchURL(
'https://www.openstreetmap.org/copyright',
false,
),
child: Padding(
padding: const EdgeInsets.all(3),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'© OpenStreetMap contributors',
style: Theme.of(context)
.textTheme
.bodyText2!
.copyWith(
color: Colors.blue,
),
),
],
),
),
),
),
);
},
)
],
),
),
);
Expand Down
Loading

0 comments on commit f6f8511

Please sign in to comment.