Skip to content

Commit

Permalink
Merge branch 'SankethBK:master' into 29_auto_save_notes
Browse files Browse the repository at this point in the history
  • Loading branch information
droidbg authored Oct 2, 2023
2 parents ddf2234 + ef7b71e commit deacc99
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 17 deletions.
7 changes: 7 additions & 0 deletions lib/core/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import 'package:dairy_app/app/themes/theme_extensions/note_create_page_theme_ext
import 'package:dairy_app/core/widgets/glass_app_bar.dart';
import 'package:dairy_app/core/widgets/glassmorphism_cover.dart';
import 'package:dairy_app/core/widgets/logout_button.dart';
import 'package:dairy_app/core/widgets/send_feedback.dart';
import 'package:dairy_app/core/widgets/share_with_friends.dart';
import 'package:dairy_app/core/widgets/theme_dropdown.dart';
import 'package:dairy_app/core/widgets/version_number.dart';
import 'package:dairy_app/features/auth/presentation/bloc/auth_session/auth_session_bloc.dart';
import 'package:dairy_app/features/auth/presentation/widgets/security_settings.dart';
import 'package:dairy_app/features/auth/presentation/widgets/setup_account.dart';
import 'package:dairy_app/features/sync/presentation/widgets/sync_settings.dart';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -123,6 +126,10 @@ class _SettingsPageState extends State<SettingsPage> {
const SizedBox(height: 15),
const ThemeDropdown(),
const SizedBox(height: 15),
const SendFeedBack(),
const SizedBox(height: 15),
const ShareWithFriends(),
const SizedBox(height: 15),
const VersionNumber(),
],
),
Expand Down
44 changes: 44 additions & 0 deletions lib/core/widgets/send_feedback.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:dairy_app/app/themes/theme_extensions/note_create_page_theme_extensions.dart';

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

class SendFeedBack extends StatelessWidget {
const SendFeedBack({Key? key}) : super(key: key);

final emailAddress = '[email protected]';
final subject = 'Feedback for DiaryVault';

@override
Widget build(BuildContext context) => InkWell(
onTap: _launchEmailApp,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6.0),
child: Text(
"Send feedback",
style: TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.extension<NoteCreatePageThemeExtensions>()!
.mainTextColor,
),
),
),
);

void _launchEmailApp() async {
try {
final Uri emailLaunchUri = Uri(
scheme: 'mailto',
path: emailAddress,
queryParameters: {'subject': subject},
);

await launchUrl(emailLaunchUri);
} catch (e) {
throw Exception(
"Error sending feed-back",
);
}
}
}
40 changes: 40 additions & 0 deletions lib/core/widgets/share_with_friends.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'package:dairy_app/app/themes/theme_extensions/note_create_page_theme_extensions.dart';
import 'package:flutter/material.dart';
import 'package:share_plus/share_plus.dart';

class ShareWithFriends extends StatelessWidget {
const ShareWithFriends({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
final mainTextStyle = TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.extension<NoteCreatePageThemeExtensions>()!
.mainTextColor,
);
const appDescription =
"Discover diaryVault - a diary app designed to help you capture your thoughts, memories, and moments effortlessly. Available now on the Play Store!";

return GestureDetector(
onTap: (() async {
try {
const playstoreURL =
'https://play.google.com/store/apps/details?id=me.sankethbk.dairyapp';
await Share.share('$appDescription\n\n$playstoreURL');
} catch (e) {
throw Exception(
"Error sharing app",
);
}
}),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6.0),
child: Text(
"Share with Friends",
style: mainTextStyle,
),
),
);
}
}
27 changes: 15 additions & 12 deletions lib/core/widgets/version_number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ class VersionNumber extends StatelessWidget {
builder: (context, snapshot) {
final version = snapshot.data?.version ?? '';

return Row(
children: [
Text(
"App version",
style: mainTextStyle,
),
const Spacer(),
Text(
version,
style: mainTextStyle,
),
],
return Padding(
padding: const EdgeInsets.symmetric(vertical: 6.0),
child: Row(
children: [
Text(
"App version",
style: mainTextStyle,
),
const Spacer(),
Text(
version,
style: mainTextStyle,
),
],
),
);
},
);
Expand Down
16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
share_plus:
dependency: "direct main"
description:
name: share_plus
sha256: "6cec740fa0943a826951223e76218df002804adb588235a8910dc3d6b0654e11"
url: "https://pub.dev"
source: hosted
version: "7.1.0"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: "357412af4178d8e11d14f41723f80f12caea54cf0d5cd29af9dcdab85d58aea7"
url: "https://pub.dev"
source: hosted
version: "3.3.0"
shared_preferences:
dependency: "direct main"
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ dependencies:
package_info_plus: ^4.1.0
path_provider: ^2.0.9
provider: ^6.0.5
share_plus: ^7.1.0
shared_preferences: ^2.0.15
sqflite: ^2.0.2
stateless_dropbox_client:
Expand Down Expand Up @@ -86,7 +87,7 @@ dev_dependencies:
# android_12:
# image: 'assets/images/splash_screen.png'
dependency_overrides:
analyzer:
? analyzer

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
6 changes: 3 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@
#include "generated_plugin_registrant.h"

#include <file_selector_windows/file_selector_windows.h>
#include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <local_auth_windows/local_auth_plugin.h>
#include <pasteboard/pasteboard_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_to_front/window_to_front_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseAuthPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
Expand All @@ -28,6 +26,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
PasteboardPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PasteboardPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowToFrontPluginRegisterWithRegistrar(
Expand Down
2 changes: 1 addition & 1 deletion windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
firebase_auth
firebase_core
flutter_secure_storage_windows
local_auth_windows
pasteboard
share_plus
url_launcher_windows
window_to_front
)
Expand Down

0 comments on commit deacc99

Please sign in to comment.