From 3cbab61563e9c486f82b87e1272fa4f26af55079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=93=E5=8E=9F?= Date: Tue, 15 Jun 2021 11:24:35 +0800 Subject: [PATCH] fix #36 #38 --- lib/flutter_share_me.dart | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/flutter_share_me.dart b/lib/flutter_share_me.dart index fff14ec..7859283 100644 --- a/lib/flutter_share_me.dart +++ b/lib/flutter_share_me.dart @@ -5,7 +5,7 @@ class FlutterShareMe { ///share to facebook Future shareToFacebook({String msg = '', String url = ''}) async { - final Map arguments = Map() as Map; + final Map arguments = Map(); arguments.putIfAbsent('msg', () => msg); arguments.putIfAbsent('url', () => url); dynamic result; @@ -19,7 +19,7 @@ class FlutterShareMe { ///share to twitter Future shareToTwitter({String msg = '', String url = ''}) async { - final Map arguments = Map() as Map; + final Map arguments = Map(); arguments.putIfAbsent('msg', () => msg); arguments.putIfAbsent('url', () => url); dynamic result; @@ -32,9 +32,8 @@ class FlutterShareMe { } ///share to WhatsApp - Future shareToWhatsApp( - {String msg = '', String base64Image = ''}) async { - final Map arguments = Map() as Map; + Future shareToWhatsApp({String msg = '', String base64Image = ''}) async { + final Map arguments = Map(); arguments.putIfAbsent('msg', () => msg); arguments.putIfAbsent('url', () => base64Image); dynamic result; @@ -48,9 +47,8 @@ class FlutterShareMe { } ///share to WhatsApp4Biz - Future shareToWhatsApp4Biz( - {String msg = '', String base64Image = ''}) async { - final Map arguments = Map() as Map; + Future shareToWhatsApp4Biz({String msg = '', String base64Image = ''}) async { + final Map arguments = Map(); arguments.putIfAbsent('msg', () => msg); arguments.putIfAbsent('url', () => base64Image); dynamic result; @@ -65,7 +63,7 @@ class FlutterShareMe { ///use system share ui Future shareToSystem({String? msg}) async { - Map arguments = Map(); + Map arguments = Map(); arguments.putIfAbsent('msg', () => msg); dynamic result; try {