diff --git a/lib/pages/home/page.dart b/lib/pages/home/page.dart index 55ea6f6..eb7cc49 100644 --- a/lib/pages/home/page.dart +++ b/lib/pages/home/page.dart @@ -19,7 +19,7 @@ import 'package:path/path.dart' as path; import 'package:shared_preferences/shared_preferences.dart'; import 'package:intl/intl.dart'; import 'package:file_saver/file_saver.dart'; -import 'package:http/http.dart' as http; +// import 'package:http/http.dart' as http; // number formatter for engagement fields class NumberTextInputFormatter extends TextInputFormatter { @@ -1131,7 +1131,7 @@ class _HomePageState extends State { print("Share succesful"); // Send Discord webhook notifiation - _sendShareNotification(); + // _sendShareNotification(); } } catch (e) { @@ -1139,53 +1139,53 @@ class _HomePageState extends State { } } - Future _sendShareNotification() async { - const webhookUrl = "https://discord.com/api/webhooks/1456729319408664814/p2Ctqi7BijV0c34V-BnB62m6_yjkf72eD64oJyxXaNAcqZNfFm_-bA2uPZg1NTKpVdxp"; - - try { - final response = await http.post( - Uri.parse(webhookUrl), - headers: {"Content-Type": "application/json"}, - body: jsonEncode({ - "content": "Someone just shared a quote from the app! 🎉", - "embeds": [ - { - "title": "Quote Shared", - "description": formData["content"].isNotEmpty - ? "\"${formData["content"]}\"" - : "A quote was shared", - "color": 5814783, - "fields": [ - { - "name": "User", - "value": formData["display_name"].isNotEmpty - ? "${formData["display_name"]} (@${formData["handle"]})" - : "Anonymous", - "inline": true - }, - { - "name": "Timestamp", - "value": DateTime.now().toIso8601String(), - "inline": true - } - ], - "footer": { - "text": "QuoteGen App" - } - } - ] - }), - ); - - if (response.statusCode == 204 || response.statusCode == 200) { - print("Discord notificaton sent successfuly"); - } else { - print("Failed to send Discord notification: ${response.statusCode}"); - } - } catch (e) { - print("Error sendin Discord webhook: $e"); - } - } + // Future _sendShareNotification() async { + // const webhookUrl = "https://discord.com/api/webhooks/1456729319408664814/p2Ctqi7BijV0c34V-BnB62m6_yjkf72eD64oJyxXaNAcqZNfFm_-bA2uPZg1NTKpVdxp"; + // + // try { + // final response = await http.post( + // Uri.parse(webhookUrl), + // headers: {"Content-Type": "application/json"}, + // body: jsonEncode({ + // "content": "Someone just shared a quote from the app! 🎉", + // "embeds": [ + // { + // "title": "Quote Shared", + // "description": formData["content"].isNotEmpty + // ? "\"${formData["content"]}\"" + // : "A quote was shared", + // "color": 5814783, + // "fields": [ + // { + // "name": "User", + // "value": formData["display_name"].isNotEmpty + // ? "${formData["display_name"]} (@${formData["handle"]})" + // : "Anonymous", + // "inline": true + // }, + // { + // "name": "Timestamp", + // "value": DateTime.now().toIso8601String(), + // "inline": true + // } + // ], + // "footer": { + // "text": "QuoteGen App" + // } + // } + // ] + // }), + // ); + // + // if (response.statusCode == 204 || response.statusCode == 200) { + // print("Discord notificaton sent successfuly"); + // } else { + // print("Failed to send Discord notification: ${response.statusCode}"); + // } + // } catch (e) { + // print("Error sendin Discord webhook: $e"); + // } + // } // load form data from shared preferences Future _loadFormData() async {