Skip to content

Commit a4ec196

Browse files
SaadArdatiBirjuVachhani
authored andcommitted
Owner field & admin Role migration.
(cherry picked from commit 87d258e)
1 parent dc787b5 commit a4ec196

File tree

41 files changed

+843
-611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+843
-611
lines changed

CHANGELOG.md

Lines changed: 146 additions & 97 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
![Codelessly Logo](packages/Codelessly-Logo-Text.png)
2+
23
# Codelessly CloudUI™ SDK
4+
35
[![Pub release](https://img.shields.io/pub/v/codelessly_sdk.svg?style=flat-square)](https://pub.dev/packages/codelessly_sdk) [![GitHub Release Date](https://img.shields.io/github/release-date/Codelessly/CodelesslySDK.svg?style=flat-square)](https://github.com/Codelessly/CodelesslySDK) [![GitHub issues](https://img.shields.io/github/issues/Codelessly/CodelesslySDK.svg?style=flat-square)](https://github.com/Codelessly/CodelesslySDK/issues) [![GitHub top language](https://img.shields.io/github/languages/top/Codelessly/CodelesslySDK.svg?style=flat-square)](https://github.com/Codelessly/CodelesslySDK)
46

57
> ### Dynamic UI and real-time updates for Flutter apps
@@ -8,11 +10,13 @@
810

911
Supercharge your Flutter apps with dynamic UI and real-time updates. Build and publish UI without code!
1012

11-
- **Real-Time UI Updates:** Adjust your UI as often as you need, all in real-time. Adapt to trends, feedback, and business needs on the fly.
13+
- **Real-Time UI Updates:** Adjust your UI as often as you need, all in real-time. Adapt to trends, feedback, and
14+
business needs on the fly.
1215
- **Intuitive UI Editor:** Easily create and update UI with our user-friendly Codelessly Editor.
1316
- **Empower Non-Technical Team Members:** Enable anyone on your team to build UI without learning how to code.
1417

1518
## Quickstart
19+
1620
[![Pub release](https://img.shields.io/pub/v/codelessly_sdk.svg?style=flat-square)](https://pub.dev/packages/codelessly_sdk)
1721

1822
#### **Step 1: Import Library**
@@ -40,6 +44,7 @@ void main() {
4044
runApp(const MyApp());
4145
}
4246
```
47+
4348
The `authToken`can be found for each project under `Publish > Settings > Settings`.
4449

4550
#### **Step 3: Embed the CodelesslyWidget**
@@ -82,15 +87,19 @@ class MyApp extends StatelessWidget {
8287
}
8388
```
8489

85-
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!
90+
The `CodelesslyWidget` can be used like any other widget and embedded anywhere in your app. It can even be used to
91+
render entire pages as the root widget!
8692

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

89-
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).
96+
To learn how to use the Codelessly editor to publish layouts, check out
97+
our [3-minute Quickstart Guide](https://docs.codelessly.com/getting-started/3-minute-quick-start).
9098

9199
## Injecting Data
92100

93-
Customize Codelessly CloudUI™ widgets by passing data values into your layout. The UI will dynamically replace any variables defined in the Codelessly editor with the provided values.
101+
Customize Codelessly CloudUI™ widgets by passing data values into your layout. The UI will dynamically replace any
102+
variables defined in the Codelessly editor with the provided values.
94103

95104
```dart
96105
CodelesslyWidget(
@@ -107,7 +116,8 @@ Use the `${}` templating syntax in input fields to link data from the Codelessly
107116

108117
![Data](packages/ui_with_data_linking.png)
109118

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.
119+
To link the title of a text widget to the `title` variable in the Codelessly editor, put `${title}` in the text widget’s
120+
text field.
111121

112122
> **Note:** All data passed into the Codelessly widget is stored in the `data` object.
113123
>
@@ -127,7 +137,8 @@ CodelesslyWidget(
127137
),
128138
```
129139

130-
Here, `data` parameter is a map of type `Map<String, dynamic>` which is used to populate information in the layout UI where `data`
140+
Here, `data` parameter is a map of type `Map<String, dynamic>` which is used to populate information in the layout UI
141+
where `data`
131142
variable is used from the Codelessly editor. The layout UI will automatically update to reflect the new data whenever
132143
the `data` is updated.
133144

@@ -156,7 +167,8 @@ Here, we tell the button to call the native `onNextButtonClicked` function when
156167

157168
![Defining call function action](packages/defining_call_function_action.png)
158169

159-
In the Codelessly Editor, you can easily add an Action to a widget. Use the `Call Function` action to invoke `onNextButtonClicked`.
170+
In the Codelessly Editor, you can easily add an Action to a widget. Use the `Call Function` action to invoke
171+
`onNextButtonClicked`.
160172

161173
1. Switch to the `Develop` tab.
162174
2. Select a widget to open the `Actions` panel.
@@ -165,9 +177,11 @@ In the Codelessly Editor, you can easily add an Action to a widget. Use the `Cal
165177
4. Click on the `Settings` button to bring up the `Action Settings` popup.
166178
5. Reference the function name in the `Function Name` field. For example, `onNextButtonClicked`.
167179

168-
**Note:** The `CodelesslyFunction` provides a `CodelesslyContext` which provides internal access to the widget's data, variables, conditions, functions, etc.
180+
**Note:** The `CodelesslyFunction` provides a `CodelesslyContext` which provides internal access to the widget's data,
181+
variables, conditions, functions, etc.
169182

170-
**Note 2:** You can declare `data` and `functions` in the global `Codelessly` instance to make them globally accessible to all `CodelesslyWidget`s.
183+
**Note 2:** You can declare `data` and `functions` in the global `Codelessly` instance to make them globally accessible
184+
to all `CodelesslyWidget`s.
171185

172186
## CodelesslyWidget Options
173187

@@ -181,14 +195,19 @@ CodelesslyWidget(
181195
)
182196
```
183197

184-
- `layoutID`: The ID of the published canvas. The ID can be found in Quick Preview or under `Publish > Settings > Published Layouts`.
198+
- `layoutID`: The ID of the published canvas. The ID can be found in Quick Preview or under
199+
`Publish > Settings > Published Layouts`.
185200

186201
![Codelessly Published Layout ID](packages/codelessly_published_layout_id.png)
187202

188-
- `isPreview`: Whether the layout is in preview or production mode. Preview mode is meant for debugging the layout and syncs with the changes made in the editor. Widgets in production mode are only updated when published using the Publish button.
189-
- `config`: An optional `CodelesslyConfig` that holds the information required to authenticate your layout from the server.
203+
- `isPreview`: Whether the layout is in preview or production mode. Preview mode is meant for debugging the layout and
204+
syncs with the changes made in the editor. Widgets in production mode are only updated when published using the
205+
Publish button.
206+
- `config`: An optional `CodelesslyConfig` that holds the information required to authenticate your layout from the
207+
server.
190208

191-
**Note:** Setting a `CodelesslyConfig` on a CodelesslyWidget overrides the global Codelessly instance settings. This lets you embed layouts from other projects with different auth tokens.
209+
**Note:** Setting a `CodelesslyConfig` on a CodelesslyWidget overrides the global Codelessly instance settings. This
210+
lets you embed layouts from other projects with different auth tokens.
192211

193212
## Environment Configuration
194213

@@ -212,13 +231,16 @@ CodelesslyWidget(
212231

213232
> Realtime UI updates - edits made in the Codelessly Editor are mirrored immediately to the app.
214233

215-
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!
234+
When `isPreview` is set to true, the CodelesslyWidget will stream UI updates from the Codelessly Editor in realtime. Any
235+
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
236+
try!
216237

217238
Use preview mode to test and prototype UI quickly.
218239

219240
#### Flavor Support
220241

221-
A common request is to enable Preview mode in QA environments to support updating the UI on test user's devices. That can be done by setting the `isPreview` value based on the flavor or runtime environment.
242+
A common request is to enable Preview mode in QA environments to support updating the UI on test user's devices. That
243+
can be done by setting the `isPreview` value based on the flavor or runtime environment.
222244

223245
```dart
224246
// Global config.
@@ -235,9 +257,13 @@ This enables realtime updates on release devices in a test environment, excludin
235257

236258
> Publish UIs with absolute control over updates and versioning.
237259

238-
`isPreview` should be set to false for production environments to prevent the UI from changing. When running in Publish (aka Production) mode, UI changes must be explicitly published to update the UI. This makes working in the editor safe and prevents undesired changes from reaching end users.
260+
`isPreview` should be set to false for production environments to prevent the UI from changing. When running in
261+
Publish (aka Production) mode, UI changes must be explicitly published to update the UI. This makes working in the
262+
editor safe and prevents undesired changes from reaching end users.
239263

240-
**Note:** You do not need to change layoutIDs when switching from Preview to Production. Canvases have a single unique layoutID that the system uses to identify layouts with. Codelessly Servers will automatically handle loading the correct layout when moving from Preview to Production.
264+
**Note:** You do not need to change layoutIDs when switching from Preview to Production. Canvases have a single unique
265+
layoutID that the system uses to identify layouts with. Codelessly Servers will automatically handle loading the correct
266+
layout when moving from Preview to Production.
241267

242268
## Configuration Options
243269

@@ -257,8 +283,10 @@ Codelessly.instance.initialize(
257283
CodelesslyConfig supports the following configuration capabilities.
258284

259285
* `isPreview`: Global enable or disable preview-mode setting.
260-
* `preload`: Preload layouts to improve performance. When layouts are preloaded, they load instantly and behave like local widgets. `true` by default.
261-
* `automaticallyCollectCrashReports`: Report SDK crashes to Codelessly. `true` by default. You can optionally disable this behavior.
286+
* `preload`: Preload layouts to improve performance. When layouts are preloaded, they load instantly and behave like
287+
local widgets. `true` by default.
288+
* `automaticallyCollectCrashReports`: Report SDK crashes to Codelessly. `true` by default. You can optionally disable
289+
this behavior.
262290

263291
### Global Data and Functions
264292

@@ -275,12 +303,19 @@ Codelessly.instance.initialize(
275303
```
276304

277305
## Demo
306+
278307
### [CodelesslyGPT](https://sdk-chat-bot.web.app/#/)
279-
A demo chat-bot interface built with the Codelessly SDK. [View Code](https://github.com/Codelessly/CodelesslySDK/tree/main/example_chat_bot)
308+
309+
A demo chat-bot interface built with the Codelessly
310+
SDK. [View Code](https://github.com/Codelessly/CodelesslySDK/tree/main/example_chat_bot)
280311

281312
## Additional Resources
282-
Additional resources and tutorials are on our [documentation website](https://docs.codelessly.com/getting-started/3-minute-quick-start).
283313

284-
If you have any questions or run into any issues, please open an issue or email us at [[email protected]](mailto:[email protected]).
314+
Additional resources and tutorials are on
315+
our [documentation website](https://docs.codelessly.com/getting-started/3-minute-quick-start).
316+
317+
If you have any questions or run into any issues, please open an issue or email us
318+
285319

286-
For the latest information on releases and product updates, subscribe to our newsletter on the [Codelessly Website](https://codelessly.com/).
320+
For the latest information on releases and product updates, subscribe to our newsletter on
321+
the [Codelessly Website](https://codelessly.com/).

example/analysis_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ linter:
2222
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
2323
# producing the lint.
2424
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
2727

2828
# Additional information about this file can be found at
2929
# https://dart.dev/guides/language/analysis-options

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
2+
package="com.example.example">
33
<!-- The INTERNET permission is required for development. Specifically,
44
the Flutter tool needs it to communicate with the running application
55
to allow setting breakpoints, to provide hot reload, etc.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
2+
package="com.example.example">
33

4-
<uses-permission android:name="android.permission.INTERNET"/>
4+
<uses-permission android:name="android.permission.INTERNET"/>
55

66
<application
7-
android:label="example"
8-
android:name="${applicationName}"
9-
android:icon="@mipmap/ic_launcher">
7+
android:label="example"
8+
android:name="${applicationName}"
9+
android:icon="@mipmap/ic_launcher">
1010
<activity
11-
android:name=".MainActivity"
12-
android:exported="true"
13-
android:launchMode="singleTop"
14-
android:theme="@style/LaunchTheme"
15-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16-
android:hardwareAccelerated="true"
17-
android:windowSoftInputMode="adjustResize">
11+
android:name=".MainActivity"
12+
android:exported="true"
13+
android:launchMode="singleTop"
14+
android:theme="@style/LaunchTheme"
15+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:hardwareAccelerated="true"
17+
android:windowSoftInputMode="adjustResize">
1818
<!-- Specifies an Android theme to apply to this Activity as soon as
1919
the Android process has started. This theme is visible to the user
2020
while the Flutter UI initializes. After that, this theme continues
2121
to determine the Window background behind the Flutter UI. -->
2222
<meta-data
23-
android:name="io.flutter.embedding.android.NormalTheme"
24-
android:resource="@style/NormalTheme"
25-
/>
23+
android:name="io.flutter.embedding.android.NormalTheme"
24+
android:resource="@style/NormalTheme"
25+
/>
2626
<intent-filter>
2727
<action android:name="android.intent.action.MAIN"/>
2828
<category android:name="android.intent.category.LAUNCHER"/>
@@ -31,7 +31,7 @@
3131
<!-- Don't delete the meta-data below.
3232
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3333
<meta-data
34-
android:name="flutterEmbedding"
35-
android:value="2" />
34+
android:name="flutterEmbedding"
35+
android:value="2"/>
3636
</application>
3737
</manifest>

example/android/app/src/main/kotlin/com/example/example/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package com.example.example
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity() {
5+
class MainActivity : FlutterActivity() {
66
}

example/android/app/src/main/res/drawable-v21/launch_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Modify this file to customize your launch splash screen -->
33
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4-
<item android:drawable="?android:colorBackground" />
4+
<item android:drawable="?android:colorBackground"/>
55

66
<!-- You can insert your own image assets here -->
77
<!-- <item>

example/android/app/src/main/res/drawable/launch_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Modify this file to customize your launch splash screen -->
33
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4-
<item android:drawable="@android:color/white" />
4+
<item android:drawable="@android:color/white"/>
55

66
<!-- You can insert your own image assets here -->
77
<!-- <item>

example/android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
2+
package="com.example.example">
33
<!-- The INTERNET permission is required for development. Specifically,
44
the Flutter tool needs it to communicate with the running application
55
to allow setting breakpoints, to provide hot reload, etc.

0 commit comments

Comments
 (0)