Skip to content

Commit 792a813

Browse files
committed
v0.2.0 Release
- New simplified variables system. Variables passed into the CodelesslyWidget can now be referenced by name in the Codelessly Editor. ``` CodelesslyWidget( data: { 'title': 'My Title', 'productData': { // JSON Data 'nested': { 'json': { 'path': 'Hey there!', } } } } ) // Now you can access the variable directly in the Codelessly Editor. ${title} - 'My Title' // Or, using the `data` object. ${data.title} - 'My Title' ${data.productData.nested.json.path} - 'Hey there!' ``` - New SVG image support! - New hosted website publishing support. - Add `>=`, `<=`, and `== null` operators. - Add data and variable support for dropdown component. - Add Material 3 Switch UI component. - Add Rounded Circular Progress Indicator component. - Improve InkWell behavior. Show Inkwell effect on top of other widgets. - Prototype implementation of custom widget embedding feature.
1 parent 15cc0e3 commit 792a813

File tree

4 files changed

+49
-16
lines changed

4 files changed

+49
-16
lines changed

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
## 0.2.0
2+
- New simplified variables system. Variables passed into the CodelesslyWidget can now be referenced by name in the Codelessly Editor.
3+
4+
```
5+
CodelesslyWidget(
6+
data: {
7+
'title': 'My Title',
8+
'productData': { // JSON Data
9+
'nested': {
10+
'json': {
11+
'path': 'Hey there!',
12+
}
13+
}
14+
}
15+
}
16+
)
17+
18+
// Now you can access the variable directly in the Codelessly Editor.
19+
${title} - 'My Title'
20+
21+
// Or, using the `data` object.
22+
${data.title} - 'My Title'
23+
${data.productData.nested.json.path} - 'Hey there!'
24+
```
25+
26+
- New SVG image support!
27+
- New hosted website publishing support.
28+
- Add `>=`, `<=`, and `== null` operators.
29+
- Add data and variable support for dropdown component.
30+
- Add Material 3 Switch UI component.
31+
- Add Rounded Circular Progress Indicator component.
32+
- Improve InkWell behavior. Show Inkwell effect on top of other widgets.
33+
- Prototype implementation of custom widget embedding feature.
34+
135
## 0.1.0
236
- Update CodelesslyAPI v0.1.0.
337
- Optimize SDK size by 90% by switching to SVG icons.

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Initialize Codelessly before calling `runApp()`.
2828
```dart
2929
void main() {
3030
WidgetsFlutterBinding.ensureInitialized();
31-
31+
3232
// Initialize SDK.
3333
Codelessly.instance.initialize(
3434
config: CodelesslyConfig(
@@ -84,7 +84,7 @@ class MyApp extends StatelessWidget {
8484

8585
The `CodelesslyWidget` can be used like any other widget and embedded anywhere in your app. It can even be used to render entire pages as the root widget!
8686

87-
From dynamic forms to constantly changing sales and marketing pages, any design or layout can be streamed to your app via the `CodelesslyWidget`.
87+
From dynamic forms to constantly changing sales and marketing pages, any design or layout can be streamed to your app via the `CodelesslyWidget`.
8888

8989
To learn how to use the Codelessly editor to publish layouts, check out our [3-minute Quickstart Guide](https://docs.codelessly.com/getting-started/3-minute-quick-start).
9090

@@ -103,15 +103,17 @@ CodelesslyWidget(
103103

104104
#### **Step 1:** Define variables in the Codelessly Editor
105105

106-
Use the `${}` templating syntax in input fields to link data from the Codelessly editor to layouts as shown below.
106+
Use the `${}` templating syntax in input fields to link data from the Codelessly editor to layouts as shown below.
107107

108108
![Data](packages/ui_with_data_linking.png)
109109

110-
To link the title of a text widget to the `title` variable in the Codelessly editor, put `${data.title}` in the text widget’s text field.
110+
To link the title of a text widget to the `title` variable in the Codelessly editor, put `${title}` in the text widget’s text field.
111111

112-
> **Note:** The `data` object contains all the variables passed to the CodelesslyWidget.
112+
> **Note:** All data passed into the Codelessly widget is stored in the `data` object.
113+
>
114+
> You can access the `title` variable with `${title}` or `${data.title}`.
113115
>
114-
> Use `${data.title}` to access the `title` variable passed from the client. `${title}` alone is a Codelessly variable and will try to load variables defined in Codelessly, not your client.
116+
> Use `data` to reference nested JSON payloads. Example: ${data.productData.nested.json.path}
115117

116118
#### **Step 2:** Pass data to the layout from your app.
117119

@@ -212,7 +214,7 @@ CodelesslyWidget(
212214

213215
When `isPreview` is set to true, the CodelesslyWidget will stream UI updates from the Codelessly Editor in realtime. Any edits to the UI in the editor will update in the app immediately. We think this is a pretty amazing feature so give it a try!
214216

215-
Use preview mode to test and prototype UI quickly.
217+
Use preview mode to test and prototype UI quickly.
216218

217219
#### Flavor Support
218220

lib/src/ui/codelessly_widget.dart

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import 'dart:async';
22
import 'dart:developer';
33

4-
import 'package:codelessly_api/codelessly_api.dart';
5-
import 'package:collection/collection.dart';
6-
import 'package:equatable/equatable.dart';
74
import 'package:flutter/material.dart';
85
import 'package:flutter/scheduler.dart';
96
import 'package:provider/provider.dart';
107

118
import '../../codelessly_sdk.dart';
129
import '../logging/error_handler.dart';
13-
import 'codelessly_context.dart';
1410
import 'codelessly_error_screen.dart';
1511
import 'codelessly_loading_screen.dart';
1612
import 'layout_builder.dart';
@@ -31,7 +27,6 @@ typedef CodelesslyWidgetErrorBuilder = Widget Function(
3127

3228
Widget _defaultLayoutBuilder(context, layout) => layout;
3329

34-
3530
/// SDK widget that requires the SDK to be initialized beforehand.
3631
///
3732
/// The SDK can be instantiated in several ways:
@@ -323,8 +318,10 @@ class _CodelesslyWidgetState extends State<CodelesslyWidget> {
323318
codelesslyContext.functions = widget.functions;
324319
}
325320

326-
if (widget.externalComponentBuilders != oldWidget.externalComponentBuilders) {
327-
codelesslyContext.externalComponentBuilders = widget.externalComponentBuilders;
321+
if (widget.externalComponentBuilders !=
322+
oldWidget.externalComponentBuilders) {
323+
codelesslyContext.externalComponentBuilders =
324+
widget.externalComponentBuilders;
328325
}
329326

330327
if (widget.controller == null && oldWidget.controller != null) {

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: codelessly_sdk
22
description: Codelessly CloudUI™ - Supercharge your Flutter apps with dynamic UI and real-time updates. Build and publish UI without code!
3-
version: 0.1.0
3+
version: 0.2.0
44
homepage: https://codelessly.com/
55
repository: https://github.com/Codelessly/CodelesslySDK
66

@@ -19,7 +19,7 @@ platforms:
1919
dependencies:
2020
flutter:
2121
sdk: flutter
22-
codelessly_api: 0.1.0
22+
codelessly_api: 0.2.0
2323
equatable: ^2.0.5
2424
google_fonts: ^5.1.0
2525
json_annotation: ^4.8.1

0 commit comments

Comments
 (0)