Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update version #65

Merged
merged 1 commit into from
Feb 7, 2025
Merged
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
9 changes: 5 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand All @@ -25,13 +25,14 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdk = 35
namespace 'com.dataxad.flutter_mailer_example'

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.dataxad.flutter_mailer_example"
minSdkVersion 16
targetSdkVersion 30
minSdkVersion flutter.minSdkVersion
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 2 additions & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dataxad.flutter_mailer_example">
<application
Expand All @@ -9,6 +10,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.dataxad.flutter_mailer_example;

import android.os.Bundle;
import com.dataxad.flutter_mailer.FlutterMailerPlugin;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import io.flutter.plugins.imagepicker.ImagePickerPlugin;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
// import android.os.Bundle;
// import com.dataxad.flutter_mailer.FlutterMailerPlugin;
// import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
// import io.flutter.plugins.imagepicker.ImagePickerPlugin;
// import io.flutter.plugins.pathprovider.PathProviderPlugin;
import io.flutter.app.FlutterActivity;

public class EmbeddingV1Activity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FlutterMailerPlugin.registerWith(registrarFor("com.dataxad.flutter_mailer.FlutterMailerPlugin"));
IntegrationTestPlugin.registerWith(registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin"));
ImagePickerPlugin.registerWith(registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin"));
PathProviderPlugin.registerWith(registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
}
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// FlutterMailerPlugin.registerWith(registrarFor("com.dataxad.flutter_mailer.FlutterMailerPlugin"));
// IntegrationTestPlugin.registerWith(registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin"));
// ImagePickerPlugin.registerWith(registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin"));
// PathProviderPlugin.registerWith(registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
// }
}
7 changes: 6 additions & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
buildscript {
ext {
agp_version = '8.7.0'
kotlin_version = '2.1.0'
}
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Fri Dec 06 16:07:25 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
30 changes: 7 additions & 23 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> {
bool useTempDirectory = true;
List<String> attachment = <String>[];
final TextEditingController _subjectController =
TextEditingController(text: 'the Subject');
final TextEditingController _bodyController = TextEditingController(
text: ''' <em>the body has <code>HTML</code></em> <br><br><br>
final TextEditingController _subjectController = TextEditingController(text: 'the Subject');
final TextEditingController _bodyController =
TextEditingController(text: ''' <em>the body has <code>HTML</code></em> <br><br><br>
<strong>Some Apps like Gmail might ignore it</strong>
''');
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> send(BuildContext context) async {
if (Platform.isIOS) {
final bool canSend = await FlutterMailer.canSendMail();
if (!canSend) {
const SnackBar snackbar =
const SnackBar(content: Text('no Email App Available'));
const SnackBar snackbar = const SnackBar(content: Text('no Email App Available'));
ScaffoldMessenger.of(context).showSnackBar(snackbar);
return;
}
Expand Down Expand Up @@ -81,10 +79,7 @@ class _MyAppState extends State<MyApp> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'Message',
style: Theme.of(context).textTheme.subtitle1,
),
Text('Message'),
Text(error.message ?? 'unknown error'),
],
),
Expand Down Expand Up @@ -244,9 +239,6 @@ class _MyAppState extends State<MyApp> {
children: <Widget>[
Builder(
builder: (BuildContext context) => TextButton(
style: TextButton.styleFrom(
primary: Theme.of(context).primaryColor,
),
child: const Text('add text File'),
onPressed: () => _onCreateFile(context),
),
Expand Down Expand Up @@ -311,10 +303,7 @@ class _MyAppState extends State<MyApp> {
),
Row(
children: [
Text(
'use Temp directory',
style: Theme.of(context).textTheme.caption,
),
Text('use Temp directory'),
Switch(
value: useTempDirectory,
onChanged: Platform.isAndroid
Expand All @@ -331,14 +320,9 @@ class _MyAppState extends State<MyApp> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).colorScheme.secondary,
onPrimary: Theme.of(context).colorScheme.secondary,
),
child: const Icon(Icons.save),
onPressed: () {
final TempFile tempFile =
TempFile(content: content, name: fileName);
final TempFile tempFile = TempFile(content: content, name: fileName);
// Map.from({'content': content, 'fileName': fileName});
Navigator.of(context).pop<TempFile>(tempFile);
},
Expand Down
Loading