Skip to content

Commit

Permalink
Merge pull request #7 from AMCAsimulagro/bugfix/query_packages
Browse files Browse the repository at this point in the history
Arreglado libreria para abrir whatsapp
  • Loading branch information
AMCAsimulagro authored Dec 3, 2023
2 parents 6a50cc5 + dd1c5eb commit 35ee032
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
26 changes: 16 additions & 10 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.simlagro.amca">
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERNET"/>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>

<application
android:label="AMCA"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="AMCA">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ class FrequentQuestionsPage extends StatelessWidget {
}

Future<void> _launchWhatsapp(BuildContext context) async {
var whatsapp = "+573012523459";
var supportNumber = "3012523459";
var whatsappAndroid = Uri.parse(
"whatsapp://send?phone=$whatsapp&text=${AmcaWords.supportDefaultMessage}");
"https://wa.me/57$supportNumber?text=${AmcaWords.supportDefaultMessage}");
if (await canLaunchUrl(whatsappAndroid)) {
launchUrl(whatsappAndroid);
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("No tienes instalado WhatsApp en tu celular"),
SnackBar(
content: Text("Erro al contactar soporte, llamar a $supportNumber"),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/utils/amca_words.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class AmcaWords {
static const String sownType = 'Tipo de sembrado';
static const String sownArea = 'Área sembrada';
static const String supportDefaultMessage =
'Hola, necesito ayuda para usar AMCA';
'Hola,%20necesito%20ayuda%20para%20usar%20AMCA';
static const String transitory = 'Transitorio';
static const String transitoryFarming = 'Cultivo transitorio';
static const String title = 'Título';
Expand Down

0 comments on commit 35ee032

Please sign in to comment.