Skip to content

Commit

Permalink
share images done Added #24
Browse files Browse the repository at this point in the history
  • Loading branch information
codenameakshay committed Jun 5, 2020
1 parent 5588c23 commit 3acba2e
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 22 deletions.
39 changes: 23 additions & 16 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multi_screen">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.multi_screen">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="multi_screen"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
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">
<application android:name="io.flutter.app.FlutterApplication" android:label="multi_screen" android:icon="@mipmap/ic_launcher">
<!-- <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths"/>
</provider> -->
<activity android:name=".MainActivity" 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">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- <intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter> -->
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
</manifest>
4 changes: 4 additions & 0 deletions android/app/src/main/res/filepaths.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>
18 changes: 14 additions & 4 deletions lib/picnote_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:async';
// import 'dart:convert';
import 'dart:io';
// import 'dart:typed_data';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
Expand All @@ -13,7 +11,7 @@ import 'package:multi_screen/SqliteHandler.dart';
import 'package:multi_screen/photoViewer.dart';
import 'package:multi_screen/utility.dart';
import 'package:multi_screen/options_sheet.dart';
import 'package:share/share.dart';
// import 'package:flutter_share_content/flutter_share_content.dart';
import 'package:flutter/services.dart';

class PhotoPage extends StatefulWidget {
Expand Down Expand Up @@ -392,7 +390,19 @@ class _PhotoPageState extends State<PhotoPage> {
case moreOptions.share:
{
if (_editableNote.content.isNotEmpty) {
Share.share("${_editableNote.title}\n${_editableNote.content}");
// FlutterShareContent.shareContent(
// imageUrl: '${widget.noteInEditing.content}',
// title: '${widget.noteInEditing.title}',
// msg: '${widget.noteInEditing.title}');
// Share.shareFile(
// File('${widget.noteInEditing.content}'),
// subject: '${widget.noteInEditing.title}',
// text: '${widget.noteInEditing.title}',
// );
// FlutterShareFile.shareImage(
// widget.noteInEditing.content,
// '${widget.noteInEditing.title}.png',
// '${widget.noteInEditing.title}');
}
break;
}
Expand Down
Loading

0 comments on commit 3acba2e

Please sign in to comment.