From 090418c5d5a616e3dd14ae898e85cc65223c9f70 Mon Sep 17 00:00:00 2001 From: maru Date: Fri, 5 Nov 2021 17:30:18 +0100 Subject: [PATCH] chore: Minor updates - Showcase builder as the recommended way - Update README --- README.md | 18 ++++++++++-------- example/lib/main.dart | 9 ++++++--- example/pubspec.lock | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bb14e45..5300b34 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ dependencies: nstack: git: url: git://github.com/nstack-io/flutter-sdk.git - ref: v0.4.1 + ref: v0.5.0 dev_dependencies: build_runner: @@ -69,8 +69,7 @@ Now increment the `"version"` number and save (⌘s) to trigger an update. ## Example -Import your `nstack.dart` file and plant your `NStackWidget` at the root of your application.\ -Use `NStackAppOpen` for submitting [AppOpen] events. +Import your `nstack.dart` file and plant your `NStackWidget` in the builder of your application. ```dart import 'package:flutter/material.dart'; @@ -84,11 +83,14 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - home: NStackAppOpen( - child: Scaffold( - appBar: AppBar( - title: Text(context.localization.test.title), - ), + builder: (context, child) { + return NStackWidget( + child: child!, + ); + }, + home: Scaffold( + appBar: AppBar( + title: Text(context.localization.test.title), ), ), ); diff --git a/example/lib/main.dart b/example/lib/main.dart index 4659047..f96b26d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -10,10 +10,13 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - home: NStackWidget( + builder: (context, child) { + return NStackWidget( platformOverride: AppOpenPlatform.android, - child: MainScreen() - ), + child: child!, + ); + }, + home: MainScreen(), ); } } diff --git a/example/pubspec.lock b/example/pubspec.lock index 830ac88..2a6be4f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -302,7 +302,7 @@ packages: path: ".." relative: true source: path - version: "0.4.1" + version: "0.5.0" package_config: dependency: transitive description: