Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mobile-v3/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
android/secrets.properties

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
Expand Down
16 changes: 8 additions & 8 deletions src/mobile-v3/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ if (localPropertiesFile.exists()) {
}
}

def googleMapApiKey = appProperties.getProperty('google.maps.key') ?: secrets.getProperty('MAPS_API_KEY')
if (googleMapApiKey == null) {
//def googleMapApiKey = appProperties.getProperty('google.maps.key') ?: secrets.getProperty('MAPS_API_KEY')
/*if (googleMapApiKey == null) {
throw new GradleException("Google Maps Key not found. Define either google.maps.key in key.properties or MAPS_API_KEY in secrets.properties")
}
}*/

def googleMapApiKeyDev = appProperties.getProperty('google.maps.key.dev') ?: secrets.getProperty('MAPS_API_KEY_DEV')
if (googleMapApiKeyDev == null) {
//def googleMapApiKeyDev = appProperties.getProperty('google.maps.key.dev') ?: secrets.getProperty('MAPS_API_KEY_DEV')
/*if (googleMapApiKeyDev == null) {
throw new GradleException("Google Maps Dev Key not found. Define either google.maps.key.dev in key.properties or MAPS_API_KEY_DEV in secrets.properties")
}
}*/


def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand Down Expand Up @@ -103,7 +103,7 @@ android {
versionName flutterVersionName
}

flavorDimensions "airqo"
/*flavorDimensions "airqo"
productFlavors {
airqo {
dimension "airqo"
Expand All @@ -120,7 +120,7 @@ android {
]
}

}
}*/

signingConfigs {
release {
Expand Down
2 changes: 1 addition & 1 deletion src/mobile-v3/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- TODO: Add your Google Maps API key here -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="${googleMapsKey}" />
android:value="${MAPS_API_KEY}" />
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
25 changes: 0 additions & 25 deletions src/mobile-v3/android/settings.gradle.kts

This file was deleted.

Binary file added src/mobile-v3/assets/images/airQo_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 60 additions & 47 deletions src/mobile-v3/lib/src/app/dashboard/widgets/analytics_specifics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import 'package:airqo/src/app/dashboard/widgets/expanded_analytics_card.dart';
import 'package:airqo/src/app/dashboard/widgets/analytics_forecast_widget.dart';
import 'package:airqo/src/meta/utils/colors.dart';
import 'package:flutter/material.dart';
import 'package:share_plus/share_plus.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flutter/services.dart';
import 'dart:io';

class AnalyticsSpecifics extends StatefulWidget {
final Measurement measurement;
Expand Down Expand Up @@ -62,6 +67,38 @@ class _AnalyticsSpecificsState extends State<AnalyticsSpecifics> {
"Unknown location";
}

void _shareAirQualityData() async {
try {
final location = _getLocationDescription(widget.measurement);
//final locationId = widget.measurement.siteId ?? '';
final deepLink =
'https://airqo.net/products/mobile-app';

final shareText = '''
Check out the Air Quality of $location on the AirQo app!
👉 $deepLink
''';
// Load AirQo logo from assets
final byteData = await rootBundle.load('assets/images/airQo_logo.png');

final tempDir = await getTemporaryDirectory();
final logoFile = await File(
'${tempDir.path}/airqo_logo_${DateTime.now().millisecondsSinceEpoch}.png')
.writeAsBytes(
byteData.buffer.asUint8List(),
);

// Share with logo and text
await Share.shareXFiles(
[XFile(logoFile.path)],
text: shareText,
subject: 'Air Quality Update from AirQo',
);
} catch (e) {
print("Error sharing data: $e");
}
}

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
Expand All @@ -86,58 +123,34 @@ class _AnalyticsSpecificsState extends State<AnalyticsSpecifics> {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24,
color: AppColors.boldHeadlineColor,
color: AppColors.boldHeadlineColor4,
),
overflow: TextOverflow.ellipsis,
),
),
InkWell(
onTap: () => Navigator.pop(context),
child: Icon(
Icons.close,
color: AppColors.boldHeadlineColor,
),
)
],
),
const SizedBox(height: 4),
Row(
children: [
Icon(
Icons.location_on,
size: 14,
color: AppColors.primaryColor,
),
const SizedBox(width: 4),
Expanded(
child: Text(
_getLocationDescription(widget.measurement),
style: TextStyle(
fontSize: 14,
color: Theme.of(context)
.textTheme
.bodyMedium
?.color
?.withOpacity(0.7),
Row(
mainAxisSize: MainAxisSize.min,
children: [
// Share button with emoji
InkWell(
onTap: _shareAirQualityData,
borderRadius: BorderRadius.circular(20),
child: Container(
padding: const EdgeInsets.all(8),
child: SvgPicture.asset(
"assets/icons/share-icon.svg",
height: 24,
width: 24,
colorFilter: ColorFilter.mode(
AppColors.boldHeadlineColor4,
BlendMode.srcIn,
),
),
),
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Today",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 20,
color: AppColors.boldHeadlineColor,
),

const SizedBox(width: 8),
],
),
],
),
Expand Down
62 changes: 51 additions & 11 deletions src/mobile-v3/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.4.5"
archive:
dependency: transitive
description:
name: archive
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
url: "https://pub.dev"
source: hosted
version: "4.0.7"
args:
dependency: transitive
description:
Expand All @@ -29,10 +37,10 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
battery_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -293,10 +301,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -645,6 +653,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
image:
dependency: "direct main"
description:
name: image
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
url: "https://pub.dev"
source: hosted
version: "4.5.4"
image_picker:
dependency: "direct main"
description:
Expand Down Expand Up @@ -713,10 +729,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
version: "0.20.2"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -761,10 +777,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -942,7 +958,7 @@ packages:
source: hosted
version: "1.1.0"
path_provider:
dependency: transitive
dependency: "direct main"
description:
name: path_provider
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
Expand Down Expand Up @@ -1077,6 +1093,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.1"
posix:
dependency: transitive
description:
name: posix
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
url: "https://pub.dev"
source: hosted
version: "6.0.3"
provider:
dependency: transitive
description:
Expand Down Expand Up @@ -1109,6 +1133,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
share_plus:
dependency: "direct main"
description:
name: share_plus
sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0
url: "https://pub.dev"
source: hosted
version: "11.0.0"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1478,10 +1518,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.0"
watcher:
dependency: transitive
description:
Expand Down
7 changes: 6 additions & 1 deletion src/mobile-v3/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ version: 3.0.2+0

environment:
sdk: '>=3.3.2 <4.0.0'


# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -28,8 +29,11 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:

flutter:
sdk: flutter
share_plus: '^11.0.0'
path_provider: '^2.1.1'


# The following adds the Cupertino Icons font to your application.
Expand Down Expand Up @@ -75,7 +79,7 @@ dependencies:
path_provider_platform_interface: ^2.1.2
plugin_platform_interface: ^2.1.8
url_launcher: ^6.3.1

image: ^4.1.3

dev_dependencies:
flutter_test:
Expand Down Expand Up @@ -112,6 +116,7 @@ flutter:
- assets/data/data.json
- assets/data/new_data.json
- assets/images/shared/airquality_indicators/
- assets/images/airQo_logo.png
- .env.prod
- .env.dev
# - images/a_dot_ham.jpeg
Expand Down