Skip to content
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

NStack SDK architectural changes #63

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
nstack: a7ebf31d8c387ec76d4bfe5eb494d3ac81756d92
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586

PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
63 changes: 7 additions & 56 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,74 +1,25 @@
import 'package:example/nstack.dart';
import 'package:example/routes/routes.dart';
import 'package:flutter/material.dart';

void main() {
runApp(const ExampleApp());
runApp(ExampleApp());
}

class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
ExampleApp({super.key});
final _router = AppRouter();

@override
Widget build(BuildContext context) {
return MaterialApp(
return MaterialApp.router(
builder: (context, child) {
return NStackWidget(
child: child!,
);
},
home: const MainScreen(),
);
}
}

class MainScreen extends StatelessWidget {
const MainScreen({super.key});

@override
Widget build(BuildContext context) {
final localization = context.localization;
final localizationAsset = localization.assets;
final activeLanguage = localization.activeLanguage;

// 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 NStackVersionControlWidget(
child: 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}',
),
),
),
),
),
routerDelegate: _router.delegate(),
routeInformationParser: _router.defaultRouteParser(),
);
}
}
Loading
Loading