Skip to content

Implement Messages feature #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
8 changes: 7 additions & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- nstack (from `.symlinks/plugins/nstack/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

EXTERNAL SOURCES:
Flutter:
Expand All @@ -23,13 +26,16 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
nstack: a7ebf31d8c387ec76d4bfe5eb494d3ac81756d92
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
48 changes: 34 additions & 14 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,40 @@ class MainScreen extends StatelessWidget {
final localizationAsset = localization.assets;
final activeLanguage = localization.activeLanguage;

return Scaffold(
appBar: AppBar(
title: Text(localizationAsset.test.testDollarSign),
),
body: Center(
child: MaterialButton(
onPressed: () {
final locale = activeLanguage.locale == 'en-EN'
? const Locale('de-DE')
: const Locale('en-EN');
localization.changeLocalization(locale);
},
child: Text(
'Selected locale: ${activeLanguage.name}',
// Message option for receiving the Message response, will not show the default dialog.
// void onMessage(Message message) {
// if (kDebugMode) {
// print(message.message);
// }
// }

// final customNstackHandlerConfiguration =
// CustomNstackHandlerConfiguration(onMessage: onMessage);

// Message option for showing default dialog.
final defaultHandlerConfiguration = DefaultNstackHandlerConfiguration(
okButtonTitle: localizationAsset.test.okButtonTitle,
openUrlButtonTitle: localizationAsset.test.openUrlButtonTitle,
dialogTitle: localizationAsset.test.dialogTitle,
);

return NStackMessageWidget(
handlerConfiguration: defaultHandlerConfiguration,
child: Scaffold(
appBar: AppBar(
title: Text(localizationAsset.test.testDollarSign),
),
body: Center(
child: MaterialButton(
onPressed: () {
final locale = activeLanguage.locale == 'en-EN'
? const Locale('de-AT')
: const Locale('en-EN');
localization.changeLocalization(locale);
},
child: Text(
'Selected locale: ${activeLanguage.name}',
),
),
),
),
Expand Down
Loading