App Drawer: Implement the share button

It's very basic, but it's a decent start.
This commit is contained in:
Vishesh Handa
2019-02-14 18:22:56 +01:00
parent 8d778d7e1f
commit 892fc07b89
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:journal/state_container.dart'; import 'package:journal/state_container.dart';
import 'package:share/share.dart';
class AppDrawer extends StatelessWidget { class AppDrawer extends StatelessWidget {
@override @override
@ -46,8 +47,7 @@ class AppDrawer extends StatelessWidget {
title: Text('Share App'), title: Text('Share App'),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
// Update the state of the app Share.share('Checkout GitJournal https://gitjournal.io/');
// ...
}, },
), ),
ListTile( ListTile(

View File

@ -345,6 +345,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
share:
dependency: "direct main"
description:
name: share
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0+1"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -17,6 +17,7 @@ dependencies:
package_info: ^0.3.2+1 package_info: ^0.3.2+1
http: ^0.12.0+1 http: ^0.12.0+1
badges: ^0.0.6 badges: ^0.0.6
share: ^0.6.0+1
dev_dependencies: dev_dependencies:
flutter_launcher_icons: "^0.7.0" flutter_launcher_icons: "^0.7.0"