From b966c5163ca1be92b9f2320f8723b09e387dbfad Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Tue, 27 May 2025 22:40:07 +0530 Subject: [PATCH 01/12] chore: init --- .gitignore | 31 +++++++++++++++++++++ .metadata | 10 +++++++ CHANGELOG.md | 3 +++ analysis_options.yaml | 4 +++ lib/flutter_sdui.dart | 5 ++++ pubspec.yaml | 54 +++++++++++++++++++++++++++++++++++++ test/flutter_sdui_test.dart | 12 +++++++++ 7 files changed, 119 insertions(+) create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 CHANGELOG.md create mode 100644 analysis_options.yaml create mode 100644 lib/flutter_sdui.dart create mode 100644 pubspec.yaml create mode 100644 test/flutter_sdui_test.dart diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb6c05c --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +build/ diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..2a15a9b --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "17025dd88227cd9532c33fa78f5250d548d87e9a" + channel: "stable" + +project_type: package diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..41cc7d8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/lib/flutter_sdui.dart b/lib/flutter_sdui.dart new file mode 100644 index 0000000..298576d --- /dev/null +++ b/lib/flutter_sdui.dart @@ -0,0 +1,5 @@ +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..e5be782 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,54 @@ +name: flutter_sdui +description: "A new Flutter package project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.6.0 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/test/flutter_sdui_test.dart b/test/flutter_sdui_test.dart new file mode 100644 index 0000000..5afd4bf --- /dev/null +++ b/test/flutter_sdui_test.dart @@ -0,0 +1,12 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:flutter_sdui/flutter_sdui.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + }); +} From 572cae6a3784ecd4c2acd7fa078a6887050647e9 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Wed, 28 May 2025 16:19:02 +0530 Subject: [PATCH 02/12] feat: grpc parser --- .gitignore | 1 + README.md | 423 +++++- build.yaml | 10 + example/grpc_example.dart | 118 ++ example/grpc_server_example_dart.dart | 294 ++++ lib/flutter_sdui.dart | 34 +- lib/src/generated/sdui.pb.dart | 1680 ++++++++++++++++++++++ lib/src/generated/sdui.pbenum.dart | 208 +++ lib/src/generated/sdui.pbgrpc.dart | 64 + lib/src/generated/sdui.pbjson.dart | 607 ++++++++ lib/src/parser/sdui_proto_parser.dart | 308 ++++ lib/src/protos/sdui.proto | 242 ++++ lib/src/renderer/sdui_grpc_renderer.dart | 81 ++ lib/src/service/sdui_grpc_client.dart | 38 + lib/src/widgets/sdui_column.dart | 17 + lib/src/widgets/sdui_container.dart | 31 + lib/src/widgets/sdui_icon.dart | 31 + lib/src/widgets/sdui_image.dart | 26 + lib/src/widgets/sdui_row.dart | 17 + lib/src/widgets/sdui_scaffold.dart | 47 + lib/src/widgets/sdui_sized_box.dart | 20 + lib/src/widgets/sdui_spacer.dart | 14 + lib/src/widgets/sdui_text.dart | 15 + lib/src/widgets/sdui_widget.dart | 6 + pubspec.yaml | 76 +- test/flutter_sdui_test.dart | 20 +- tool/generate_protos.ps1 | 46 + tool/setup_protoc.ps1 | 32 + 28 files changed, 4434 insertions(+), 72 deletions(-) create mode 100644 build.yaml create mode 100644 example/grpc_example.dart create mode 100644 example/grpc_server_example_dart.dart create mode 100644 lib/src/generated/sdui.pb.dart create mode 100644 lib/src/generated/sdui.pbenum.dart create mode 100644 lib/src/generated/sdui.pbgrpc.dart create mode 100644 lib/src/generated/sdui.pbjson.dart create mode 100644 lib/src/parser/sdui_proto_parser.dart create mode 100644 lib/src/protos/sdui.proto create mode 100644 lib/src/renderer/sdui_grpc_renderer.dart create mode 100644 lib/src/service/sdui_grpc_client.dart create mode 100644 lib/src/widgets/sdui_column.dart create mode 100644 lib/src/widgets/sdui_container.dart create mode 100644 lib/src/widgets/sdui_icon.dart create mode 100644 lib/src/widgets/sdui_image.dart create mode 100644 lib/src/widgets/sdui_row.dart create mode 100644 lib/src/widgets/sdui_scaffold.dart create mode 100644 lib/src/widgets/sdui_sized_box.dart create mode 100644 lib/src/widgets/sdui_spacer.dart create mode 100644 lib/src/widgets/sdui_text.dart create mode 100644 lib/src/widgets/sdui_widget.dart create mode 100644 tool/generate_protos.ps1 create mode 100644 tool/setup_protoc.ps1 diff --git a/.gitignore b/.gitignore index eb6c05c..8b77777 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ migrate_working_dir/ .flutter-plugins .flutter-plugins-dependencies build/ +bin \ No newline at end of file diff --git a/README.md b/README.md index 8f25179..2879199 100644 --- a/README.md +++ b/README.md @@ -2,43 +2,424 @@ GDSC VIT -

< Insert Project Title Here >

-

< Insert Project Description Here >

+

Flutter SDUI Package

+

A Flutter package for implementing Server-Driven UI with both JSON and gRPC support

--- + [![Join Us](https://img.shields.io/badge/Join%20Us-Developer%20Student%20Clubs-red)](https://dsc.community.dev/vellore-institute-of-technology/) [![Discord Chat](https://img.shields.io/discord/760928671698649098.svg)](https://discord.gg/498KVdSKWR) -[![DOCS](https://img.shields.io/badge/Documentation-see%20docs-green?style=flat-square&logo=appveyor)](INSERT_LINK_FOR_DOCS_HERE) - [![UI ](https://img.shields.io/badge/User%20Interface-Link%20to%20UI-orange?style=flat-square&logo=appveyor)](INSERT_UI_LINK_HERE) - +[![DOCS](https://img.shields.io/badge/Documentation-see%20docs-green?style=flat-square&logo=appveyor)](docs/grpc_support.md) +[![UI ](https://img.shields.io/badge/Flutter-SDK-blue?style=flat-square&logo=flutter)](https://flutter.dev) ## Features -- [ ] < feature > -- [ ] < feature > -- [ ] < feature > -- [ ] < feature > + +- [x] Render UI from server-provided definitions +- [x] Support for basic Flutter widgets (Text, Column, Row, Container, etc.) +- [x] JSON parsing for server responses +- [x] gRPC support for efficient communication +- [x] Protocol Buffers for type-safe data exchange +- [x] Easy-to-use client API
-## Dependencies - - < dependency > - - < dependency > +## Installation & Setup +Add the package to your `pubspec.yaml`: -## Running +```yaml +dependencies: + flutter_sdui: ^0.0.1 + flutter: ^3.0.0 + protobuf: ^4.1.0 + grpc: ^4.0.4 +``` +Or use the Flutter CLI: -< directions to install > ```bash -< insert code > +flutter pub add flutter_sdui +``` + +Then import the package in your Dart code: + +```dart +import 'package:flutter_sdui/flutter_sdui.dart'; +``` + +### Troubleshooting + +#### Protocol Buffer Issues + +If you encounter issues with the generated Protocol Buffer files: + +1. Make sure you have the correct versions of protobuf and grpc packages +2. Install protoc locally and regenerate the files: + +```powershell +# Run the setup script to install protoc +pwsh ./tool/setup_protoc.ps1 + +# Generate the Protobuf files +pwsh ./tool/generate_protos.ps1 +``` +## Usage + +There are two ways to use this package: + +1. **JSON-based approach**: For simpler implementations where you fetch UI definitions as JSON +2. **gRPC-based approach**: For more efficient, type-safe implementations using Protocol Buffers + +### Using the gRPC Client + +To use the gRPC client for fetching server-driven UI: + +````dart +import 'package:flutter/material.dart'; +import 'package:flutter_sdui/flutter_sdui.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'SDUI gRPC Demo', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + useMaterial3: true, + ), + home: const GrpcDemoScreen(), + ); + } +} + +class GrpcDemoScreen extends StatefulWidget { + const GrpcDemoScreen({super.key}); + + @override + State createState() => _GrpcDemoScreenState(); +} + +class _GrpcDemoScreenState extends State { + late SduiGrpcClient _grpcClient; + String _screenId = 'home'; + + @override + void initState() { + super.initState(); + // Connect to your gRPC server + _grpcClient = SduiGrpcClient( + host: 'localhost', // Replace with your server address + port: 50051, // Replace with your server port + ); + } + + @override + void dispose() { + // Close the gRPC connection when done + _grpcClient.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('SDUI gRPC Demo'), + ), + body: Column( + children: [ + // Screen selector + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + const Text('Screen: '), + const SizedBox(width: 8), + DropdownButton( + value: _screenId, + items: const [ + DropdownMenuItem(value: 'home', child: Text('Home')), + DropdownMenuItem(value: 'profile', child: Text('Profile')), + DropdownMenuItem(value: 'settings', child: Text('Settings')), + ], + onChanged: (value) { + if (value != null) { + setState(() { + _screenId = value; + }); + } + }, + ), + ], + ), + ), + + // SDUI Renderer that fetches UI from gRPC server + Expanded( + child: SduiGrpcRenderer( + client: _grpcClient, + screenId: _screenId, + loadingWidget: const Center( + child: CircularProgressIndicator(), + ), + errorBuilder: (context, error) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.error, color: Colors.red, size: 48), + const SizedBox(height: 16), + Text('Error: $error'), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () => setState(() {}), + child: const Text('Retry'), + ), + ], + ), + ); + }, + ), + ), + ], + ), + ); + } +} + +## Server Implementation + +### Setting Up a gRPC Server + +To create a server that provides UI definitions via gRPC: + +```dart +// Server implementation example +import 'package:grpc/grpc.dart'; +import 'package:flutter_sdui/src/generated/sdui.pb.dart'; +import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; + +Future main() async { + final server = Server.create( + services: [ + SduiServiceImpl(), + ], + ); + + final port = 50051; + await server.serve(port: port); + print('Server listening on port $port...'); + print('Press Ctrl+C to stop'); +} + +// Implementation of the SDUI service +class SduiServiceImpl extends SduiServiceBase { + @override + Future getSduiWidget( + ServiceCall call, SduiRequest request) async { + print('Received request for screen: ${request.screenId}'); + + // Based on the requested screen, return different UI definitions + switch (request.screenId) { + case 'home': + return _createHomeScreen(); + case 'profile': + return _createProfileScreen(); + case 'settings': + return _createSettingsScreen(); + default: + // Default or error screen + print('Warning: Unknown screen ID requested: ${request.screenId}'); + return _createErrorScreen(); + } + } + + // Example screen definition + SduiWidgetData _createHomeScreen() { + final homeScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 25 + ..green = 118 + ..blue = 210 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Home Screen' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Welcome to Server-Driven UI!' + ..textStyle = (TextStyleData() + ..fontSize = 22 + ..fontWeight = 'bold')), + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'This UI is rendered from gRPC data' + ])); + + return homeScreen; + } + + // Implement other screen methods similarly... +} +```` + +### Testing the gRPC Connection + +You can test the connection using a simple command-line client: + +```dart +// Simple client for testing gRPC connection +import 'dart:io'; +import 'package:flutter_sdui/src/service/sdui_grpc_client.dart'; + +Future main(List args) async { + final screenId = args.isNotEmpty ? args[0] : 'home'; + + print('Testing gRPC SDUI client...'); + print('Connecting to server at localhost:50051'); + print('Requesting screen: $screenId'); + + final client = SduiGrpcClient( + host: 'localhost', + port: 50051, + ); + + try { + print('Sending request...'); + final widget = await client.getWidget(screenId); + print('Response received!'); + print('Widget type: ${widget.type}'); + + if (widget.hasAppBar()) { + print('Has app bar: yes'); + } + + if (widget.hasBody()) { + print('Has body: yes'); + } + + print('Success!'); + } catch (e) { + print('Error: $e'); + } finally { + await client.dispose(); + } + + print('Test completed'); + exit(0); +} ``` -< directions to execute > +## Advanced Usage + +### Protobuf Definitions + +The package uses Protocol Buffers to define the data structures for gRPC communication. The main message types are: + +```protobuf +// Generic Widget message +message SduiWidgetData { + WidgetType type = 1; + map string_attributes = 2; // For simple string attributes like text content, image src + map double_attributes = 3; // For numerical attributes like width, height, flex + map bool_attributes = 4; // For boolean attributes + map int_attributes = 5; // For integer attributes like flex + + // Complex nested attributes + TextStyleData text_style = 6; + EdgeInsetsData padding = 7; + EdgeInsetsData margin = 8; + ColorData color = 9; + IconDataMessage icon = 10; + BoxDecorationData box_decoration = 11; + + // Children widgets + repeated SduiWidgetData children = 12; + SduiWidgetData child = 13; // For widgets that take a single child + + // Scaffold specific parts + SduiWidgetData app_bar = 14; + SduiWidgetData body = 15; + SduiWidgetData floating_action_button = 16; + ColorData background_color = 17; +} + +// Service definition +service SduiService { + rpc GetSduiWidget (SduiRequest) returns (SduiWidgetData); +} + +message SduiRequest { + string screen_id = 1; // Identifier for which UI to fetch +} +``` + +### Custom Widget Support + +The package supports various Flutter widgets out of the box, but you can also extend it to support custom widgets by: + +1. Adding new widget types to the `WidgetType` enum in the proto file +2. Extending the `SduiProtoParser` class to handle the new widget type + +```dart +// Extend the parser to support custom widgets +class MySduiProtoParser extends SduiProtoParser { + @override + SduiWidget parseProto(SduiWidgetData data) { + if (data.type == WidgetType.MY_CUSTOM_WIDGET) { + // Parse custom widget from proto data + return MyCustomSduiWidget( + // Extract attributes from data + ); + } + + // Fall back to parent implementation for standard widgets + return super.parseProto(data); + } +} +``` + +### Regenerating Proto Files + +If you modify the proto definitions, you need to regenerate the Dart files: + +1. Install the Protocol Buffer compiler (protoc) +2. Run the generator script: ```bash -< insert code > +cd your_package_directory +pwsh ./tool/generate_protos.ps1 ``` ## Contributors @@ -46,15 +427,15 @@ + +
- John Doe + Jothish Kamal

- Your Name Here (Insert Your Image Link In Src + Jothish Kamal

- + GitHub - + LinkedIn

diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..9ac3c2c --- /dev/null +++ b/build.yaml @@ -0,0 +1,10 @@ +targets: + $default: + builders: + protoc_plugin: # Using the package name as the builder key + enabled: true + options: + grpc: true # Enable gRPC stub generation + output_directory: lib/src/generated # Specify output directory + generate_mixins: true # Generate mixins for classes + generate_kythe_info: false diff --git a/example/grpc_example.dart b/example/grpc_example.dart new file mode 100644 index 0000000..f0b699d --- /dev/null +++ b/example/grpc_example.dart @@ -0,0 +1,118 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_sdui/flutter_sdui.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'SDUI gRPC Demo', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + useMaterial3: true, + ), + home: const GrpcRendererDemo(), + ); + } +} + +class GrpcRendererDemo extends StatefulWidget { + const GrpcRendererDemo({super.key}); + + @override + State createState() => _GrpcRendererDemoState(); +} + +class _GrpcRendererDemoState extends State { + late SduiGrpcClient _grpcClient; + String _screenId = 'home'; + + @override + void initState() { + super.initState(); + // Connect to your gRPC server + _grpcClient = SduiGrpcClient( + host: 'localhost', // Replace with your server address + port: 50051, // Replace with your server port + ); + } + + @override + void dispose() { + // Close the gRPC connection when done + _grpcClient.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('SDUI gRPC Demo'), + ), + body: Column( + children: [ + // Screen selector + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + const Text('Screen: '), + const SizedBox(width: 8), + DropdownButton( + value: _screenId, + items: const [ + DropdownMenuItem(value: 'home', child: Text('Home')), + DropdownMenuItem(value: 'profile', child: Text('Profile')), + DropdownMenuItem( + value: 'settings', child: Text('Settings')), + ], + onChanged: (value) { + if (value != null) { + setState(() { + _screenId = value; + }); + } + }, + ), + ], + ), + ), + + // SDUI Renderer that fetches UI from gRPC server + Expanded( + child: SduiGrpcRenderer( + client: _grpcClient, + screenId: _screenId, + loadingWidget: const Center( + child: CircularProgressIndicator(), + ), + errorBuilder: (context, error) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.error, color: Colors.red, size: 48), + const SizedBox(height: 16), + Text('Error: $error'), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () => setState(() {}), + child: const Text('Retry'), + ), + ], + ), + ); + }, + ), + ), + ], + ), + ); + } +} diff --git a/example/grpc_server_example_dart.dart b/example/grpc_server_example_dart.dart new file mode 100644 index 0000000..fabb3a4 --- /dev/null +++ b/example/grpc_server_example_dart.dart @@ -0,0 +1,294 @@ +// Server implementation example (Dart) +// Note: This is a standalone Dart server, not a Flutter application +// Run with: dart run example/grpc_server_example.dart +import 'package:grpc/grpc.dart'; +import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; + +Future main() async { + final server = Server.create( + services: [ + SduiServiceImpl(), + ], + ); + + final port = 50051; + await server.serve(port: port); + print('Server listening on port $port...'); + print('Press Ctrl+C to stop'); +} + +// Implementation of the SDUI service +class SduiServiceImpl extends SduiServiceBase { + @override + Future getSduiWidget( + ServiceCall call, SduiRequest request) async { + // Based on the requested screen, return different UI definitions + print('Received request for screen: ${request.screenId}'); + switch (request.screenId) { + case 'home': + return _createHomeScreen(); + case 'profile': + return _createProfileScreen(); + case 'settings': + return _createSettingsScreen(); + default: + // Default or error screen + print('Warning: Unknown screen ID requested: ${request.screenId}'); + return _createErrorScreen(); + } + } + + // Sample screen definitions + SduiWidgetData _createHomeScreen() { + final homeScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 25 + ..green = 118 + ..blue = 210 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Home Screen' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Welcome to Server-Driven UI!' + ..textStyle = (TextStyleData() + ..fontSize = 22 + ..fontWeight = 'bold')), + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData() + ..left = 16 + ..right = 16 + ..bottom = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = + 'This UI is rendered from data sent by the server via gRPC.'), + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..margin = (EdgeInsetsData() + ..left = 16 + ..right = 16) + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 240 + ..green = 240 + ..blue = 240 + ..alpha = 255)) + ..child = (SduiWidgetData() + ..type = WidgetType.ROW + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.ICON + ..icon = (IconDataMessage() + ..name = 'info' + ..color = (ColorData() + ..red = 25 + ..green = 118 + ..blue = 210 + ..alpha = 255) + ..size = 24), + SduiWidgetData() + ..type = WidgetType.SIZED_BOX + ..doubleAttributes['width'] = 16, + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = + 'Select a screen from the dropdown.' + ])) + ])); + + return homeScreen; + } + + SduiWidgetData _createProfileScreen() { + final profileScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 76 + ..green = 175 + ..blue = 80 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Profile Screen' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'User Profile' + ..textStyle = (TextStyleData() + ..fontSize = 22 + ..fontWeight = 'bold')), + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData() + ..left = 16 + ..right = 16 + ..bottom = 24) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = + 'This is a sample profile page rendered from gRPC data.'), + ])); + + return profileScreen; + } + + SduiWidgetData _createSettingsScreen() { + final settingsScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 121 + ..green = 85 + ..blue = 72 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Settings Screen' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'App Settings' + ..textStyle = (TextStyleData() + ..fontSize = 22 + ..fontWeight = 'bold')), + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData() + ..left = 16 + ..right = 16 + ..bottom = 24) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = + 'This is a sample settings page from the gRPC server.'), + ])); + + return settingsScreen; + } + + SduiWidgetData _createErrorScreen() { + final errorScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 211 + ..green = 47 + ..blue = 47 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Error' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Screen Not Found' + ..textStyle = (TextStyleData() + ..fontSize = 24 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 211 + ..green = 47 + ..blue = 47 + ..alpha = 255))), + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData() + ..left = 16 + ..right = 16) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = + 'The requested screen could not be found. Try a different screen ID.'), + ])); + + return errorScreen; + } +} diff --git a/lib/flutter_sdui.dart b/lib/flutter_sdui.dart index 298576d..a7e5442 100644 --- a/lib/flutter_sdui.dart +++ b/lib/flutter_sdui.dart @@ -1,5 +1,29 @@ -/// A Calculator. -class Calculator { - /// Returns [value] plus 1. - int addOne(int value) => value + 1; -} +/// Flutter SDUI Package +/// +/// A Flutter package to render server driven UI. +library; + +// Export the core parser and widget base +export 'src/parser/sdui_proto_parser.dart'; // New proto parser +export 'src/widgets/sdui_widget.dart'; + +// Export individual widget models +export 'src/widgets/sdui_column.dart'; +export 'src/widgets/sdui_row.dart'; +export 'src/widgets/sdui_text.dart'; +export 'src/widgets/sdui_image.dart'; +export 'src/widgets/sdui_sized_box.dart'; +export 'src/widgets/sdui_container.dart'; +export 'src/widgets/sdui_scaffold.dart'; +export 'src/widgets/sdui_spacer.dart'; +export 'src/widgets/sdui_icon.dart'; + +// Export gRPC client and renderer +export 'src/service/sdui_grpc_client.dart'; +export 'src/renderer/sdui_grpc_renderer.dart'; + +// Export generated Protobuf models for public use +export 'src/generated/sdui.pb.dart'; +export 'src/generated/sdui.pbgrpc.dart'; +export 'src/generated/sdui.pbenum.dart'; +export 'src/generated/sdui.pbjson.dart'; diff --git a/lib/src/generated/sdui.pb.dart b/lib/src/generated/sdui.pb.dart new file mode 100644 index 0000000..10caa0e --- /dev/null +++ b/lib/src/generated/sdui.pb.dart @@ -0,0 +1,1680 @@ +// +// Generated code. Do not modify. +// source: sdui.proto +// +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'sdui.pbenum.dart'; + +export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions; + +export 'sdui.pbenum.dart'; + +/// Generic Widget message +class SduiWidgetData extends $pb.GeneratedMessage { + factory SduiWidgetData({ + WidgetType? type, + $core.Iterable<$core.MapEntry<$core.String, $core.String>>? stringAttributes, + $core.Iterable<$core.MapEntry<$core.String, $core.double>>? doubleAttributes, + $core.Iterable<$core.MapEntry<$core.String, $core.bool>>? boolAttributes, + $core.Iterable<$core.MapEntry<$core.String, $core.int>>? intAttributes, + TextStyleData? textStyle, + EdgeInsetsData? padding, + EdgeInsetsData? margin, + ColorData? color, + IconDataMessage? icon, + BoxDecorationData? boxDecoration, + $core.Iterable? children, + SduiWidgetData? child, + SduiWidgetData? appBar, + SduiWidgetData? body, + SduiWidgetData? floatingActionButton, + ColorData? backgroundColor, + }) { + final $result = create(); + if (type != null) { + $result.type = type; + } + if (stringAttributes != null) { + $result.stringAttributes.addEntries(stringAttributes); + } + if (doubleAttributes != null) { + $result.doubleAttributes.addEntries(doubleAttributes); + } + if (boolAttributes != null) { + $result.boolAttributes.addEntries(boolAttributes); + } + if (intAttributes != null) { + $result.intAttributes.addEntries(intAttributes); + } + if (textStyle != null) { + $result.textStyle = textStyle; + } + if (padding != null) { + $result.padding = padding; + } + if (margin != null) { + $result.margin = margin; + } + if (color != null) { + $result.color = color; + } + if (icon != null) { + $result.icon = icon; + } + if (boxDecoration != null) { + $result.boxDecoration = boxDecoration; + } + if (children != null) { + $result.children.addAll(children); + } + if (child != null) { + $result.child = child; + } + if (appBar != null) { + $result.appBar = appBar; + } + if (body != null) { + $result.body = body; + } + if (floatingActionButton != null) { + $result.floatingActionButton = floatingActionButton; + } + if (backgroundColor != null) { + $result.backgroundColor = backgroundColor; + } + return $result; + } + SduiWidgetData._() : super(); + factory SduiWidgetData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SduiWidgetData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SduiWidgetData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: WidgetType.WIDGET_TYPE_UNSPECIFIED, valueOf: WidgetType.valueOf, enumValues: WidgetType.values) + ..m<$core.String, $core.String>(2, _omitFieldNames ? '' : 'stringAttributes', entryClassName: 'SduiWidgetData.StringAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS, packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.double>(3, _omitFieldNames ? '' : 'doubleAttributes', entryClassName: 'SduiWidgetData.DoubleAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OD, packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.bool>(4, _omitFieldNames ? '' : 'boolAttributes', entryClassName: 'SduiWidgetData.BoolAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OB, packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.int>(5, _omitFieldNames ? '' : 'intAttributes', entryClassName: 'SduiWidgetData.IntAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.O3, packageName: const $pb.PackageName('flutter_sdui')) + ..aOM(6, _omitFieldNames ? '' : 'textStyle', subBuilder: TextStyleData.create) + ..aOM(7, _omitFieldNames ? '' : 'padding', subBuilder: EdgeInsetsData.create) + ..aOM(8, _omitFieldNames ? '' : 'margin', subBuilder: EdgeInsetsData.create) + ..aOM(9, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..aOM(10, _omitFieldNames ? '' : 'icon', subBuilder: IconDataMessage.create) + ..aOM(11, _omitFieldNames ? '' : 'boxDecoration', subBuilder: BoxDecorationData.create) + ..pc(12, _omitFieldNames ? '' : 'children', $pb.PbFieldType.PM, subBuilder: SduiWidgetData.create) + ..aOM(13, _omitFieldNames ? '' : 'child', subBuilder: SduiWidgetData.create) + ..aOM(14, _omitFieldNames ? '' : 'appBar', subBuilder: SduiWidgetData.create) + ..aOM(15, _omitFieldNames ? '' : 'body', subBuilder: SduiWidgetData.create) + ..aOM(16, _omitFieldNames ? '' : 'floatingActionButton', subBuilder: SduiWidgetData.create) + ..aOM(17, _omitFieldNames ? '' : 'backgroundColor', subBuilder: ColorData.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + SduiWidgetData clone() => SduiWidgetData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + SduiWidgetData copyWith(void Function(SduiWidgetData) updates) => super.copyWith((message) => updates(message as SduiWidgetData)) as SduiWidgetData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SduiWidgetData create() => SduiWidgetData._(); + SduiWidgetData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SduiWidgetData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SduiWidgetData? _defaultInstance; + + @$pb.TagNumber(1) + WidgetType get type => $_getN(0); + @$pb.TagNumber(1) + set type(WidgetType v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasType() => $_has(0); + @$pb.TagNumber(1) + void clearType() => $_clearField(1); + + @$pb.TagNumber(2) + $pb.PbMap<$core.String, $core.String> get stringAttributes => $_getMap(1); + + @$pb.TagNumber(3) + $pb.PbMap<$core.String, $core.double> get doubleAttributes => $_getMap(2); + + @$pb.TagNumber(4) + $pb.PbMap<$core.String, $core.bool> get boolAttributes => $_getMap(3); + + @$pb.TagNumber(5) + $pb.PbMap<$core.String, $core.int> get intAttributes => $_getMap(4); + + /// Complex nested attributes + @$pb.TagNumber(6) + TextStyleData get textStyle => $_getN(5); + @$pb.TagNumber(6) + set textStyle(TextStyleData v) { $_setField(6, v); } + @$pb.TagNumber(6) + $core.bool hasTextStyle() => $_has(5); + @$pb.TagNumber(6) + void clearTextStyle() => $_clearField(6); + @$pb.TagNumber(6) + TextStyleData ensureTextStyle() => $_ensure(5); + + @$pb.TagNumber(7) + EdgeInsetsData get padding => $_getN(6); + @$pb.TagNumber(7) + set padding(EdgeInsetsData v) { $_setField(7, v); } + @$pb.TagNumber(7) + $core.bool hasPadding() => $_has(6); + @$pb.TagNumber(7) + void clearPadding() => $_clearField(7); + @$pb.TagNumber(7) + EdgeInsetsData ensurePadding() => $_ensure(6); + + @$pb.TagNumber(8) + EdgeInsetsData get margin => $_getN(7); + @$pb.TagNumber(8) + set margin(EdgeInsetsData v) { $_setField(8, v); } + @$pb.TagNumber(8) + $core.bool hasMargin() => $_has(7); + @$pb.TagNumber(8) + void clearMargin() => $_clearField(8); + @$pb.TagNumber(8) + EdgeInsetsData ensureMargin() => $_ensure(7); + + @$pb.TagNumber(9) + ColorData get color => $_getN(8); + @$pb.TagNumber(9) + set color(ColorData v) { $_setField(9, v); } + @$pb.TagNumber(9) + $core.bool hasColor() => $_has(8); + @$pb.TagNumber(9) + void clearColor() => $_clearField(9); + @$pb.TagNumber(9) + ColorData ensureColor() => $_ensure(8); + + @$pb.TagNumber(10) + IconDataMessage get icon => $_getN(9); + @$pb.TagNumber(10) + set icon(IconDataMessage v) { $_setField(10, v); } + @$pb.TagNumber(10) + $core.bool hasIcon() => $_has(9); + @$pb.TagNumber(10) + void clearIcon() => $_clearField(10); + @$pb.TagNumber(10) + IconDataMessage ensureIcon() => $_ensure(9); + + @$pb.TagNumber(11) + BoxDecorationData get boxDecoration => $_getN(10); + @$pb.TagNumber(11) + set boxDecoration(BoxDecorationData v) { $_setField(11, v); } + @$pb.TagNumber(11) + $core.bool hasBoxDecoration() => $_has(10); + @$pb.TagNumber(11) + void clearBoxDecoration() => $_clearField(11); + @$pb.TagNumber(11) + BoxDecorationData ensureBoxDecoration() => $_ensure(10); + + /// Children widgets + @$pb.TagNumber(12) + $pb.PbList get children => $_getList(11); + + @$pb.TagNumber(13) + SduiWidgetData get child => $_getN(12); + @$pb.TagNumber(13) + set child(SduiWidgetData v) { $_setField(13, v); } + @$pb.TagNumber(13) + $core.bool hasChild() => $_has(12); + @$pb.TagNumber(13) + void clearChild() => $_clearField(13); + @$pb.TagNumber(13) + SduiWidgetData ensureChild() => $_ensure(12); + + /// Scaffold specific parts + @$pb.TagNumber(14) + SduiWidgetData get appBar => $_getN(13); + @$pb.TagNumber(14) + set appBar(SduiWidgetData v) { $_setField(14, v); } + @$pb.TagNumber(14) + $core.bool hasAppBar() => $_has(13); + @$pb.TagNumber(14) + void clearAppBar() => $_clearField(14); + @$pb.TagNumber(14) + SduiWidgetData ensureAppBar() => $_ensure(13); + + @$pb.TagNumber(15) + SduiWidgetData get body => $_getN(14); + @$pb.TagNumber(15) + set body(SduiWidgetData v) { $_setField(15, v); } + @$pb.TagNumber(15) + $core.bool hasBody() => $_has(14); + @$pb.TagNumber(15) + void clearBody() => $_clearField(15); + @$pb.TagNumber(15) + SduiWidgetData ensureBody() => $_ensure(14); + + @$pb.TagNumber(16) + SduiWidgetData get floatingActionButton => $_getN(15); + @$pb.TagNumber(16) + set floatingActionButton(SduiWidgetData v) { $_setField(16, v); } + @$pb.TagNumber(16) + $core.bool hasFloatingActionButton() => $_has(15); + @$pb.TagNumber(16) + void clearFloatingActionButton() => $_clearField(16); + @$pb.TagNumber(16) + SduiWidgetData ensureFloatingActionButton() => $_ensure(15); + + @$pb.TagNumber(17) + ColorData get backgroundColor => $_getN(16); + @$pb.TagNumber(17) + set backgroundColor(ColorData v) { $_setField(17, v); } + @$pb.TagNumber(17) + $core.bool hasBackgroundColor() => $_has(16); + @$pb.TagNumber(17) + void clearBackgroundColor() => $_clearField(17); + @$pb.TagNumber(17) + ColorData ensureBackgroundColor() => $_ensure(16); +} + +/// Message for Color +class ColorData extends $pb.GeneratedMessage { + factory ColorData({ + $core.int? alpha, + $core.int? red, + $core.int? green, + $core.int? blue, + }) { + final $result = create(); + if (alpha != null) { + $result.alpha = alpha; + } + if (red != null) { + $result.red = red; + } + if (green != null) { + $result.green = green; + } + if (blue != null) { + $result.blue = blue; + } + return $result; + } + ColorData._() : super(); + factory ColorData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ColorData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ColorData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..a<$core.int>(1, _omitFieldNames ? '' : 'alpha', $pb.PbFieldType.O3) + ..a<$core.int>(2, _omitFieldNames ? '' : 'red', $pb.PbFieldType.O3) + ..a<$core.int>(3, _omitFieldNames ? '' : 'green', $pb.PbFieldType.O3) + ..a<$core.int>(4, _omitFieldNames ? '' : 'blue', $pb.PbFieldType.O3) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ColorData clone() => ColorData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ColorData copyWith(void Function(ColorData) updates) => super.copyWith((message) => updates(message as ColorData)) as ColorData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ColorData create() => ColorData._(); + ColorData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ColorData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ColorData? _defaultInstance; + + @$pb.TagNumber(1) + $core.int get alpha => $_getIZ(0); + @$pb.TagNumber(1) + set alpha($core.int v) { $_setSignedInt32(0, v); } + @$pb.TagNumber(1) + $core.bool hasAlpha() => $_has(0); + @$pb.TagNumber(1) + void clearAlpha() => $_clearField(1); + + @$pb.TagNumber(2) + $core.int get red => $_getIZ(1); + @$pb.TagNumber(2) + set red($core.int v) { $_setSignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasRed() => $_has(1); + @$pb.TagNumber(2) + void clearRed() => $_clearField(2); + + @$pb.TagNumber(3) + $core.int get green => $_getIZ(2); + @$pb.TagNumber(3) + set green($core.int v) { $_setSignedInt32(2, v); } + @$pb.TagNumber(3) + $core.bool hasGreen() => $_has(2); + @$pb.TagNumber(3) + void clearGreen() => $_clearField(3); + + @$pb.TagNumber(4) + $core.int get blue => $_getIZ(3); + @$pb.TagNumber(4) + set blue($core.int v) { $_setSignedInt32(3, v); } + @$pb.TagNumber(4) + $core.bool hasBlue() => $_has(3); + @$pb.TagNumber(4) + void clearBlue() => $_clearField(4); +} + +/// Message for EdgeInsets (for padding, margin) +class EdgeInsetsData extends $pb.GeneratedMessage { + factory EdgeInsetsData({ + $core.double? left, + $core.double? top, + $core.double? right, + $core.double? bottom, + $core.double? all, + }) { + final $result = create(); + if (left != null) { + $result.left = left; + } + if (top != null) { + $result.top = top; + } + if (right != null) { + $result.right = right; + } + if (bottom != null) { + $result.bottom = bottom; + } + if (all != null) { + $result.all = all; + } + return $result; + } + EdgeInsetsData._() : super(); + factory EdgeInsetsData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory EdgeInsetsData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EdgeInsetsData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'left', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'top', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'right', $pb.PbFieldType.OD) + ..a<$core.double>(4, _omitFieldNames ? '' : 'bottom', $pb.PbFieldType.OD) + ..a<$core.double>(5, _omitFieldNames ? '' : 'all', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + EdgeInsetsData clone() => EdgeInsetsData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + EdgeInsetsData copyWith(void Function(EdgeInsetsData) updates) => super.copyWith((message) => updates(message as EdgeInsetsData)) as EdgeInsetsData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static EdgeInsetsData create() => EdgeInsetsData._(); + EdgeInsetsData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static EdgeInsetsData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static EdgeInsetsData? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get left => $_getN(0); + @$pb.TagNumber(1) + set left($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasLeft() => $_has(0); + @$pb.TagNumber(1) + void clearLeft() => $_clearField(1); + + @$pb.TagNumber(2) + $core.double get top => $_getN(1); + @$pb.TagNumber(2) + set top($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasTop() => $_has(1); + @$pb.TagNumber(2) + void clearTop() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get right => $_getN(2); + @$pb.TagNumber(3) + set right($core.double v) { $_setDouble(2, v); } + @$pb.TagNumber(3) + $core.bool hasRight() => $_has(2); + @$pb.TagNumber(3) + void clearRight() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get bottom => $_getN(3); + @$pb.TagNumber(4) + set bottom($core.double v) { $_setDouble(3, v); } + @$pb.TagNumber(4) + $core.bool hasBottom() => $_has(3); + @$pb.TagNumber(4) + void clearBottom() => $_clearField(4); + + @$pb.TagNumber(5) + $core.double get all => $_getN(4); + @$pb.TagNumber(5) + set all($core.double v) { $_setDouble(4, v); } + @$pb.TagNumber(5) + $core.bool hasAll() => $_has(4); + @$pb.TagNumber(5) + void clearAll() => $_clearField(5); +} + +/// Message for TextStyle +class TextStyleData extends $pb.GeneratedMessage { + factory TextStyleData({ + ColorData? color, + $core.double? fontSize, + $core.String? fontWeight, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (fontSize != null) { + $result.fontSize = fontSize; + } + if (fontWeight != null) { + $result.fontWeight = fontWeight; + } + return $result; + } + TextStyleData._() : super(); + factory TextStyleData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory TextStyleData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'TextStyleData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..a<$core.double>(2, _omitFieldNames ? '' : 'fontSize', $pb.PbFieldType.OD) + ..aOS(3, _omitFieldNames ? '' : 'fontWeight') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TextStyleData clone() => TextStyleData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TextStyleData copyWith(void Function(TextStyleData) updates) => super.copyWith((message) => updates(message as TextStyleData)) as TextStyleData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static TextStyleData create() => TextStyleData._(); + TextStyleData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static TextStyleData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static TextStyleData? _defaultInstance; + + @$pb.TagNumber(1) + ColorData get color => $_getN(0); + @$pb.TagNumber(1) + set color(ColorData v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => $_clearField(1); + @$pb.TagNumber(1) + ColorData ensureColor() => $_ensure(0); + + @$pb.TagNumber(2) + $core.double get fontSize => $_getN(1); + @$pb.TagNumber(2) + set fontSize($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasFontSize() => $_has(1); + @$pb.TagNumber(2) + void clearFontSize() => $_clearField(2); + + @$pb.TagNumber(3) + $core.String get fontWeight => $_getSZ(2); + @$pb.TagNumber(3) + set fontWeight($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasFontWeight() => $_has(2); + @$pb.TagNumber(3) + void clearFontWeight() => $_clearField(3); +} + +/// Message for IconData +class IconDataMessage extends $pb.GeneratedMessage { + factory IconDataMessage({ + $core.String? name, + $core.int? codePoint, + $core.String? fontFamily, + ColorData? color, + $core.double? size, + }) { + final $result = create(); + if (name != null) { + $result.name = name; + } + if (codePoint != null) { + $result.codePoint = codePoint; + } + if (fontFamily != null) { + $result.fontFamily = fontFamily; + } + if (color != null) { + $result.color = color; + } + if (size != null) { + $result.size = size; + } + return $result; + } + IconDataMessage._() : super(); + factory IconDataMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory IconDataMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'IconDataMessage', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..a<$core.int>(2, _omitFieldNames ? '' : 'codePoint', $pb.PbFieldType.O3) + ..aOS(3, _omitFieldNames ? '' : 'fontFamily') + ..aOM(4, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..a<$core.double>(5, _omitFieldNames ? '' : 'size', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + IconDataMessage clone() => IconDataMessage()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + IconDataMessage copyWith(void Function(IconDataMessage) updates) => super.copyWith((message) => updates(message as IconDataMessage)) as IconDataMessage; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static IconDataMessage create() => IconDataMessage._(); + IconDataMessage createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static IconDataMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static IconDataMessage? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => $_clearField(1); + + @$pb.TagNumber(2) + $core.int get codePoint => $_getIZ(1); + @$pb.TagNumber(2) + set codePoint($core.int v) { $_setSignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasCodePoint() => $_has(1); + @$pb.TagNumber(2) + void clearCodePoint() => $_clearField(2); + + @$pb.TagNumber(3) + $core.String get fontFamily => $_getSZ(2); + @$pb.TagNumber(3) + set fontFamily($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasFontFamily() => $_has(2); + @$pb.TagNumber(3) + void clearFontFamily() => $_clearField(3); + + @$pb.TagNumber(4) + ColorData get color => $_getN(3); + @$pb.TagNumber(4) + set color(ColorData v) { $_setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasColor() => $_has(3); + @$pb.TagNumber(4) + void clearColor() => $_clearField(4); + @$pb.TagNumber(4) + ColorData ensureColor() => $_ensure(3); + + @$pb.TagNumber(5) + $core.double get size => $_getN(4); + @$pb.TagNumber(5) + set size($core.double v) { $_setDouble(4, v); } + @$pb.TagNumber(5) + $core.bool hasSize() => $_has(4); + @$pb.TagNumber(5) + void clearSize() => $_clearField(5); +} + +/// Message for BoxDecoration +class BoxDecorationData extends $pb.GeneratedMessage { + factory BoxDecorationData({ + ColorData? color, + BorderRadiusData? borderRadius, + BorderData? border, + $core.Iterable? boxShadow, + GradientData? gradient, + BoxShapeProto? shape, + DecorationImageData? image, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (borderRadius != null) { + $result.borderRadius = borderRadius; + } + if (border != null) { + $result.border = border; + } + if (boxShadow != null) { + $result.boxShadow.addAll(boxShadow); + } + if (gradient != null) { + $result.gradient = gradient; + } + if (shape != null) { + $result.shape = shape; + } + if (image != null) { + $result.image = image; + } + return $result; + } + BoxDecorationData._() : super(); + factory BoxDecorationData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BoxDecorationData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BoxDecorationData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..aOM(2, _omitFieldNames ? '' : 'borderRadius', subBuilder: BorderRadiusData.create) + ..aOM(3, _omitFieldNames ? '' : 'border', subBuilder: BorderData.create) + ..pc(4, _omitFieldNames ? '' : 'boxShadow', $pb.PbFieldType.PM, subBuilder: BoxShadowData.create) + ..aOM(5, _omitFieldNames ? '' : 'gradient', subBuilder: GradientData.create) + ..e(6, _omitFieldNames ? '' : 'shape', $pb.PbFieldType.OE, defaultOrMaker: BoxShapeProto.BOX_SHAPE_UNSPECIFIED, valueOf: BoxShapeProto.valueOf, enumValues: BoxShapeProto.values) + ..aOM(7, _omitFieldNames ? '' : 'image', subBuilder: DecorationImageData.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxDecorationData clone() => BoxDecorationData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxDecorationData copyWith(void Function(BoxDecorationData) updates) => super.copyWith((message) => updates(message as BoxDecorationData)) as BoxDecorationData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BoxDecorationData create() => BoxDecorationData._(); + BoxDecorationData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BoxDecorationData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BoxDecorationData? _defaultInstance; + + @$pb.TagNumber(1) + ColorData get color => $_getN(0); + @$pb.TagNumber(1) + set color(ColorData v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => $_clearField(1); + @$pb.TagNumber(1) + ColorData ensureColor() => $_ensure(0); + + @$pb.TagNumber(2) + BorderRadiusData get borderRadius => $_getN(1); + @$pb.TagNumber(2) + set borderRadius(BorderRadiusData v) { $_setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasBorderRadius() => $_has(1); + @$pb.TagNumber(2) + void clearBorderRadius() => $_clearField(2); + @$pb.TagNumber(2) + BorderRadiusData ensureBorderRadius() => $_ensure(1); + + @$pb.TagNumber(3) + BorderData get border => $_getN(2); + @$pb.TagNumber(3) + set border(BorderData v) { $_setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasBorder() => $_has(2); + @$pb.TagNumber(3) + void clearBorder() => $_clearField(3); + @$pb.TagNumber(3) + BorderData ensureBorder() => $_ensure(2); + + @$pb.TagNumber(4) + $pb.PbList get boxShadow => $_getList(3); + + @$pb.TagNumber(5) + GradientData get gradient => $_getN(4); + @$pb.TagNumber(5) + set gradient(GradientData v) { $_setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasGradient() => $_has(4); + @$pb.TagNumber(5) + void clearGradient() => $_clearField(5); + @$pb.TagNumber(5) + GradientData ensureGradient() => $_ensure(4); + + @$pb.TagNumber(6) + BoxShapeProto get shape => $_getN(5); + @$pb.TagNumber(6) + set shape(BoxShapeProto v) { $_setField(6, v); } + @$pb.TagNumber(6) + $core.bool hasShape() => $_has(5); + @$pb.TagNumber(6) + void clearShape() => $_clearField(6); + + @$pb.TagNumber(7) + DecorationImageData get image => $_getN(6); + @$pb.TagNumber(7) + set image(DecorationImageData v) { $_setField(7, v); } + @$pb.TagNumber(7) + $core.bool hasImage() => $_has(6); + @$pb.TagNumber(7) + void clearImage() => $_clearField(7); + @$pb.TagNumber(7) + DecorationImageData ensureImage() => $_ensure(6); +} + +/// Message for BorderRadius +class BorderRadiusData extends $pb.GeneratedMessage { + factory BorderRadiusData({ + $core.double? all, + $core.double? topLeft, + $core.double? topRight, + $core.double? bottomLeft, + $core.double? bottomRight, + }) { + final $result = create(); + if (all != null) { + $result.all = all; + } + if (topLeft != null) { + $result.topLeft = topLeft; + } + if (topRight != null) { + $result.topRight = topRight; + } + if (bottomLeft != null) { + $result.bottomLeft = bottomLeft; + } + if (bottomRight != null) { + $result.bottomRight = bottomRight; + } + return $result; + } + BorderRadiusData._() : super(); + factory BorderRadiusData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BorderRadiusData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderRadiusData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'all', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'topLeft', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'topRight', $pb.PbFieldType.OD) + ..a<$core.double>(4, _omitFieldNames ? '' : 'bottomLeft', $pb.PbFieldType.OD) + ..a<$core.double>(5, _omitFieldNames ? '' : 'bottomRight', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderRadiusData clone() => BorderRadiusData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderRadiusData copyWith(void Function(BorderRadiusData) updates) => super.copyWith((message) => updates(message as BorderRadiusData)) as BorderRadiusData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BorderRadiusData create() => BorderRadiusData._(); + BorderRadiusData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BorderRadiusData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderRadiusData? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get all => $_getN(0); + @$pb.TagNumber(1) + set all($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasAll() => $_has(0); + @$pb.TagNumber(1) + void clearAll() => $_clearField(1); + + /// For BorderRadius.only or .vertical/.horizontal if needed later + @$pb.TagNumber(2) + $core.double get topLeft => $_getN(1); + @$pb.TagNumber(2) + set topLeft($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasTopLeft() => $_has(1); + @$pb.TagNumber(2) + void clearTopLeft() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get topRight => $_getN(2); + @$pb.TagNumber(3) + set topRight($core.double v) { $_setDouble(2, v); } + @$pb.TagNumber(3) + $core.bool hasTopRight() => $_has(2); + @$pb.TagNumber(3) + void clearTopRight() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get bottomLeft => $_getN(3); + @$pb.TagNumber(4) + set bottomLeft($core.double v) { $_setDouble(3, v); } + @$pb.TagNumber(4) + $core.bool hasBottomLeft() => $_has(3); + @$pb.TagNumber(4) + void clearBottomLeft() => $_clearField(4); + + @$pb.TagNumber(5) + $core.double get bottomRight => $_getN(4); + @$pb.TagNumber(5) + set bottomRight($core.double v) { $_setDouble(4, v); } + @$pb.TagNumber(5) + $core.bool hasBottomRight() => $_has(4); + @$pb.TagNumber(5) + void clearBottomRight() => $_clearField(5); +} + +/// Message for BorderSide +class BorderSideData extends $pb.GeneratedMessage { + factory BorderSideData({ + ColorData? color, + $core.double? width, + BorderStyleProto? style, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (width != null) { + $result.width = width; + } + if (style != null) { + $result.style = style; + } + return $result; + } + BorderSideData._() : super(); + factory BorderSideData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BorderSideData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderSideData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..a<$core.double>(2, _omitFieldNames ? '' : 'width', $pb.PbFieldType.OD) + ..e(3, _omitFieldNames ? '' : 'style', $pb.PbFieldType.OE, defaultOrMaker: BorderStyleProto.BORDER_STYLE_UNSPECIFIED, valueOf: BorderStyleProto.valueOf, enumValues: BorderStyleProto.values) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderSideData clone() => BorderSideData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderSideData copyWith(void Function(BorderSideData) updates) => super.copyWith((message) => updates(message as BorderSideData)) as BorderSideData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BorderSideData create() => BorderSideData._(); + BorderSideData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BorderSideData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderSideData? _defaultInstance; + + @$pb.TagNumber(1) + ColorData get color => $_getN(0); + @$pb.TagNumber(1) + set color(ColorData v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => $_clearField(1); + @$pb.TagNumber(1) + ColorData ensureColor() => $_ensure(0); + + @$pb.TagNumber(2) + $core.double get width => $_getN(1); + @$pb.TagNumber(2) + set width($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasWidth() => $_has(1); + @$pb.TagNumber(2) + void clearWidth() => $_clearField(2); + + @$pb.TagNumber(3) + BorderStyleProto get style => $_getN(2); + @$pb.TagNumber(3) + set style(BorderStyleProto v) { $_setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasStyle() => $_has(2); + @$pb.TagNumber(3) + void clearStyle() => $_clearField(3); +} + +/// Message for Border +class BorderData extends $pb.GeneratedMessage { + factory BorderData({ + BorderSideData? top, + BorderSideData? right, + BorderSideData? bottom, + BorderSideData? left, + BorderSideData? all, + }) { + final $result = create(); + if (top != null) { + $result.top = top; + } + if (right != null) { + $result.right = right; + } + if (bottom != null) { + $result.bottom = bottom; + } + if (left != null) { + $result.left = left; + } + if (all != null) { + $result.all = all; + } + return $result; + } + BorderData._() : super(); + factory BorderData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BorderData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'top', subBuilder: BorderSideData.create) + ..aOM(2, _omitFieldNames ? '' : 'right', subBuilder: BorderSideData.create) + ..aOM(3, _omitFieldNames ? '' : 'bottom', subBuilder: BorderSideData.create) + ..aOM(4, _omitFieldNames ? '' : 'left', subBuilder: BorderSideData.create) + ..aOM(5, _omitFieldNames ? '' : 'all', subBuilder: BorderSideData.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderData clone() => BorderData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BorderData copyWith(void Function(BorderData) updates) => super.copyWith((message) => updates(message as BorderData)) as BorderData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BorderData create() => BorderData._(); + BorderData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BorderData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderData? _defaultInstance; + + @$pb.TagNumber(1) + BorderSideData get top => $_getN(0); + @$pb.TagNumber(1) + set top(BorderSideData v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasTop() => $_has(0); + @$pb.TagNumber(1) + void clearTop() => $_clearField(1); + @$pb.TagNumber(1) + BorderSideData ensureTop() => $_ensure(0); + + @$pb.TagNumber(2) + BorderSideData get right => $_getN(1); + @$pb.TagNumber(2) + set right(BorderSideData v) { $_setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasRight() => $_has(1); + @$pb.TagNumber(2) + void clearRight() => $_clearField(2); + @$pb.TagNumber(2) + BorderSideData ensureRight() => $_ensure(1); + + @$pb.TagNumber(3) + BorderSideData get bottom => $_getN(2); + @$pb.TagNumber(3) + set bottom(BorderSideData v) { $_setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasBottom() => $_has(2); + @$pb.TagNumber(3) + void clearBottom() => $_clearField(3); + @$pb.TagNumber(3) + BorderSideData ensureBottom() => $_ensure(2); + + @$pb.TagNumber(4) + BorderSideData get left => $_getN(3); + @$pb.TagNumber(4) + set left(BorderSideData v) { $_setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasLeft() => $_has(3); + @$pb.TagNumber(4) + void clearLeft() => $_clearField(4); + @$pb.TagNumber(4) + BorderSideData ensureLeft() => $_ensure(3); + + @$pb.TagNumber(5) + BorderSideData get all => $_getN(4); + @$pb.TagNumber(5) + set all(BorderSideData v) { $_setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasAll() => $_has(4); + @$pb.TagNumber(5) + void clearAll() => $_clearField(5); + @$pb.TagNumber(5) + BorderSideData ensureAll() => $_ensure(4); +} + +/// Message for BoxShadow +class BoxShadowData extends $pb.GeneratedMessage { + factory BoxShadowData({ + ColorData? color, + $core.double? offsetX, + $core.double? offsetY, + $core.double? blurRadius, + $core.double? spreadRadius, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (offsetX != null) { + $result.offsetX = offsetX; + } + if (offsetY != null) { + $result.offsetY = offsetY; + } + if (blurRadius != null) { + $result.blurRadius = blurRadius; + } + if (spreadRadius != null) { + $result.spreadRadius = spreadRadius; + } + return $result; + } + BoxShadowData._() : super(); + factory BoxShadowData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BoxShadowData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BoxShadowData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..a<$core.double>(2, _omitFieldNames ? '' : 'offsetX', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'offsetY', $pb.PbFieldType.OD) + ..a<$core.double>(4, _omitFieldNames ? '' : 'blurRadius', $pb.PbFieldType.OD) + ..a<$core.double>(5, _omitFieldNames ? '' : 'spreadRadius', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxShadowData clone() => BoxShadowData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxShadowData copyWith(void Function(BoxShadowData) updates) => super.copyWith((message) => updates(message as BoxShadowData)) as BoxShadowData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BoxShadowData create() => BoxShadowData._(); + BoxShadowData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BoxShadowData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BoxShadowData? _defaultInstance; + + @$pb.TagNumber(1) + ColorData get color => $_getN(0); + @$pb.TagNumber(1) + set color(ColorData v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => $_clearField(1); + @$pb.TagNumber(1) + ColorData ensureColor() => $_ensure(0); + + @$pb.TagNumber(2) + $core.double get offsetX => $_getN(1); + @$pb.TagNumber(2) + set offsetX($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasOffsetX() => $_has(1); + @$pb.TagNumber(2) + void clearOffsetX() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get offsetY => $_getN(2); + @$pb.TagNumber(3) + set offsetY($core.double v) { $_setDouble(2, v); } + @$pb.TagNumber(3) + $core.bool hasOffsetY() => $_has(2); + @$pb.TagNumber(3) + void clearOffsetY() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get blurRadius => $_getN(3); + @$pb.TagNumber(4) + set blurRadius($core.double v) { $_setDouble(3, v); } + @$pb.TagNumber(4) + $core.bool hasBlurRadius() => $_has(3); + @$pb.TagNumber(4) + void clearBlurRadius() => $_clearField(4); + + @$pb.TagNumber(5) + $core.double get spreadRadius => $_getN(4); + @$pb.TagNumber(5) + set spreadRadius($core.double v) { $_setDouble(4, v); } + @$pb.TagNumber(5) + $core.bool hasSpreadRadius() => $_has(4); + @$pb.TagNumber(5) + void clearSpreadRadius() => $_clearField(5); +} + +/// Message for Gradient +class GradientData extends $pb.GeneratedMessage { + factory GradientData({ + GradientData_GradientType? type, + $core.Iterable? colors, + $core.Iterable<$core.double>? stops, + AlignmentData? begin, + AlignmentData? end, + AlignmentData? center, + $core.double? radius, + $core.double? startAngle, + $core.double? endAngle, + }) { + final $result = create(); + if (type != null) { + $result.type = type; + } + if (colors != null) { + $result.colors.addAll(colors); + } + if (stops != null) { + $result.stops.addAll(stops); + } + if (begin != null) { + $result.begin = begin; + } + if (end != null) { + $result.end = end; + } + if (center != null) { + $result.center = center; + } + if (radius != null) { + $result.radius = radius; + } + if (startAngle != null) { + $result.startAngle = startAngle; + } + if (endAngle != null) { + $result.endAngle = endAngle; + } + return $result; + } + GradientData._() : super(); + factory GradientData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GradientData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GradientData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: GradientData_GradientType.GRADIENT_TYPE_UNSPECIFIED, valueOf: GradientData_GradientType.valueOf, enumValues: GradientData_GradientType.values) + ..pc(2, _omitFieldNames ? '' : 'colors', $pb.PbFieldType.PM, subBuilder: ColorData.create) + ..p<$core.double>(3, _omitFieldNames ? '' : 'stops', $pb.PbFieldType.KD) + ..aOM(4, _omitFieldNames ? '' : 'begin', subBuilder: AlignmentData.create) + ..aOM(5, _omitFieldNames ? '' : 'end', subBuilder: AlignmentData.create) + ..aOM(6, _omitFieldNames ? '' : 'center', subBuilder: AlignmentData.create) + ..a<$core.double>(7, _omitFieldNames ? '' : 'radius', $pb.PbFieldType.OD) + ..a<$core.double>(8, _omitFieldNames ? '' : 'startAngle', $pb.PbFieldType.OD) + ..a<$core.double>(9, _omitFieldNames ? '' : 'endAngle', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + GradientData clone() => GradientData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + GradientData copyWith(void Function(GradientData) updates) => super.copyWith((message) => updates(message as GradientData)) as GradientData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static GradientData create() => GradientData._(); + GradientData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GradientData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GradientData? _defaultInstance; + + @$pb.TagNumber(1) + GradientData_GradientType get type => $_getN(0); + @$pb.TagNumber(1) + set type(GradientData_GradientType v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasType() => $_has(0); + @$pb.TagNumber(1) + void clearType() => $_clearField(1); + + @$pb.TagNumber(2) + $pb.PbList get colors => $_getList(1); + + @$pb.TagNumber(3) + $pb.PbList<$core.double> get stops => $_getList(2); + + @$pb.TagNumber(4) + AlignmentData get begin => $_getN(3); + @$pb.TagNumber(4) + set begin(AlignmentData v) { $_setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasBegin() => $_has(3); + @$pb.TagNumber(4) + void clearBegin() => $_clearField(4); + @$pb.TagNumber(4) + AlignmentData ensureBegin() => $_ensure(3); + + @$pb.TagNumber(5) + AlignmentData get end => $_getN(4); + @$pb.TagNumber(5) + set end(AlignmentData v) { $_setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasEnd() => $_has(4); + @$pb.TagNumber(5) + void clearEnd() => $_clearField(5); + @$pb.TagNumber(5) + AlignmentData ensureEnd() => $_ensure(4); + + @$pb.TagNumber(6) + AlignmentData get center => $_getN(5); + @$pb.TagNumber(6) + set center(AlignmentData v) { $_setField(6, v); } + @$pb.TagNumber(6) + $core.bool hasCenter() => $_has(5); + @$pb.TagNumber(6) + void clearCenter() => $_clearField(6); + @$pb.TagNumber(6) + AlignmentData ensureCenter() => $_ensure(5); + + @$pb.TagNumber(7) + $core.double get radius => $_getN(6); + @$pb.TagNumber(7) + set radius($core.double v) { $_setDouble(6, v); } + @$pb.TagNumber(7) + $core.bool hasRadius() => $_has(6); + @$pb.TagNumber(7) + void clearRadius() => $_clearField(7); + + @$pb.TagNumber(8) + $core.double get startAngle => $_getN(7); + @$pb.TagNumber(8) + set startAngle($core.double v) { $_setDouble(7, v); } + @$pb.TagNumber(8) + $core.bool hasStartAngle() => $_has(7); + @$pb.TagNumber(8) + void clearStartAngle() => $_clearField(8); + + @$pb.TagNumber(9) + $core.double get endAngle => $_getN(8); + @$pb.TagNumber(9) + set endAngle($core.double v) { $_setDouble(8, v); } + @$pb.TagNumber(9) + $core.bool hasEndAngle() => $_has(8); + @$pb.TagNumber(9) + void clearEndAngle() => $_clearField(9); +} + +enum AlignmentData_AlignmentType { + predefined, + xy, + notSet +} + +/// Message for Alignment (used in Gradient, DecorationImage) +class AlignmentData extends $pb.GeneratedMessage { + factory AlignmentData({ + AlignmentData_PredefinedAlignment? predefined, + XYAlignment? xy, + }) { + final $result = create(); + if (predefined != null) { + $result.predefined = predefined; + } + if (xy != null) { + $result.xy = xy; + } + return $result; + } + AlignmentData._() : super(); + factory AlignmentData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AlignmentData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static const $core.Map<$core.int, AlignmentData_AlignmentType> _AlignmentData_AlignmentTypeByTag = { + 1 : AlignmentData_AlignmentType.predefined, + 2 : AlignmentData_AlignmentType.xy, + 0 : AlignmentData_AlignmentType.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AlignmentData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..oo(0, [1, 2]) + ..e(1, _omitFieldNames ? '' : 'predefined', $pb.PbFieldType.OE, defaultOrMaker: AlignmentData_PredefinedAlignment.PREDEFINED_ALIGNMENT_UNSPECIFIED, valueOf: AlignmentData_PredefinedAlignment.valueOf, enumValues: AlignmentData_PredefinedAlignment.values) + ..aOM(2, _omitFieldNames ? '' : 'xy', subBuilder: XYAlignment.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AlignmentData clone() => AlignmentData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AlignmentData copyWith(void Function(AlignmentData) updates) => super.copyWith((message) => updates(message as AlignmentData)) as AlignmentData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static AlignmentData create() => AlignmentData._(); + AlignmentData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static AlignmentData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AlignmentData? _defaultInstance; + + AlignmentData_AlignmentType whichAlignmentType() => _AlignmentData_AlignmentTypeByTag[$_whichOneof(0)]!; + void clearAlignmentType() => $_clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + AlignmentData_PredefinedAlignment get predefined => $_getN(0); + @$pb.TagNumber(1) + set predefined(AlignmentData_PredefinedAlignment v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasPredefined() => $_has(0); + @$pb.TagNumber(1) + void clearPredefined() => $_clearField(1); + + @$pb.TagNumber(2) + XYAlignment get xy => $_getN(1); + @$pb.TagNumber(2) + set xy(XYAlignment v) { $_setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasXy() => $_has(1); + @$pb.TagNumber(2) + void clearXy() => $_clearField(2); + @$pb.TagNumber(2) + XYAlignment ensureXy() => $_ensure(1); +} + +class XYAlignment extends $pb.GeneratedMessage { + factory XYAlignment({ + $core.double? x, + $core.double? y, + }) { + final $result = create(); + if (x != null) { + $result.x = x; + } + if (y != null) { + $result.y = y; + } + return $result; + } + XYAlignment._() : super(); + factory XYAlignment.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory XYAlignment.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'XYAlignment', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'x', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'y', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + XYAlignment clone() => XYAlignment()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + XYAlignment copyWith(void Function(XYAlignment) updates) => super.copyWith((message) => updates(message as XYAlignment)) as XYAlignment; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static XYAlignment create() => XYAlignment._(); + XYAlignment createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static XYAlignment getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static XYAlignment? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get x => $_getN(0); + @$pb.TagNumber(1) + set x($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasX() => $_has(0); + @$pb.TagNumber(1) + void clearX() => $_clearField(1); + + @$pb.TagNumber(2) + $core.double get y => $_getN(1); + @$pb.TagNumber(2) + set y($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasY() => $_has(1); + @$pb.TagNumber(2) + void clearY() => $_clearField(2); +} + +/// Message for DecorationImage +class DecorationImageData extends $pb.GeneratedMessage { + factory DecorationImageData({ + $core.String? src, + BoxFitProto? fit, + AlignmentData? alignment, + ImageRepeatProto? repeat, + $core.bool? matchTextDirection, + $core.double? scale, + $core.double? opacity, + FilterQualityProto? filterQuality, + $core.bool? invertColors, + $core.bool? isAntiAlias, + }) { + final $result = create(); + if (src != null) { + $result.src = src; + } + if (fit != null) { + $result.fit = fit; + } + if (alignment != null) { + $result.alignment = alignment; + } + if (repeat != null) { + $result.repeat = repeat; + } + if (matchTextDirection != null) { + $result.matchTextDirection = matchTextDirection; + } + if (scale != null) { + $result.scale = scale; + } + if (opacity != null) { + $result.opacity = opacity; + } + if (filterQuality != null) { + $result.filterQuality = filterQuality; + } + if (invertColors != null) { + $result.invertColors = invertColors; + } + if (isAntiAlias != null) { + $result.isAntiAlias = isAntiAlias; + } + return $result; + } + DecorationImageData._() : super(); + factory DecorationImageData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory DecorationImageData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'DecorationImageData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'src') + ..e(2, _omitFieldNames ? '' : 'fit', $pb.PbFieldType.OE, defaultOrMaker: BoxFitProto.BOX_FIT_UNSPECIFIED, valueOf: BoxFitProto.valueOf, enumValues: BoxFitProto.values) + ..aOM(3, _omitFieldNames ? '' : 'alignment', subBuilder: AlignmentData.create) + ..e(4, _omitFieldNames ? '' : 'repeat', $pb.PbFieldType.OE, defaultOrMaker: ImageRepeatProto.IMAGE_REPEAT_UNSPECIFIED, valueOf: ImageRepeatProto.valueOf, enumValues: ImageRepeatProto.values) + ..aOB(5, _omitFieldNames ? '' : 'matchTextDirection') + ..a<$core.double>(6, _omitFieldNames ? '' : 'scale', $pb.PbFieldType.OD) + ..a<$core.double>(7, _omitFieldNames ? '' : 'opacity', $pb.PbFieldType.OD) + ..e(8, _omitFieldNames ? '' : 'filterQuality', $pb.PbFieldType.OE, defaultOrMaker: FilterQualityProto.FILTER_QUALITY_UNSPECIFIED, valueOf: FilterQualityProto.valueOf, enumValues: FilterQualityProto.values) + ..aOB(9, _omitFieldNames ? '' : 'invertColors') + ..aOB(10, _omitFieldNames ? '' : 'isAntiAlias') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + DecorationImageData clone() => DecorationImageData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + DecorationImageData copyWith(void Function(DecorationImageData) updates) => super.copyWith((message) => updates(message as DecorationImageData)) as DecorationImageData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static DecorationImageData create() => DecorationImageData._(); + DecorationImageData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static DecorationImageData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static DecorationImageData? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get src => $_getSZ(0); + @$pb.TagNumber(1) + set src($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasSrc() => $_has(0); + @$pb.TagNumber(1) + void clearSrc() => $_clearField(1); + + @$pb.TagNumber(2) + BoxFitProto get fit => $_getN(1); + @$pb.TagNumber(2) + set fit(BoxFitProto v) { $_setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasFit() => $_has(1); + @$pb.TagNumber(2) + void clearFit() => $_clearField(2); + + @$pb.TagNumber(3) + AlignmentData get alignment => $_getN(2); + @$pb.TagNumber(3) + set alignment(AlignmentData v) { $_setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasAlignment() => $_has(2); + @$pb.TagNumber(3) + void clearAlignment() => $_clearField(3); + @$pb.TagNumber(3) + AlignmentData ensureAlignment() => $_ensure(2); + + @$pb.TagNumber(4) + ImageRepeatProto get repeat => $_getN(3); + @$pb.TagNumber(4) + set repeat(ImageRepeatProto v) { $_setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasRepeat() => $_has(3); + @$pb.TagNumber(4) + void clearRepeat() => $_clearField(4); + + @$pb.TagNumber(5) + $core.bool get matchTextDirection => $_getBF(4); + @$pb.TagNumber(5) + set matchTextDirection($core.bool v) { $_setBool(4, v); } + @$pb.TagNumber(5) + $core.bool hasMatchTextDirection() => $_has(4); + @$pb.TagNumber(5) + void clearMatchTextDirection() => $_clearField(5); + + @$pb.TagNumber(6) + $core.double get scale => $_getN(5); + @$pb.TagNumber(6) + set scale($core.double v) { $_setDouble(5, v); } + @$pb.TagNumber(6) + $core.bool hasScale() => $_has(5); + @$pb.TagNumber(6) + void clearScale() => $_clearField(6); + + @$pb.TagNumber(7) + $core.double get opacity => $_getN(6); + @$pb.TagNumber(7) + set opacity($core.double v) { $_setDouble(6, v); } + @$pb.TagNumber(7) + $core.bool hasOpacity() => $_has(6); + @$pb.TagNumber(7) + void clearOpacity() => $_clearField(7); + + @$pb.TagNumber(8) + FilterQualityProto get filterQuality => $_getN(7); + @$pb.TagNumber(8) + set filterQuality(FilterQualityProto v) { $_setField(8, v); } + @$pb.TagNumber(8) + $core.bool hasFilterQuality() => $_has(7); + @$pb.TagNumber(8) + void clearFilterQuality() => $_clearField(8); + + @$pb.TagNumber(9) + $core.bool get invertColors => $_getBF(8); + @$pb.TagNumber(9) + set invertColors($core.bool v) { $_setBool(8, v); } + @$pb.TagNumber(9) + $core.bool hasInvertColors() => $_has(8); + @$pb.TagNumber(9) + void clearInvertColors() => $_clearField(9); + + @$pb.TagNumber(10) + $core.bool get isAntiAlias => $_getBF(9); + @$pb.TagNumber(10) + set isAntiAlias($core.bool v) { $_setBool(9, v); } + @$pb.TagNumber(10) + $core.bool hasIsAntiAlias() => $_has(9); + @$pb.TagNumber(10) + void clearIsAntiAlias() => $_clearField(10); +} + +class SduiRequest extends $pb.GeneratedMessage { + factory SduiRequest({ + $core.String? screenId, + }) { + final $result = create(); + if (screenId != null) { + $result.screenId = screenId; + } + return $result; + } + SduiRequest._() : super(); + factory SduiRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SduiRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SduiRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'screenId') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + SduiRequest clone() => SduiRequest()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + SduiRequest copyWith(void Function(SduiRequest) updates) => super.copyWith((message) => updates(message as SduiRequest)) as SduiRequest; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SduiRequest create() => SduiRequest._(); + SduiRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SduiRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SduiRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get screenId => $_getSZ(0); + @$pb.TagNumber(1) + set screenId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasScreenId() => $_has(0); + @$pb.TagNumber(1) + void clearScreenId() => $_clearField(1); +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/src/generated/sdui.pbenum.dart b/lib/src/generated/sdui.pbenum.dart new file mode 100644 index 0000000..5cb6cab --- /dev/null +++ b/lib/src/generated/sdui.pbenum.dart @@ -0,0 +1,208 @@ +// +// Generated code. Do not modify. +// source: sdui.proto +// +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +/// Enum for Widget Types +class WidgetType extends $pb.ProtobufEnum { + static const WidgetType WIDGET_TYPE_UNSPECIFIED = WidgetType._(0, _omitEnumNames ? '' : 'WIDGET_TYPE_UNSPECIFIED'); + static const WidgetType COLUMN = WidgetType._(1, _omitEnumNames ? '' : 'COLUMN'); + static const WidgetType ROW = WidgetType._(2, _omitEnumNames ? '' : 'ROW'); + static const WidgetType TEXT = WidgetType._(3, _omitEnumNames ? '' : 'TEXT'); + static const WidgetType IMAGE = WidgetType._(4, _omitEnumNames ? '' : 'IMAGE'); + static const WidgetType SIZED_BOX = WidgetType._(5, _omitEnumNames ? '' : 'SIZED_BOX'); + static const WidgetType CONTAINER = WidgetType._(6, _omitEnumNames ? '' : 'CONTAINER'); + static const WidgetType SCAFFOLD = WidgetType._(7, _omitEnumNames ? '' : 'SCAFFOLD'); + static const WidgetType SPACER = WidgetType._(8, _omitEnumNames ? '' : 'SPACER'); + static const WidgetType ICON = WidgetType._(9, _omitEnumNames ? '' : 'ICON'); + + static const $core.List values = [ + WIDGET_TYPE_UNSPECIFIED, + COLUMN, + ROW, + TEXT, + IMAGE, + SIZED_BOX, + CONTAINER, + SCAFFOLD, + SPACER, + ICON, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 9); + static WidgetType? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const WidgetType._(super.v, super.n); +} + +/// Message for BoxFit +class BoxFitProto extends $pb.ProtobufEnum { + static const BoxFitProto BOX_FIT_UNSPECIFIED = BoxFitProto._(0, _omitEnumNames ? '' : 'BOX_FIT_UNSPECIFIED'); + static const BoxFitProto FILL = BoxFitProto._(1, _omitEnumNames ? '' : 'FILL'); + static const BoxFitProto CONTAIN = BoxFitProto._(2, _omitEnumNames ? '' : 'CONTAIN'); + static const BoxFitProto COVER = BoxFitProto._(3, _omitEnumNames ? '' : 'COVER'); + static const BoxFitProto FIT_WIDTH = BoxFitProto._(4, _omitEnumNames ? '' : 'FIT_WIDTH'); + static const BoxFitProto FIT_HEIGHT = BoxFitProto._(5, _omitEnumNames ? '' : 'FIT_HEIGHT'); + static const BoxFitProto NONE = BoxFitProto._(6, _omitEnumNames ? '' : 'NONE'); + static const BoxFitProto SCALE_DOWN = BoxFitProto._(7, _omitEnumNames ? '' : 'SCALE_DOWN'); + + static const $core.List values = [ + BOX_FIT_UNSPECIFIED, + FILL, + CONTAIN, + COVER, + FIT_WIDTH, + FIT_HEIGHT, + NONE, + SCALE_DOWN, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 7); + static BoxFitProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const BoxFitProto._(super.v, super.n); +} + +/// Enum for BorderStyle +class BorderStyleProto extends $pb.ProtobufEnum { + static const BorderStyleProto BORDER_STYLE_UNSPECIFIED = BorderStyleProto._(0, _omitEnumNames ? '' : 'BORDER_STYLE_UNSPECIFIED'); + static const BorderStyleProto SOLID = BorderStyleProto._(1, _omitEnumNames ? '' : 'SOLID'); + static const BorderStyleProto NONE_BORDER = BorderStyleProto._(2, _omitEnumNames ? '' : 'NONE_BORDER'); + + static const $core.List values = [ + BORDER_STYLE_UNSPECIFIED, + SOLID, + NONE_BORDER, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 2); + static BorderStyleProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const BorderStyleProto._(super.v, super.n); +} + +/// Enum for BoxShape +class BoxShapeProto extends $pb.ProtobufEnum { + static const BoxShapeProto BOX_SHAPE_UNSPECIFIED = BoxShapeProto._(0, _omitEnumNames ? '' : 'BOX_SHAPE_UNSPECIFIED'); + static const BoxShapeProto RECTANGLE = BoxShapeProto._(1, _omitEnumNames ? '' : 'RECTANGLE'); + static const BoxShapeProto CIRCLE = BoxShapeProto._(2, _omitEnumNames ? '' : 'CIRCLE'); + + static const $core.List values = [ + BOX_SHAPE_UNSPECIFIED, + RECTANGLE, + CIRCLE, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 2); + static BoxShapeProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const BoxShapeProto._(super.v, super.n); +} + +/// Enum for ImageRepeat +class ImageRepeatProto extends $pb.ProtobufEnum { + static const ImageRepeatProto IMAGE_REPEAT_UNSPECIFIED = ImageRepeatProto._(0, _omitEnumNames ? '' : 'IMAGE_REPEAT_UNSPECIFIED'); + static const ImageRepeatProto REPEAT = ImageRepeatProto._(1, _omitEnumNames ? '' : 'REPEAT'); + static const ImageRepeatProto REPEAT_X = ImageRepeatProto._(2, _omitEnumNames ? '' : 'REPEAT_X'); + static const ImageRepeatProto REPEAT_Y = ImageRepeatProto._(3, _omitEnumNames ? '' : 'REPEAT_Y'); + static const ImageRepeatProto NO_REPEAT = ImageRepeatProto._(4, _omitEnumNames ? '' : 'NO_REPEAT'); + + static const $core.List values = [ + IMAGE_REPEAT_UNSPECIFIED, + REPEAT, + REPEAT_X, + REPEAT_Y, + NO_REPEAT, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 4); + static ImageRepeatProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ImageRepeatProto._(super.v, super.n); +} + +/// Enum for FilterQuality +class FilterQualityProto extends $pb.ProtobufEnum { + static const FilterQualityProto FILTER_QUALITY_UNSPECIFIED = FilterQualityProto._(0, _omitEnumNames ? '' : 'FILTER_QUALITY_UNSPECIFIED'); + static const FilterQualityProto NONE_FQ = FilterQualityProto._(1, _omitEnumNames ? '' : 'NONE_FQ'); + static const FilterQualityProto LOW = FilterQualityProto._(2, _omitEnumNames ? '' : 'LOW'); + static const FilterQualityProto MEDIUM = FilterQualityProto._(3, _omitEnumNames ? '' : 'MEDIUM'); + static const FilterQualityProto HIGH = FilterQualityProto._(4, _omitEnumNames ? '' : 'HIGH'); + + static const $core.List values = [ + FILTER_QUALITY_UNSPECIFIED, + NONE_FQ, + LOW, + MEDIUM, + HIGH, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 4); + static FilterQualityProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const FilterQualityProto._(super.v, super.n); +} + +class GradientData_GradientType extends $pb.ProtobufEnum { + static const GradientData_GradientType GRADIENT_TYPE_UNSPECIFIED = GradientData_GradientType._(0, _omitEnumNames ? '' : 'GRADIENT_TYPE_UNSPECIFIED'); + static const GradientData_GradientType LINEAR = GradientData_GradientType._(1, _omitEnumNames ? '' : 'LINEAR'); + static const GradientData_GradientType RADIAL = GradientData_GradientType._(2, _omitEnumNames ? '' : 'RADIAL'); + static const GradientData_GradientType SWEEP = GradientData_GradientType._(3, _omitEnumNames ? '' : 'SWEEP'); + + static const $core.List values = [ + GRADIENT_TYPE_UNSPECIFIED, + LINEAR, + RADIAL, + SWEEP, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 3); + static GradientData_GradientType? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const GradientData_GradientType._(super.v, super.n); +} + +/// Predefined alignments +class AlignmentData_PredefinedAlignment extends $pb.ProtobufEnum { + static const AlignmentData_PredefinedAlignment PREDEFINED_ALIGNMENT_UNSPECIFIED = AlignmentData_PredefinedAlignment._(0, _omitEnumNames ? '' : 'PREDEFINED_ALIGNMENT_UNSPECIFIED'); + static const AlignmentData_PredefinedAlignment BOTTOM_CENTER = AlignmentData_PredefinedAlignment._(1, _omitEnumNames ? '' : 'BOTTOM_CENTER'); + static const AlignmentData_PredefinedAlignment BOTTOM_LEFT = AlignmentData_PredefinedAlignment._(2, _omitEnumNames ? '' : 'BOTTOM_LEFT'); + static const AlignmentData_PredefinedAlignment BOTTOM_RIGHT = AlignmentData_PredefinedAlignment._(3, _omitEnumNames ? '' : 'BOTTOM_RIGHT'); + static const AlignmentData_PredefinedAlignment CENTER = AlignmentData_PredefinedAlignment._(4, _omitEnumNames ? '' : 'CENTER'); + static const AlignmentData_PredefinedAlignment CENTER_LEFT = AlignmentData_PredefinedAlignment._(5, _omitEnumNames ? '' : 'CENTER_LEFT'); + static const AlignmentData_PredefinedAlignment CENTER_RIGHT = AlignmentData_PredefinedAlignment._(6, _omitEnumNames ? '' : 'CENTER_RIGHT'); + static const AlignmentData_PredefinedAlignment TOP_CENTER = AlignmentData_PredefinedAlignment._(7, _omitEnumNames ? '' : 'TOP_CENTER'); + static const AlignmentData_PredefinedAlignment TOP_LEFT = AlignmentData_PredefinedAlignment._(8, _omitEnumNames ? '' : 'TOP_LEFT'); + static const AlignmentData_PredefinedAlignment TOP_RIGHT = AlignmentData_PredefinedAlignment._(9, _omitEnumNames ? '' : 'TOP_RIGHT'); + + static const $core.List values = [ + PREDEFINED_ALIGNMENT_UNSPECIFIED, + BOTTOM_CENTER, + BOTTOM_LEFT, + BOTTOM_RIGHT, + CENTER, + CENTER_LEFT, + CENTER_RIGHT, + TOP_CENTER, + TOP_LEFT, + TOP_RIGHT, + ]; + + static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 9); + static AlignmentData_PredefinedAlignment? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const AlignmentData_PredefinedAlignment._(super.v, super.n); +} + + +const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/lib/src/generated/sdui.pbgrpc.dart b/lib/src/generated/sdui.pbgrpc.dart new file mode 100644 index 0000000..375b447 --- /dev/null +++ b/lib/src/generated/sdui.pbgrpc.dart @@ -0,0 +1,64 @@ +// +// Generated code. Do not modify. +// source: sdui.proto +// +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:async' as $async; +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'package:protobuf/protobuf.dart' as $pb; + +import 'sdui.pb.dart' as $0; + +export 'sdui.pb.dart'; + +/// Service definition (optional for now, but good for future gRPC) +@$pb.GrpcServiceName('flutter_sdui.SduiService') +class SduiServiceClient extends $grpc.Client { + /// The hostname for this service. + static const $core.String defaultHost = ''; + + /// OAuth scopes needed for the client. + static const $core.List<$core.String> oauthScopes = [ + '', + ]; + + static final _$getSduiWidget = $grpc.ClientMethod<$0.SduiRequest, $0.SduiWidgetData>( + '/flutter_sdui.SduiService/GetSduiWidget', + ($0.SduiRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.SduiWidgetData.fromBuffer(value)); + + SduiServiceClient(super.channel, {super.options, super.interceptors}); + + $grpc.ResponseFuture<$0.SduiWidgetData> getSduiWidget($0.SduiRequest request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getSduiWidget, request, options: options); + } +} + +@$pb.GrpcServiceName('flutter_sdui.SduiService') +abstract class SduiServiceBase extends $grpc.Service { + $core.String get $name => 'flutter_sdui.SduiService'; + + SduiServiceBase() { + $addMethod($grpc.ServiceMethod<$0.SduiRequest, $0.SduiWidgetData>( + 'GetSduiWidget', + getSduiWidget_Pre, + false, + false, + ($core.List<$core.int> value) => $0.SduiRequest.fromBuffer(value), + ($0.SduiWidgetData value) => value.writeToBuffer())); + } + + $async.Future<$0.SduiWidgetData> getSduiWidget_Pre($grpc.ServiceCall $call, $async.Future<$0.SduiRequest> $request) async { + return getSduiWidget($call, await $request); + } + + $async.Future<$0.SduiWidgetData> getSduiWidget($grpc.ServiceCall call, $0.SduiRequest request); +} diff --git a/lib/src/generated/sdui.pbjson.dart b/lib/src/generated/sdui.pbjson.dart new file mode 100644 index 0000000..d3b2847 --- /dev/null +++ b/lib/src/generated/sdui.pbjson.dart @@ -0,0 +1,607 @@ +// +// Generated code. Do not modify. +// source: sdui.proto +// +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use widgetTypeDescriptor instead') +const WidgetType$json = { + '1': 'WidgetType', + '2': [ + {'1': 'WIDGET_TYPE_UNSPECIFIED', '2': 0}, + {'1': 'COLUMN', '2': 1}, + {'1': 'ROW', '2': 2}, + {'1': 'TEXT', '2': 3}, + {'1': 'IMAGE', '2': 4}, + {'1': 'SIZED_BOX', '2': 5}, + {'1': 'CONTAINER', '2': 6}, + {'1': 'SCAFFOLD', '2': 7}, + {'1': 'SPACER', '2': 8}, + {'1': 'ICON', '2': 9}, + ], +}; + +/// Descriptor for `WidgetType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List widgetTypeDescriptor = $convert.base64Decode( + 'CgpXaWRnZXRUeXBlEhsKF1dJREdFVF9UWVBFX1VOU1BFQ0lGSUVEEAASCgoGQ09MVU1OEAESBw' + 'oDUk9XEAISCAoEVEVYVBADEgkKBUlNQUdFEAQSDQoJU0laRURfQk9YEAUSDQoJQ09OVEFJTkVS' + 'EAYSDAoIU0NBRkZPTEQQBxIKCgZTUEFDRVIQCBIICgRJQ09OEAk='); + +@$core.Deprecated('Use boxFitProtoDescriptor instead') +const BoxFitProto$json = { + '1': 'BoxFitProto', + '2': [ + {'1': 'BOX_FIT_UNSPECIFIED', '2': 0}, + {'1': 'FILL', '2': 1}, + {'1': 'CONTAIN', '2': 2}, + {'1': 'COVER', '2': 3}, + {'1': 'FIT_WIDTH', '2': 4}, + {'1': 'FIT_HEIGHT', '2': 5}, + {'1': 'NONE', '2': 6}, + {'1': 'SCALE_DOWN', '2': 7}, + ], +}; + +/// Descriptor for `BoxFitProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List boxFitProtoDescriptor = $convert.base64Decode( + 'CgtCb3hGaXRQcm90bxIXChNCT1hfRklUX1VOU1BFQ0lGSUVEEAASCAoERklMTBABEgsKB0NPTl' + 'RBSU4QAhIJCgVDT1ZFUhADEg0KCUZJVF9XSURUSBAEEg4KCkZJVF9IRUlHSFQQBRIICgROT05F' + 'EAYSDgoKU0NBTEVfRE9XThAH'); + +@$core.Deprecated('Use borderStyleProtoDescriptor instead') +const BorderStyleProto$json = { + '1': 'BorderStyleProto', + '2': [ + {'1': 'BORDER_STYLE_UNSPECIFIED', '2': 0}, + {'1': 'SOLID', '2': 1}, + {'1': 'NONE_BORDER', '2': 2}, + ], +}; + +/// Descriptor for `BorderStyleProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List borderStyleProtoDescriptor = $convert.base64Decode( + 'ChBCb3JkZXJTdHlsZVByb3RvEhwKGEJPUkRFUl9TVFlMRV9VTlNQRUNJRklFRBAAEgkKBVNPTE' + 'lEEAESDwoLTk9ORV9CT1JERVIQAg=='); + +@$core.Deprecated('Use boxShapeProtoDescriptor instead') +const BoxShapeProto$json = { + '1': 'BoxShapeProto', + '2': [ + {'1': 'BOX_SHAPE_UNSPECIFIED', '2': 0}, + {'1': 'RECTANGLE', '2': 1}, + {'1': 'CIRCLE', '2': 2}, + ], +}; + +/// Descriptor for `BoxShapeProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List boxShapeProtoDescriptor = $convert.base64Decode( + 'Cg1Cb3hTaGFwZVByb3RvEhkKFUJPWF9TSEFQRV9VTlNQRUNJRklFRBAAEg0KCVJFQ1RBTkdMRR' + 'ABEgoKBkNJUkNMRRAC'); + +@$core.Deprecated('Use imageRepeatProtoDescriptor instead') +const ImageRepeatProto$json = { + '1': 'ImageRepeatProto', + '2': [ + {'1': 'IMAGE_REPEAT_UNSPECIFIED', '2': 0}, + {'1': 'REPEAT', '2': 1}, + {'1': 'REPEAT_X', '2': 2}, + {'1': 'REPEAT_Y', '2': 3}, + {'1': 'NO_REPEAT', '2': 4}, + ], +}; + +/// Descriptor for `ImageRepeatProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List imageRepeatProtoDescriptor = $convert.base64Decode( + 'ChBJbWFnZVJlcGVhdFByb3RvEhwKGElNQUdFX1JFUEVBVF9VTlNQRUNJRklFRBAAEgoKBlJFUE' + 'VBVBABEgwKCFJFUEVBVF9YEAISDAoIUkVQRUFUX1kQAxINCglOT19SRVBFQVQQBA=='); + +@$core.Deprecated('Use filterQualityProtoDescriptor instead') +const FilterQualityProto$json = { + '1': 'FilterQualityProto', + '2': [ + {'1': 'FILTER_QUALITY_UNSPECIFIED', '2': 0}, + {'1': 'NONE_FQ', '2': 1}, + {'1': 'LOW', '2': 2}, + {'1': 'MEDIUM', '2': 3}, + {'1': 'HIGH', '2': 4}, + ], +}; + +/// Descriptor for `FilterQualityProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List filterQualityProtoDescriptor = $convert.base64Decode( + 'ChJGaWx0ZXJRdWFsaXR5UHJvdG8SHgoaRklMVEVSX1FVQUxJVFlfVU5TUEVDSUZJRUQQABILCg' + 'dOT05FX0ZREAESBwoDTE9XEAISCgoGTUVESVVNEAMSCAoESElHSBAE'); + +@$core.Deprecated('Use sduiWidgetDataDescriptor instead') +const SduiWidgetData$json = { + '1': 'SduiWidgetData', + '2': [ + {'1': 'type', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.WidgetType', '10': 'type'}, + {'1': 'string_attributes', '3': 2, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.StringAttributesEntry', '10': 'stringAttributes'}, + {'1': 'double_attributes', '3': 3, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.DoubleAttributesEntry', '10': 'doubleAttributes'}, + {'1': 'bool_attributes', '3': 4, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.BoolAttributesEntry', '10': 'boolAttributes'}, + {'1': 'int_attributes', '3': 5, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.IntAttributesEntry', '10': 'intAttributes'}, + {'1': 'text_style', '3': 6, '4': 1, '5': 11, '6': '.flutter_sdui.TextStyleData', '10': 'textStyle'}, + {'1': 'padding', '3': 7, '4': 1, '5': 11, '6': '.flutter_sdui.EdgeInsetsData', '10': 'padding'}, + {'1': 'margin', '3': 8, '4': 1, '5': 11, '6': '.flutter_sdui.EdgeInsetsData', '10': 'margin'}, + {'1': 'color', '3': 9, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'color'}, + {'1': 'icon', '3': 10, '4': 1, '5': 11, '6': '.flutter_sdui.IconDataMessage', '10': 'icon'}, + {'1': 'box_decoration', '3': 11, '4': 1, '5': 11, '6': '.flutter_sdui.BoxDecorationData', '10': 'boxDecoration'}, + {'1': 'children', '3': 12, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'children'}, + {'1': 'child', '3': 13, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'child'}, + {'1': 'app_bar', '3': 14, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'appBar'}, + {'1': 'body', '3': 15, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'body'}, + {'1': 'floating_action_button', '3': 16, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'floatingActionButton'}, + {'1': 'background_color', '3': 17, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'backgroundColor'}, + ], + '3': [SduiWidgetData_StringAttributesEntry$json, SduiWidgetData_DoubleAttributesEntry$json, SduiWidgetData_BoolAttributesEntry$json, SduiWidgetData_IntAttributesEntry$json], +}; + +@$core.Deprecated('Use sduiWidgetDataDescriptor instead') +const SduiWidgetData_StringAttributesEntry$json = { + '1': 'StringAttributesEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, + ], + '7': {'7': true}, +}; + +@$core.Deprecated('Use sduiWidgetDataDescriptor instead') +const SduiWidgetData_DoubleAttributesEntry$json = { + '1': 'DoubleAttributesEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + {'1': 'value', '3': 2, '4': 1, '5': 1, '10': 'value'}, + ], + '7': {'7': true}, +}; + +@$core.Deprecated('Use sduiWidgetDataDescriptor instead') +const SduiWidgetData_BoolAttributesEntry$json = { + '1': 'BoolAttributesEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + {'1': 'value', '3': 2, '4': 1, '5': 8, '10': 'value'}, + ], + '7': {'7': true}, +}; + +@$core.Deprecated('Use sduiWidgetDataDescriptor instead') +const SduiWidgetData_IntAttributesEntry$json = { + '1': 'IntAttributesEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + {'1': 'value', '3': 2, '4': 1, '5': 5, '10': 'value'}, + ], + '7': {'7': true}, +}; + +/// Descriptor for `SduiWidgetData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List sduiWidgetDataDescriptor = $convert.base64Decode( + 'Cg5TZHVpV2lkZ2V0RGF0YRIsCgR0eXBlGAEgASgOMhguZmx1dHRlcl9zZHVpLldpZGdldFR5cG' + 'VSBHR5cGUSXwoRc3RyaW5nX2F0dHJpYnV0ZXMYAiADKAsyMi5mbHV0dGVyX3NkdWkuU2R1aVdp' + 'ZGdldERhdGEuU3RyaW5nQXR0cmlidXRlc0VudHJ5UhBzdHJpbmdBdHRyaWJ1dGVzEl8KEWRvdW' + 'JsZV9hdHRyaWJ1dGVzGAMgAygLMjIuZmx1dHRlcl9zZHVpLlNkdWlXaWRnZXREYXRhLkRvdWJs' + 'ZUF0dHJpYnV0ZXNFbnRyeVIQZG91YmxlQXR0cmlidXRlcxJZCg9ib29sX2F0dHJpYnV0ZXMYBC' + 'ADKAsyMC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGEuQm9vbEF0dHJpYnV0ZXNFbnRyeVIO' + 'Ym9vbEF0dHJpYnV0ZXMSVgoOaW50X2F0dHJpYnV0ZXMYBSADKAsyLy5mbHV0dGVyX3NkdWkuU2' + 'R1aVdpZGdldERhdGEuSW50QXR0cmlidXRlc0VudHJ5Ug1pbnRBdHRyaWJ1dGVzEjoKCnRleHRf' + 'c3R5bGUYBiABKAsyGy5mbHV0dGVyX3NkdWkuVGV4dFN0eWxlRGF0YVIJdGV4dFN0eWxlEjYKB3' + 'BhZGRpbmcYByABKAsyHC5mbHV0dGVyX3NkdWkuRWRnZUluc2V0c0RhdGFSB3BhZGRpbmcSNAoG' + 'bWFyZ2luGAggASgLMhwuZmx1dHRlcl9zZHVpLkVkZ2VJbnNldHNEYXRhUgZtYXJnaW4SLQoFY2' + '9sb3IYCSABKAsyFy5mbHV0dGVyX3NkdWkuQ29sb3JEYXRhUgVjb2xvchIxCgRpY29uGAogASgL' + 'Mh0uZmx1dHRlcl9zZHVpLkljb25EYXRhTWVzc2FnZVIEaWNvbhJGCg5ib3hfZGVjb3JhdGlvbh' + 'gLIAEoCzIfLmZsdXR0ZXJfc2R1aS5Cb3hEZWNvcmF0aW9uRGF0YVINYm94RGVjb3JhdGlvbhI4' + 'CghjaGlsZHJlbhgMIAMoCzIcLmZsdXR0ZXJfc2R1aS5TZHVpV2lkZ2V0RGF0YVIIY2hpbGRyZW' + '4SMgoFY2hpbGQYDSABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGFSBWNoaWxkEjUK' + 'B2FwcF9iYXIYDiABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGFSBmFwcEJhchIwCg' + 'Rib2R5GA8gASgLMhwuZmx1dHRlcl9zZHVpLlNkdWlXaWRnZXREYXRhUgRib2R5ElIKFmZsb2F0' + 'aW5nX2FjdGlvbl9idXR0b24YECABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGFSFG' + 'Zsb2F0aW5nQWN0aW9uQnV0dG9uEkIKEGJhY2tncm91bmRfY29sb3IYESABKAsyFy5mbHV0dGVy' + 'X3NkdWkuQ29sb3JEYXRhUg9iYWNrZ3JvdW5kQ29sb3IaQwoVU3RyaW5nQXR0cmlidXRlc0VudH' + 'J5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgJUgV2YWx1ZToCOAEaQwoVRG91Ymxl' + 'QXR0cmlidXRlc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgBUgV2YWx1ZT' + 'oCOAEaQQoTQm9vbEF0dHJpYnV0ZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgC' + 'IAEoCFIFdmFsdWU6AjgBGkAKEkludEF0dHJpYnV0ZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleR' + 'IUCgV2YWx1ZRgCIAEoBVIFdmFsdWU6AjgB'); + +@$core.Deprecated('Use colorDataDescriptor instead') +const ColorData$json = { + '1': 'ColorData', + '2': [ + {'1': 'alpha', '3': 1, '4': 1, '5': 5, '10': 'alpha'}, + {'1': 'red', '3': 2, '4': 1, '5': 5, '10': 'red'}, + {'1': 'green', '3': 3, '4': 1, '5': 5, '10': 'green'}, + {'1': 'blue', '3': 4, '4': 1, '5': 5, '10': 'blue'}, + ], +}; + +/// Descriptor for `ColorData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List colorDataDescriptor = $convert.base64Decode( + 'CglDb2xvckRhdGESFAoFYWxwaGEYASABKAVSBWFscGhhEhAKA3JlZBgCIAEoBVIDcmVkEhQKBW' + 'dyZWVuGAMgASgFUgVncmVlbhISCgRibHVlGAQgASgFUgRibHVl'); + +@$core.Deprecated('Use edgeInsetsDataDescriptor instead') +const EdgeInsetsData$json = { + '1': 'EdgeInsetsData', + '2': [ + {'1': 'left', '3': 1, '4': 1, '5': 1, '9': 0, '10': 'left', '17': true}, + {'1': 'top', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'top', '17': true}, + {'1': 'right', '3': 3, '4': 1, '5': 1, '9': 2, '10': 'right', '17': true}, + {'1': 'bottom', '3': 4, '4': 1, '5': 1, '9': 3, '10': 'bottom', '17': true}, + {'1': 'all', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'all', '17': true}, + ], + '8': [ + {'1': '_left'}, + {'1': '_top'}, + {'1': '_right'}, + {'1': '_bottom'}, + {'1': '_all'}, + ], +}; + +/// Descriptor for `EdgeInsetsData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List edgeInsetsDataDescriptor = $convert.base64Decode( + 'Cg5FZGdlSW5zZXRzRGF0YRIXCgRsZWZ0GAEgASgBSABSBGxlZnSIAQESFQoDdG9wGAIgASgBSA' + 'FSA3RvcIgBARIZCgVyaWdodBgDIAEoAUgCUgVyaWdodIgBARIbCgZib3R0b20YBCABKAFIA1IG' + 'Ym90dG9tiAEBEhUKA2FsbBgFIAEoAUgEUgNhbGyIAQFCBwoFX2xlZnRCBgoEX3RvcEIICgZfcm' + 'lnaHRCCQoHX2JvdHRvbUIGCgRfYWxs'); + +@$core.Deprecated('Use textStyleDataDescriptor instead') +const TextStyleData$json = { + '1': 'TextStyleData', + '2': [ + {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, + {'1': 'font_size', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'fontSize', '17': true}, + {'1': 'font_weight', '3': 3, '4': 1, '5': 9, '9': 2, '10': 'fontWeight', '17': true}, + ], + '8': [ + {'1': '_color'}, + {'1': '_font_size'}, + {'1': '_font_weight'}, + ], +}; + +/// Descriptor for `TextStyleData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List textStyleDataDescriptor = $convert.base64Decode( + 'Cg1UZXh0U3R5bGVEYXRhEjIKBWNvbG9yGAEgASgLMhcuZmx1dHRlcl9zZHVpLkNvbG9yRGF0YU' + 'gAUgVjb2xvcogBARIgCglmb250X3NpemUYAiABKAFIAVIIZm9udFNpemWIAQESJAoLZm9udF93' + 'ZWlnaHQYAyABKAlIAlIKZm9udFdlaWdodIgBAUIICgZfY29sb3JCDAoKX2ZvbnRfc2l6ZUIOCg' + 'xfZm9udF93ZWlnaHQ='); + +@$core.Deprecated('Use iconDataMessageDescriptor instead') +const IconDataMessage$json = { + '1': 'IconDataMessage', + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'name', '17': true}, + {'1': 'code_point', '3': 2, '4': 1, '5': 5, '9': 1, '10': 'codePoint', '17': true}, + {'1': 'font_family', '3': 3, '4': 1, '5': 9, '9': 2, '10': 'fontFamily', '17': true}, + {'1': 'color', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 3, '10': 'color', '17': true}, + {'1': 'size', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'size', '17': true}, + ], + '8': [ + {'1': '_name'}, + {'1': '_code_point'}, + {'1': '_font_family'}, + {'1': '_color'}, + {'1': '_size'}, + ], +}; + +/// Descriptor for `IconDataMessage`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List iconDataMessageDescriptor = $convert.base64Decode( + 'Cg9JY29uRGF0YU1lc3NhZ2USFwoEbmFtZRgBIAEoCUgAUgRuYW1liAEBEiIKCmNvZGVfcG9pbn' + 'QYAiABKAVIAVIJY29kZVBvaW50iAEBEiQKC2ZvbnRfZmFtaWx5GAMgASgJSAJSCmZvbnRGYW1p' + 'bHmIAQESMgoFY29sb3IYBCABKAsyFy5mbHV0dGVyX3NkdWkuQ29sb3JEYXRhSANSBWNvbG9yiA' + 'EBEhcKBHNpemUYBSABKAFIBFIEc2l6ZYgBAUIHCgVfbmFtZUINCgtfY29kZV9wb2ludEIOCgxf' + 'Zm9udF9mYW1pbHlCCAoGX2NvbG9yQgcKBV9zaXpl'); + +@$core.Deprecated('Use boxDecorationDataDescriptor instead') +const BoxDecorationData$json = { + '1': 'BoxDecorationData', + '2': [ + {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, + {'1': 'border_radius', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.BorderRadiusData', '9': 1, '10': 'borderRadius', '17': true}, + {'1': 'border', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.BorderData', '9': 2, '10': 'border', '17': true}, + {'1': 'box_shadow', '3': 4, '4': 3, '5': 11, '6': '.flutter_sdui.BoxShadowData', '10': 'boxShadow'}, + {'1': 'gradient', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.GradientData', '9': 3, '10': 'gradient', '17': true}, + {'1': 'shape', '3': 6, '4': 1, '5': 14, '6': '.flutter_sdui.BoxShapeProto', '9': 4, '10': 'shape', '17': true}, + {'1': 'image', '3': 7, '4': 1, '5': 11, '6': '.flutter_sdui.DecorationImageData', '9': 5, '10': 'image', '17': true}, + ], + '8': [ + {'1': '_color'}, + {'1': '_border_radius'}, + {'1': '_border'}, + {'1': '_gradient'}, + {'1': '_shape'}, + {'1': '_image'}, + ], +}; + +/// Descriptor for `BoxDecorationData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List boxDecorationDataDescriptor = $convert.base64Decode( + 'ChFCb3hEZWNvcmF0aW9uRGF0YRIyCgVjb2xvchgBIAEoCzIXLmZsdXR0ZXJfc2R1aS5Db2xvck' + 'RhdGFIAFIFY29sb3KIAQESSAoNYm9yZGVyX3JhZGl1cxgCIAEoCzIeLmZsdXR0ZXJfc2R1aS5C' + 'b3JkZXJSYWRpdXNEYXRhSAFSDGJvcmRlclJhZGl1c4gBARI1CgZib3JkZXIYAyABKAsyGC5mbH' + 'V0dGVyX3NkdWkuQm9yZGVyRGF0YUgCUgZib3JkZXKIAQESOgoKYm94X3NoYWRvdxgEIAMoCzIb' + 'LmZsdXR0ZXJfc2R1aS5Cb3hTaGFkb3dEYXRhUglib3hTaGFkb3cSOwoIZ3JhZGllbnQYBSABKA' + 'syGi5mbHV0dGVyX3NkdWkuR3JhZGllbnREYXRhSANSCGdyYWRpZW50iAEBEjYKBXNoYXBlGAYg' + 'ASgOMhsuZmx1dHRlcl9zZHVpLkJveFNoYXBlUHJvdG9IBFIFc2hhcGWIAQESPAoFaW1hZ2UYBy' + 'ABKAsyIS5mbHV0dGVyX3NkdWkuRGVjb3JhdGlvbkltYWdlRGF0YUgFUgVpbWFnZYgBAUIICgZf' + 'Y29sb3JCEAoOX2JvcmRlcl9yYWRpdXNCCQoHX2JvcmRlckILCglfZ3JhZGllbnRCCAoGX3NoYX' + 'BlQggKBl9pbWFnZQ=='); + +@$core.Deprecated('Use borderRadiusDataDescriptor instead') +const BorderRadiusData$json = { + '1': 'BorderRadiusData', + '2': [ + {'1': 'all', '3': 1, '4': 1, '5': 1, '9': 0, '10': 'all', '17': true}, + {'1': 'top_left', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'topLeft', '17': true}, + {'1': 'top_right', '3': 3, '4': 1, '5': 1, '9': 2, '10': 'topRight', '17': true}, + {'1': 'bottom_left', '3': 4, '4': 1, '5': 1, '9': 3, '10': 'bottomLeft', '17': true}, + {'1': 'bottom_right', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'bottomRight', '17': true}, + ], + '8': [ + {'1': '_all'}, + {'1': '_top_left'}, + {'1': '_top_right'}, + {'1': '_bottom_left'}, + {'1': '_bottom_right'}, + ], +}; + +/// Descriptor for `BorderRadiusData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List borderRadiusDataDescriptor = $convert.base64Decode( + 'ChBCb3JkZXJSYWRpdXNEYXRhEhUKA2FsbBgBIAEoAUgAUgNhbGyIAQESHgoIdG9wX2xlZnQYAi' + 'ABKAFIAVIHdG9wTGVmdIgBARIgCgl0b3BfcmlnaHQYAyABKAFIAlIIdG9wUmlnaHSIAQESJAoL' + 'Ym90dG9tX2xlZnQYBCABKAFIA1IKYm90dG9tTGVmdIgBARImCgxib3R0b21fcmlnaHQYBSABKA' + 'FIBFILYm90dG9tUmlnaHSIAQFCBgoEX2FsbEILCglfdG9wX2xlZnRCDAoKX3RvcF9yaWdodEIO' + 'CgxfYm90dG9tX2xlZnRCDwoNX2JvdHRvbV9yaWdodA=='); + +@$core.Deprecated('Use borderSideDataDescriptor instead') +const BorderSideData$json = { + '1': 'BorderSideData', + '2': [ + {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, + {'1': 'width', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'width', '17': true}, + {'1': 'style', '3': 3, '4': 1, '5': 14, '6': '.flutter_sdui.BorderStyleProto', '9': 2, '10': 'style', '17': true}, + ], + '8': [ + {'1': '_color'}, + {'1': '_width'}, + {'1': '_style'}, + ], +}; + +/// Descriptor for `BorderSideData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List borderSideDataDescriptor = $convert.base64Decode( + 'Cg5Cb3JkZXJTaWRlRGF0YRIyCgVjb2xvchgBIAEoCzIXLmZsdXR0ZXJfc2R1aS5Db2xvckRhdG' + 'FIAFIFY29sb3KIAQESGQoFd2lkdGgYAiABKAFIAVIFd2lkdGiIAQESOQoFc3R5bGUYAyABKA4y' + 'Hi5mbHV0dGVyX3NkdWkuQm9yZGVyU3R5bGVQcm90b0gCUgVzdHlsZYgBAUIICgZfY29sb3JCCA' + 'oGX3dpZHRoQggKBl9zdHlsZQ=='); + +@$core.Deprecated('Use borderDataDescriptor instead') +const BorderData$json = { + '1': 'BorderData', + '2': [ + {'1': 'top', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 0, '10': 'top', '17': true}, + {'1': 'right', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 1, '10': 'right', '17': true}, + {'1': 'bottom', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 2, '10': 'bottom', '17': true}, + {'1': 'left', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 3, '10': 'left', '17': true}, + {'1': 'all', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 4, '10': 'all', '17': true}, + ], + '8': [ + {'1': '_top'}, + {'1': '_right'}, + {'1': '_bottom'}, + {'1': '_left'}, + {'1': '_all'}, + ], +}; + +/// Descriptor for `BorderData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List borderDataDescriptor = $convert.base64Decode( + 'CgpCb3JkZXJEYXRhEjMKA3RvcBgBIAEoCzIcLmZsdXR0ZXJfc2R1aS5Cb3JkZXJTaWRlRGF0YU' + 'gAUgN0b3CIAQESNwoFcmlnaHQYAiABKAsyHC5mbHV0dGVyX3NkdWkuQm9yZGVyU2lkZURhdGFI' + 'AVIFcmlnaHSIAQESOQoGYm90dG9tGAMgASgLMhwuZmx1dHRlcl9zZHVpLkJvcmRlclNpZGVEYX' + 'RhSAJSBmJvdHRvbYgBARI1CgRsZWZ0GAQgASgLMhwuZmx1dHRlcl9zZHVpLkJvcmRlclNpZGVE' + 'YXRhSANSBGxlZnSIAQESMwoDYWxsGAUgASgLMhwuZmx1dHRlcl9zZHVpLkJvcmRlclNpZGVEYX' + 'RhSARSA2FsbIgBAUIGCgRfdG9wQggKBl9yaWdodEIJCgdfYm90dG9tQgcKBV9sZWZ0QgYKBF9h' + 'bGw='); + +@$core.Deprecated('Use boxShadowDataDescriptor instead') +const BoxShadowData$json = { + '1': 'BoxShadowData', + '2': [ + {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, + {'1': 'offset_x', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'offsetX', '17': true}, + {'1': 'offset_y', '3': 3, '4': 1, '5': 1, '9': 2, '10': 'offsetY', '17': true}, + {'1': 'blur_radius', '3': 4, '4': 1, '5': 1, '9': 3, '10': 'blurRadius', '17': true}, + {'1': 'spread_radius', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'spreadRadius', '17': true}, + ], + '8': [ + {'1': '_color'}, + {'1': '_offset_x'}, + {'1': '_offset_y'}, + {'1': '_blur_radius'}, + {'1': '_spread_radius'}, + ], +}; + +/// Descriptor for `BoxShadowData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List boxShadowDataDescriptor = $convert.base64Decode( + 'Cg1Cb3hTaGFkb3dEYXRhEjIKBWNvbG9yGAEgASgLMhcuZmx1dHRlcl9zZHVpLkNvbG9yRGF0YU' + 'gAUgVjb2xvcogBARIeCghvZmZzZXRfeBgCIAEoAUgBUgdvZmZzZXRYiAEBEh4KCG9mZnNldF95' + 'GAMgASgBSAJSB29mZnNldFmIAQESJAoLYmx1cl9yYWRpdXMYBCABKAFIA1IKYmx1clJhZGl1c4' + 'gBARIoCg1zcHJlYWRfcmFkaXVzGAUgASgBSARSDHNwcmVhZFJhZGl1c4gBAUIICgZfY29sb3JC' + 'CwoJX29mZnNldF94QgsKCV9vZmZzZXRfeUIOCgxfYmx1cl9yYWRpdXNCEAoOX3NwcmVhZF9yYW' + 'RpdXM='); + +@$core.Deprecated('Use gradientDataDescriptor instead') +const GradientData$json = { + '1': 'GradientData', + '2': [ + {'1': 'type', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.GradientData.GradientType', '10': 'type'}, + {'1': 'colors', '3': 2, '4': 3, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'colors'}, + {'1': 'stops', '3': 3, '4': 3, '5': 1, '10': 'stops'}, + {'1': 'begin', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 0, '10': 'begin', '17': true}, + {'1': 'end', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 1, '10': 'end', '17': true}, + {'1': 'center', '3': 6, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 2, '10': 'center', '17': true}, + {'1': 'radius', '3': 7, '4': 1, '5': 1, '9': 3, '10': 'radius', '17': true}, + {'1': 'start_angle', '3': 8, '4': 1, '5': 1, '9': 4, '10': 'startAngle', '17': true}, + {'1': 'end_angle', '3': 9, '4': 1, '5': 1, '9': 5, '10': 'endAngle', '17': true}, + ], + '4': [GradientData_GradientType$json], + '8': [ + {'1': '_begin'}, + {'1': '_end'}, + {'1': '_center'}, + {'1': '_radius'}, + {'1': '_start_angle'}, + {'1': '_end_angle'}, + ], +}; + +@$core.Deprecated('Use gradientDataDescriptor instead') +const GradientData_GradientType$json = { + '1': 'GradientType', + '2': [ + {'1': 'GRADIENT_TYPE_UNSPECIFIED', '2': 0}, + {'1': 'LINEAR', '2': 1}, + {'1': 'RADIAL', '2': 2}, + {'1': 'SWEEP', '2': 3}, + ], +}; + +/// Descriptor for `GradientData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List gradientDataDescriptor = $convert.base64Decode( + 'CgxHcmFkaWVudERhdGESOwoEdHlwZRgBIAEoDjInLmZsdXR0ZXJfc2R1aS5HcmFkaWVudERhdG' + 'EuR3JhZGllbnRUeXBlUgR0eXBlEi8KBmNvbG9ycxgCIAMoCzIXLmZsdXR0ZXJfc2R1aS5Db2xv' + 'ckRhdGFSBmNvbG9ycxIUCgVzdG9wcxgDIAMoAVIFc3RvcHMSNgoFYmVnaW4YBCABKAsyGy5mbH' + 'V0dGVyX3NkdWkuQWxpZ25tZW50RGF0YUgAUgViZWdpbogBARIyCgNlbmQYBSABKAsyGy5mbHV0' + 'dGVyX3NkdWkuQWxpZ25tZW50RGF0YUgBUgNlbmSIAQESOAoGY2VudGVyGAYgASgLMhsuZmx1dH' + 'Rlcl9zZHVpLkFsaWdubWVudERhdGFIAlIGY2VudGVyiAEBEhsKBnJhZGl1cxgHIAEoAUgDUgZy' + 'YWRpdXOIAQESJAoLc3RhcnRfYW5nbGUYCCABKAFIBFIKc3RhcnRBbmdsZYgBARIgCgllbmRfYW' + '5nbGUYCSABKAFIBVIIZW5kQW5nbGWIAQEiUAoMR3JhZGllbnRUeXBlEh0KGUdSQURJRU5UX1RZ' + 'UEVfVU5TUEVDSUZJRUQQABIKCgZMSU5FQVIQARIKCgZSQURJQUwQAhIJCgVTV0VFUBADQggKBl' + '9iZWdpbkIGCgRfZW5kQgkKB19jZW50ZXJCCQoHX3JhZGl1c0IOCgxfc3RhcnRfYW5nbGVCDAoK' + 'X2VuZF9hbmdsZQ=='); + +@$core.Deprecated('Use alignmentDataDescriptor instead') +const AlignmentData$json = { + '1': 'AlignmentData', + '2': [ + {'1': 'predefined', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.AlignmentData.PredefinedAlignment', '9': 0, '10': 'predefined'}, + {'1': 'xy', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.XYAlignment', '9': 0, '10': 'xy'}, + ], + '4': [AlignmentData_PredefinedAlignment$json], + '8': [ + {'1': 'alignment_type'}, + ], +}; + +@$core.Deprecated('Use alignmentDataDescriptor instead') +const AlignmentData_PredefinedAlignment$json = { + '1': 'PredefinedAlignment', + '2': [ + {'1': 'PREDEFINED_ALIGNMENT_UNSPECIFIED', '2': 0}, + {'1': 'BOTTOM_CENTER', '2': 1}, + {'1': 'BOTTOM_LEFT', '2': 2}, + {'1': 'BOTTOM_RIGHT', '2': 3}, + {'1': 'CENTER', '2': 4}, + {'1': 'CENTER_LEFT', '2': 5}, + {'1': 'CENTER_RIGHT', '2': 6}, + {'1': 'TOP_CENTER', '2': 7}, + {'1': 'TOP_LEFT', '2': 8}, + {'1': 'TOP_RIGHT', '2': 9}, + ], +}; + +/// Descriptor for `AlignmentData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List alignmentDataDescriptor = $convert.base64Decode( + 'Cg1BbGlnbm1lbnREYXRhElEKCnByZWRlZmluZWQYASABKA4yLy5mbHV0dGVyX3NkdWkuQWxpZ2' + '5tZW50RGF0YS5QcmVkZWZpbmVkQWxpZ25tZW50SABSCnByZWRlZmluZWQSKwoCeHkYAiABKAsy' + 'GS5mbHV0dGVyX3NkdWkuWFlBbGlnbm1lbnRIAFICeHkizQEKE1ByZWRlZmluZWRBbGlnbm1lbn' + 'QSJAogUFJFREVGSU5FRF9BTElHTk1FTlRfVU5TUEVDSUZJRUQQABIRCg1CT1RUT01fQ0VOVEVS' + 'EAESDwoLQk9UVE9NX0xFRlQQAhIQCgxCT1RUT01fUklHSFQQAxIKCgZDRU5URVIQBBIPCgtDRU' + '5URVJfTEVGVBAFEhAKDENFTlRFUl9SSUdIVBAGEg4KClRPUF9DRU5URVIQBxIMCghUT1BfTEVG' + 'VBAIEg0KCVRPUF9SSUdIVBAJQhAKDmFsaWdubWVudF90eXBl'); + +@$core.Deprecated('Use xYAlignmentDescriptor instead') +const XYAlignment$json = { + '1': 'XYAlignment', + '2': [ + {'1': 'x', '3': 1, '4': 1, '5': 1, '10': 'x'}, + {'1': 'y', '3': 2, '4': 1, '5': 1, '10': 'y'}, + ], +}; + +/// Descriptor for `XYAlignment`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List xYAlignmentDescriptor = $convert.base64Decode( + 'CgtYWUFsaWdubWVudBIMCgF4GAEgASgBUgF4EgwKAXkYAiABKAFSAXk='); + +@$core.Deprecated('Use decorationImageDataDescriptor instead') +const DecorationImageData$json = { + '1': 'DecorationImageData', + '2': [ + {'1': 'src', '3': 1, '4': 1, '5': 9, '10': 'src'}, + {'1': 'fit', '3': 2, '4': 1, '5': 14, '6': '.flutter_sdui.BoxFitProto', '9': 0, '10': 'fit', '17': true}, + {'1': 'alignment', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 1, '10': 'alignment', '17': true}, + {'1': 'repeat', '3': 4, '4': 1, '5': 14, '6': '.flutter_sdui.ImageRepeatProto', '9': 2, '10': 'repeat', '17': true}, + {'1': 'match_text_direction', '3': 5, '4': 1, '5': 8, '9': 3, '10': 'matchTextDirection', '17': true}, + {'1': 'scale', '3': 6, '4': 1, '5': 1, '9': 4, '10': 'scale', '17': true}, + {'1': 'opacity', '3': 7, '4': 1, '5': 1, '9': 5, '10': 'opacity', '17': true}, + {'1': 'filter_quality', '3': 8, '4': 1, '5': 14, '6': '.flutter_sdui.FilterQualityProto', '9': 6, '10': 'filterQuality', '17': true}, + {'1': 'invert_colors', '3': 9, '4': 1, '5': 8, '9': 7, '10': 'invertColors', '17': true}, + {'1': 'is_anti_alias', '3': 10, '4': 1, '5': 8, '9': 8, '10': 'isAntiAlias', '17': true}, + ], + '8': [ + {'1': '_fit'}, + {'1': '_alignment'}, + {'1': '_repeat'}, + {'1': '_match_text_direction'}, + {'1': '_scale'}, + {'1': '_opacity'}, + {'1': '_filter_quality'}, + {'1': '_invert_colors'}, + {'1': '_is_anti_alias'}, + ], +}; + +/// Descriptor for `DecorationImageData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List decorationImageDataDescriptor = $convert.base64Decode( + 'ChNEZWNvcmF0aW9uSW1hZ2VEYXRhEhAKA3NyYxgBIAEoCVIDc3JjEjAKA2ZpdBgCIAEoDjIZLm' + 'ZsdXR0ZXJfc2R1aS5Cb3hGaXRQcm90b0gAUgNmaXSIAQESPgoJYWxpZ25tZW50GAMgASgLMhsu' + 'Zmx1dHRlcl9zZHVpLkFsaWdubWVudERhdGFIAVIJYWxpZ25tZW50iAEBEjsKBnJlcGVhdBgEIA' + 'EoDjIeLmZsdXR0ZXJfc2R1aS5JbWFnZVJlcGVhdFByb3RvSAJSBnJlcGVhdIgBARI1ChRtYXRj' + 'aF90ZXh0X2RpcmVjdGlvbhgFIAEoCEgDUhJtYXRjaFRleHREaXJlY3Rpb26IAQESGQoFc2NhbG' + 'UYBiABKAFIBFIFc2NhbGWIAQESHQoHb3BhY2l0eRgHIAEoAUgFUgdvcGFjaXR5iAEBEkwKDmZp' + 'bHRlcl9xdWFsaXR5GAggASgOMiAuZmx1dHRlcl9zZHVpLkZpbHRlclF1YWxpdHlQcm90b0gGUg' + '1maWx0ZXJRdWFsaXR5iAEBEigKDWludmVydF9jb2xvcnMYCSABKAhIB1IMaW52ZXJ0Q29sb3Jz' + 'iAEBEicKDWlzX2FudGlfYWxpYXMYCiABKAhICFILaXNBbnRpQWxpYXOIAQFCBgoEX2ZpdEIMCg' + 'pfYWxpZ25tZW50QgkKB19yZXBlYXRCFwoVX21hdGNoX3RleHRfZGlyZWN0aW9uQggKBl9zY2Fs' + 'ZUIKCghfb3BhY2l0eUIRCg9fZmlsdGVyX3F1YWxpdHlCEAoOX2ludmVydF9jb2xvcnNCEAoOX2' + 'lzX2FudGlfYWxpYXM='); + +@$core.Deprecated('Use sduiRequestDescriptor instead') +const SduiRequest$json = { + '1': 'SduiRequest', + '2': [ + {'1': 'screen_id', '3': 1, '4': 1, '5': 9, '10': 'screenId'}, + ], +}; + +/// Descriptor for `SduiRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List sduiRequestDescriptor = $convert.base64Decode( + 'CgtTZHVpUmVxdWVzdBIbCglzY3JlZW5faWQYASABKAlSCHNjcmVlbklk'); + diff --git a/lib/src/parser/sdui_proto_parser.dart b/lib/src/parser/sdui_proto_parser.dart new file mode 100644 index 0000000..9040329 --- /dev/null +++ b/lib/src/parser/sdui_proto_parser.dart @@ -0,0 +1,308 @@ +import 'dart:developer'; + +import 'package:flutter/material.dart'; +import 'package:flutter_sdui/src/generated/sdui.pb.dart'; +import 'package:flutter_sdui/src/widgets/sdui_column.dart'; +import 'package:flutter_sdui/src/widgets/sdui_container.dart'; +import 'package:flutter_sdui/src/widgets/sdui_icon.dart'; +import 'package:flutter_sdui/src/widgets/sdui_image.dart'; +import 'package:flutter_sdui/src/widgets/sdui_row.dart'; +import 'package:flutter_sdui/src/widgets/sdui_scaffold.dart'; +import 'package:flutter_sdui/src/widgets/sdui_sized_box.dart'; +import 'package:flutter_sdui/src/widgets/sdui_spacer.dart'; +import 'package:flutter_sdui/src/widgets/sdui_text.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +// Parser for Protobuf definitions for SDUI +class SduiProtoParser { + // Parse method for JSON data + static SduiWidget parseJSON(Map data) { + // TODO: Implement JSON parsing logic + throw UnimplementedError('JSON parser not fully implemented'); + } + + // Parse from Protobuf data model + static SduiWidget parseProto(SduiWidgetData data) { + switch (data.type) { + case WidgetType.COLUMN: + return _parseProtoColumn(data); + case WidgetType.ROW: + return _parseProtoRow(data); + case WidgetType.TEXT: + return _parseProtoText(data); + case WidgetType.IMAGE: + return _parseProtoImage(data); + case WidgetType.SIZED_BOX: + return _parseProtoSizedBox(data); + case WidgetType.CONTAINER: + return _parseProtoContainer(data); + case WidgetType.SCAFFOLD: + return _parseProtoScaffold(data); + case WidgetType.SPACER: + return _parseProtoSpacer(data); + case WidgetType.ICON: + return _parseProtoIcon(data); + default: + log('Unsupported widget type: ${data.type}'); + return SduiContainer(); + } + } + + // Helper methods to parse specific widget types from protobuf + static SduiColumn _parseProtoColumn(SduiWidgetData data) { + List children = data.children + .map((child) => SduiProtoParser.parseProto(child)) + .toList(); + return SduiColumn(children: children); + } + + static SduiRow _parseProtoRow(SduiWidgetData data) { + List children = data.children + .map((child) => SduiProtoParser.parseProto(child)) + .toList(); + return SduiRow(children: children); + } + + static SduiText _parseProtoText(SduiWidgetData data) { + String text = data.stringAttributes['text'] ?? ''; + TextStyle? style = + data.hasTextStyle() ? _parseProtoTextStyle(data.textStyle) : null; + return SduiText(text, style: style); + } + + static SduiImage _parseProtoImage(SduiWidgetData data) { + String src = data.stringAttributes['src'] ?? ''; + double? width = data.doubleAttributes['width']; + double? height = data.doubleAttributes['height']; + BoxFit? fit = _parseProtoBoxFit(data.stringAttributes['fit']); + return SduiImage(src, width: width, height: height, fit: fit); + } + + static SduiSizedBox _parseProtoSizedBox(SduiWidgetData data) { + double? width = data.doubleAttributes['width']; + double? height = data.doubleAttributes['height']; + SduiWidget? child = + data.hasChild() ? SduiProtoParser.parseProto(data.child) : null; + return SduiSizedBox(width: width, height: height, child: child); + } + + static SduiContainer _parseProtoContainer(SduiWidgetData data) { + SduiWidget? child = + data.hasChild() ? SduiProtoParser.parseProto(data.child) : null; + EdgeInsets? padding = + data.hasPadding() ? _parseProtoEdgeInsets(data.padding) : null; + BoxDecoration? decoration = data.hasBoxDecoration() + ? _parseProtoBoxDecoration(data.boxDecoration) + : null; + double? width = data.doubleAttributes['width']; + double? height = data.doubleAttributes['height']; + + return SduiContainer( + child: child, + padding: padding, + decoration: decoration, + width: width, + height: height, + ); + } + + static SduiScaffold _parseProtoScaffold(SduiWidgetData data) { + SduiWidget? appBar = + data.hasAppBar() ? SduiProtoParser.parseProto(data.appBar) : null; + SduiWidget? body = + data.hasBody() ? SduiProtoParser.parseProto(data.body) : null; + SduiWidget? floatingActionButton = data.hasFloatingActionButton() + ? SduiProtoParser.parseProto(data.floatingActionButton) + : null; + Color? backgroundColor = data.hasBackgroundColor() + ? _parseProtoColor(data.backgroundColor) + : null; + + return SduiScaffold( + appBar: appBar, + body: body, + floatingActionButton: floatingActionButton, + backgroundColor: backgroundColor, + ); + } + + static SduiSpacer _parseProtoSpacer(SduiWidgetData data) { + int flex = data.intAttributes['flex'] ?? 1; + return SduiSpacer(flex: flex); + } + + static SduiIcon _parseProtoIcon(SduiWidgetData data) { + IconData? iconData = data.hasIcon() ? _parseProtoIconData(data.icon) : null; + double? size = data.icon.size; + Color? color = + data.icon.hasColor() ? _parseProtoColor(data.icon.color) : null; + + return SduiIcon( + icon: iconData, + size: size, + color: color, + ); + } + + // Helper methods for parsing protobuf attribute types + + static BoxFit? _parseProtoBoxFit(String? value) { + if (value == null) return null; + switch (value.toLowerCase()) { + case 'fill': + return BoxFit.fill; + case 'contain': + return BoxFit.contain; + case 'cover': + return BoxFit.cover; + case 'fitwidth': + return BoxFit.fitWidth; + case 'fitheight': + return BoxFit.fitHeight; + case 'none': + return BoxFit.none; + case 'scaledown': + return BoxFit.scaleDown; + default: + return null; + } + } + + static TextStyle? _parseProtoTextStyle(TextStyleData data) { + Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; + double? fontSize = data.fontSize; + FontWeight? fontWeight = _parseProtoFontWeight(data.fontWeight); + + return TextStyle( + color: color, + fontSize: fontSize, + fontWeight: fontWeight, + ); + } + + static FontWeight? _parseProtoFontWeight(String? value) { + if (value == null) return null; + switch (value.toLowerCase()) { + case 'bold': + return FontWeight.bold; + case 'normal': + return FontWeight.normal; + case 'w100': + return FontWeight.w100; + case 'w200': + return FontWeight.w200; + case 'w300': + return FontWeight.w300; + case 'w400': + return FontWeight.w400; + case 'w500': + return FontWeight.w500; + case 'w600': + return FontWeight.w600; + case 'w700': + return FontWeight.w700; + case 'w800': + return FontWeight.w800; + case 'w900': + return FontWeight.w900; + default: + return null; + } + } + + static EdgeInsets? _parseProtoEdgeInsets(EdgeInsetsData data) { + if (data.hasAll()) { + return EdgeInsets.all(data.all); + } + + return EdgeInsets.only( + left: data.left, + top: data.top, + right: data.right, + bottom: data.bottom, + ); + } + + static Color? _parseProtoColor(ColorData data) { + return Color.fromARGB( + data.alpha, + data.red, + data.green, + data.blue, + ); + } + + static IconData? _parseProtoIconData(IconDataMessage data) { + if (data.hasName()) { + // Map common icon names to Material icons (expand as needed) + switch (data.name.toLowerCase()) { + case 'settings': + return Icons.settings; + case 'home': + return Icons.home; + case 'search': + return Icons.search; + case 'add': + return Icons.add; + case 'edit': + return Icons.edit; + default: + break; + } + } + + // Fallback to codePoint if available + if (data.hasCodePoint()) { + return IconData( + data.codePoint, + fontFamily: data.fontFamily.isEmpty ? 'MaterialIcons' : data.fontFamily, + ); + } + + return null; + } + + static BoxDecoration? _parseProtoBoxDecoration(BoxDecorationData data) { + return BoxDecoration( + color: data.hasColor() ? _parseProtoColor(data.color) : null, + borderRadius: data.hasBorderRadius() + ? _parseProtoBorderRadius(data.borderRadius) + : null, + // Add more properties as needed + ); + } + + static BorderRadius? _parseProtoBorderRadius(BorderRadiusData data) { + if (data.hasAll()) { + return BorderRadius.all(Radius.circular(data.all)); + } else if (data.hasTopLeft() && + data.hasTopRight() && + data.hasBottomLeft() && + data.hasBottomRight()) { + return BorderRadius.only( + topLeft: Radius.circular(data.topLeft), + topRight: Radius.circular(data.topRight), + bottomLeft: Radius.circular(data.bottomLeft), + bottomRight: Radius.circular(data.bottomRight), + ); + } else if (data.hasTopLeft() || + data.hasTopRight() || + data.hasBottomLeft() || + data.hasBottomRight()) { + return BorderRadius.only( + topLeft: + data.hasTopLeft() ? Radius.circular(data.topLeft) : Radius.zero, + topRight: + data.hasTopRight() ? Radius.circular(data.topRight) : Radius.zero, + bottomLeft: data.hasBottomLeft() + ? Radius.circular(data.bottomLeft) + : Radius.zero, + bottomRight: data.hasBottomRight() + ? Radius.circular(data.bottomRight) + : Radius.zero, + ); + } + + return BorderRadius.circular(8.0); // Example default value + } +} diff --git a/lib/src/protos/sdui.proto b/lib/src/protos/sdui.proto new file mode 100644 index 0000000..ff36755 --- /dev/null +++ b/lib/src/protos/sdui.proto @@ -0,0 +1,242 @@ +syntax = "proto3"; + +package flutter_sdui; + +// Enum for Widget Types +enum WidgetType { + WIDGET_TYPE_UNSPECIFIED = 0; + COLUMN = 1; + ROW = 2; + TEXT = 3; + IMAGE = 4; + SIZED_BOX = 5; + CONTAINER = 6; + SCAFFOLD = 7; + SPACER = 8; + ICON = 9; + // Add other widget types here +} + +// Generic Widget message +message SduiWidgetData { + WidgetType type = 1; + map string_attributes = 2; // For simple string attributes like text content, image src + map double_attributes = 3; // For numerical attributes like width, height, flex + map bool_attributes = 4; // For boolean attributes + map int_attributes = 5; // For integer attributes like flex + + // Complex nested attributes + TextStyleData text_style = 6; + EdgeInsetsData padding = 7; + EdgeInsetsData margin = 8; // Example, if we add margin later + ColorData color = 9; // General purpose color + IconDataMessage icon = 10; + BoxDecorationData box_decoration = 11; + + // Children widgets + repeated SduiWidgetData children = 12; + SduiWidgetData child = 13; // For widgets that take a single child (e.g. SizedBox, Container) + + // Scaffold specific parts + SduiWidgetData app_bar = 14; + SduiWidgetData body = 15; // Body can also be a single child + SduiWidgetData floating_action_button = 16; + ColorData background_color = 17; // For Scaffold background +} + +// Message for Color +message ColorData { + int32 alpha = 1; + int32 red = 2; + int32 green = 3; + int32 blue = 4; + // Or alternatively, a hex string + // string hex = 5; +} + +// Message for EdgeInsets (for padding, margin) +message EdgeInsetsData { + optional double left = 1; + optional double top = 2; + optional double right = 3; + optional double bottom = 4; + optional double all = 5; +} + +// Message for TextStyle +message TextStyleData { + optional ColorData color = 1; + optional double font_size = 2; + optional string font_weight = 3; // e.g., "bold", "w500" + // Add other TextStyle properties: fontFamily, fontStyle, letterSpacing, etc. +} + +// Message for IconData +message IconDataMessage { + optional string name = 1; // e.g., "settings", "home" + optional int32 code_point = 2; + optional string font_family = 3; + optional ColorData color = 4; + optional double size = 5; +} + +// Message for BoxFit +enum BoxFitProto { + BOX_FIT_UNSPECIFIED = 0; + FILL = 1; + CONTAIN = 2; + COVER = 3; + FIT_WIDTH = 4; + FIT_HEIGHT = 5; + NONE = 6; + SCALE_DOWN = 7; +} + +// Message for BoxDecoration +message BoxDecorationData { + optional ColorData color = 1; + optional BorderRadiusData border_radius = 2; + optional BorderData border = 3; + repeated BoxShadowData box_shadow = 4; + optional GradientData gradient = 5; + optional BoxShapeProto shape = 6; // ENUM: RECTANGLE, CIRCLE + optional DecorationImageData image = 7; +} + +// Message for BorderRadius +message BorderRadiusData { + optional double all = 1; // For BorderRadius.circular(all) + // For BorderRadius.only or .vertical/.horizontal if needed later + optional double top_left = 2; + optional double top_right = 3; + optional double bottom_left = 4; + optional double bottom_right = 5; + // Specific types like vertical/horizontal can be handled by how these are set +} + +// Message for BorderSide +message BorderSideData { + optional ColorData color = 1; + optional double width = 2; + optional BorderStyleProto style = 3; // ENUM: SOLID, NONE +} + +// Message for Border +message BorderData { + optional BorderSideData top = 1; + optional BorderSideData right = 2; + optional BorderSideData bottom = 3; + optional BorderSideData left = 4; + optional BorderSideData all = 5; // For Border.all +} + +// Enum for BorderStyle +enum BorderStyleProto { + BORDER_STYLE_UNSPECIFIED = 0; + SOLID = 1; + NONE_BORDER = 2; // Renamed to avoid conflict with NONE in ImageRepeatProto +} + +// Message for BoxShadow +message BoxShadowData { + optional ColorData color = 1; + optional double offset_x = 2; + optional double offset_y = 3; + optional double blur_radius = 4; + optional double spread_radius = 5; +} + +// Message for Gradient +message GradientData { + enum GradientType { + GRADIENT_TYPE_UNSPECIFIED = 0; + LINEAR = 1; + RADIAL = 2; + SWEEP = 3; + } + GradientType type = 1; + repeated ColorData colors = 2; + repeated double stops = 3; + optional AlignmentData begin = 4; // For LinearGradient + optional AlignmentData end = 5; // For LinearGradient + optional AlignmentData center = 6; // For RadialGradient, SweepGradient + optional double radius = 7; // For RadialGradient + optional double start_angle = 8; // For SweepGradient + optional double end_angle = 9; // For SweepGradient +} + +// Message for Alignment (used in Gradient, DecorationImage) +message AlignmentData { + // Predefined alignments + enum PredefinedAlignment { + PREDEFINED_ALIGNMENT_UNSPECIFIED = 0; + BOTTOM_CENTER = 1; + BOTTOM_LEFT = 2; + BOTTOM_RIGHT = 3; + CENTER = 4; + CENTER_LEFT = 5; + CENTER_RIGHT = 6; + TOP_CENTER = 7; + TOP_LEFT = 8; + TOP_RIGHT = 9; + } + oneof alignment_type { + PredefinedAlignment predefined = 1; + XYAlignment xy = 2; + } +} + +message XYAlignment { + double x = 1; + double y = 2; +} + + +// Enum for BoxShape +enum BoxShapeProto { + BOX_SHAPE_UNSPECIFIED = 0; + RECTANGLE = 1; + CIRCLE = 2; +} + +// Message for DecorationImage +message DecorationImageData { + string src = 1; // Network image URL + optional BoxFitProto fit = 2; + optional AlignmentData alignment = 3; + optional ImageRepeatProto repeat = 4; + optional bool match_text_direction = 5; + optional double scale = 6; + optional double opacity = 7; + optional FilterQualityProto filter_quality = 8; + optional bool invert_colors = 9; + optional bool is_anti_alias = 10; +} + +// Enum for ImageRepeat +enum ImageRepeatProto { + IMAGE_REPEAT_UNSPECIFIED = 0; + REPEAT = 1; + REPEAT_X = 2; + REPEAT_Y = 3; + NO_REPEAT = 4; +} + +// Enum for FilterQuality +enum FilterQualityProto { + FILTER_QUALITY_UNSPECIFIED = 0; + NONE_FQ = 1; // NONE is a keyword in proto3 for enums, so NONE_FQ + LOW = 2; + MEDIUM = 3; + HIGH = 4; +} + +// Service definition (optional for now, but good for future gRPC) +service SduiService { + rpc GetSduiWidget (SduiRequest) returns (SduiWidgetData); +} + +message SduiRequest { + string screen_id = 1; // Example: identifier for which UI to fetch +} + diff --git a/lib/src/renderer/sdui_grpc_renderer.dart b/lib/src/renderer/sdui_grpc_renderer.dart new file mode 100644 index 0000000..0e24f2a --- /dev/null +++ b/lib/src/renderer/sdui_grpc_renderer.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_sdui/src/generated/sdui.pb.dart'; +import 'package:flutter_sdui/src/parser/sdui_proto_parser.dart'; +import 'package:flutter_sdui/src/service/sdui_grpc_client.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// A widget that renders a UI from a gRPC server. +class SduiGrpcRenderer extends StatefulWidget { + /// The gRPC client to use for fetching UI widgets. + final SduiGrpcClient client; + + /// The screen ID to fetch from the server. + final String screenId; + + /// Optional loading widget to display while fetching the UI. + final Widget? loadingWidget; + + /// Optional error widget builder to display if an error occurs. + final Widget Function(BuildContext, Object)? errorBuilder; + + /// Creates a new SduiGrpcRenderer. + const SduiGrpcRenderer({ + super.key, + required this.client, + required this.screenId, + this.loadingWidget, + this.errorBuilder, + }); + + @override + State createState() => _SduiGrpcRendererState(); +} + +class _SduiGrpcRendererState extends State { + late Future _widgetFuture; + + @override + void initState() { + super.initState(); + _fetchWidget(); + } + + @override + void didUpdateWidget(SduiGrpcRenderer oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.screenId != widget.screenId || + oldWidget.client != widget.client) { + _fetchWidget(); + } + } + + void _fetchWidget() { + _widgetFuture = widget.client.getWidget(widget.screenId); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _widgetFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return widget.loadingWidget ?? + const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + if (widget.errorBuilder != null) { + return widget.errorBuilder!(context, snapshot.error!); + } + return Center(child: Text('Error: ${snapshot.error}')); + } else if (snapshot.hasData) { + // Convert the protobuf data to a Flutter widget + // This will use our SduiProtoParser to create the widget tree + final SduiWidget sduiWidget = + SduiProtoParser.parseProto(snapshot.data!); + return sduiWidget.toFlutterWidget(); + } else { + return const SizedBox.shrink(); + } + }, + ); + } +} diff --git a/lib/src/service/sdui_grpc_client.dart b/lib/src/service/sdui_grpc_client.dart new file mode 100644 index 0000000..f5e1200 --- /dev/null +++ b/lib/src/service/sdui_grpc_client.dart @@ -0,0 +1,38 @@ +import 'package:grpc/grpc.dart'; +import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; + +/// A client for the SDUI gRPC service. +class SduiGrpcClient { + late final SduiServiceClient _client; + late final ClientChannel _channel; + + /// Creates a new SDUI gRPC client. + SduiGrpcClient({ + required String host, + required int port, + bool secure = false, + }) { + _channel = ClientChannel( + host, + port: port, + options: ChannelOptions( + credentials: secure + ? const ChannelCredentials.secure() + : const ChannelCredentials.insecure(), + ), + ); + + _client = SduiServiceClient(_channel); + } + + /// Fetches a UI widget from the server. + Future getWidget(String screenId) async { + final request = SduiRequest()..screenId = screenId; + return _client.getSduiWidget(request); + } + + /// Closes the connection to the server. + Future dispose() async { + await _channel.shutdown(); + } +} diff --git a/lib/src/widgets/sdui_column.dart b/lib/src/widgets/sdui_column.dart new file mode 100644 index 0000000..11769e2 --- /dev/null +++ b/lib/src/widgets/sdui_column.dart @@ -0,0 +1,17 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Column widget in SDUI. +class SduiColumn extends SduiWidget { + final List children; + // Add other properties like mainAxisAlignment, crossAxisAlignment etc. as needed + + SduiColumn({required this.children}); + + @override + Widget toFlutterWidget() { + return Column( + children: children.map((child) => child.toFlutterWidget()).toList(), + ); + } +} diff --git a/lib/src/widgets/sdui_container.dart b/lib/src/widgets/sdui_container.dart new file mode 100644 index 0000000..167f21e --- /dev/null +++ b/lib/src/widgets/sdui_container.dart @@ -0,0 +1,31 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Container widget in SDUI. +class SduiContainer extends SduiWidget { + final SduiWidget? child; + final EdgeInsets? padding; + final BoxDecoration? decoration; // Handles color, borderRadius, border, etc. + final double? width; + final double? height; + // Add other properties like margin, alignment etc. + + SduiContainer({ + this.child, + this.padding, + this.decoration, + this.width, + this.height, + }); + + @override + Widget toFlutterWidget() { + return Container( + padding: padding, + decoration: decoration, + width: width, + height: height, + child: child?.toFlutterWidget(), + ); + } +} diff --git a/lib/src/widgets/sdui_icon.dart b/lib/src/widgets/sdui_icon.dart new file mode 100644 index 0000000..8fc0626 --- /dev/null +++ b/lib/src/widgets/sdui_icon.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents an Icon widget in SDUI. +class SduiIcon extends SduiWidget { + final IconData? icon; + final double? size; + final Color? color; + // final String? semanticLabel; // Future enhancement + + SduiIcon({ + required this.icon, + this.size, + this.color, + // this.semanticLabel, + }); + + @override + Widget toFlutterWidget() { + if (icon == null) { + // Return a placeholder or an empty widget if icon data is missing + return const SizedBox.shrink(); + } + return Icon( + icon, + size: size, + color: color, + // semanticLabel: semanticLabel, + ); + } +} diff --git a/lib/src/widgets/sdui_image.dart b/lib/src/widgets/sdui_image.dart new file mode 100644 index 0000000..83dfd3e --- /dev/null +++ b/lib/src/widgets/sdui_image.dart @@ -0,0 +1,26 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents an Image widget in SDUI. +class SduiImage extends SduiWidget { + final String src; // Network URL + final double? width; + final double? height; + final BoxFit? fit; + + SduiImage(this.src, {this.width, this.height, this.fit}); + + @override + Widget toFlutterWidget() { + // Only network images are supported as per the new requirement. + if (src.startsWith('http')) { + return Image.network(src, width: width, height: height, fit: fit); + } else { + // Optionally, return a placeholder or throw an error for non-network images. + // For now, returning an empty SizedBox. + print( + "Warning: SduiImage currently only supports network images. Provided src: $src"); + return const SizedBox.shrink(); + } + } +} diff --git a/lib/src/widgets/sdui_row.dart b/lib/src/widgets/sdui_row.dart new file mode 100644 index 0000000..43f4799 --- /dev/null +++ b/lib/src/widgets/sdui_row.dart @@ -0,0 +1,17 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Row widget in SDUI. +class SduiRow extends SduiWidget { + final List children; + // Add other properties like mainAxisAlignment, crossAxisAlignment etc. as needed + + SduiRow({required this.children}); + + @override + Widget toFlutterWidget() { + return Row( + children: children.map((child) => child.toFlutterWidget()).toList(), + ); + } +} diff --git a/lib/src/widgets/sdui_scaffold.dart b/lib/src/widgets/sdui_scaffold.dart new file mode 100644 index 0000000..c3e7b6f --- /dev/null +++ b/lib/src/widgets/sdui_scaffold.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; // Scaffold is in material.dart +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Scaffold widget in SDUI. +class SduiScaffold extends SduiWidget { + final SduiWidget? appBar; + final SduiWidget? body; + final SduiWidget? floatingActionButton; + final Color? backgroundColor; + // Add other Scaffold properties as needed (e.g., bottomNavigationBar, drawer) + + SduiScaffold({ + this.appBar, + this.body, + this.floatingActionButton, + this.backgroundColor, + }); + + @override + Widget toFlutterWidget() { + Widget? flutterAppBar; + if (appBar != null) { + // Attempt to cast to PreferredSizeWidget. This assumes the SDUI appBar resolves to something like AppBar. + // More robust handling might be needed if it can be any widget. + // For now, we expect it to be a widget that can be an AppBar (e.g. SduiContainer styled as an AppBar) + // or a custom SduiAppBar widget if we introduce one. + var potentialAppBar = appBar!.toFlutterWidget(); + if (potentialAppBar is PreferredSizeWidget) { + flutterAppBar = potentialAppBar; + } else { + // If it's not a PreferredSizeWidget, wrap it in one if possible or log a warning. + // For simplicity, we are strict for now. Consider a SduiAppBar sdui widget for proper typing. + print( + "Warning: appBar widget for SduiScaffold is not a PreferredSizeWidget. It might not render correctly."); + // As a fallback, one might wrap it in a simple PreferredSize if it has a defined height. + // flutterAppBar = PreferredSize(child: potentialAppBar, preferredSize: Size.fromHeight(kToolbarHeight)); + } + } + + return Scaffold( + appBar: flutterAppBar as PreferredSizeWidget?, + body: body?.toFlutterWidget(), + floatingActionButton: floatingActionButton?.toFlutterWidget(), + backgroundColor: backgroundColor, + ); + } +} diff --git a/lib/src/widgets/sdui_sized_box.dart b/lib/src/widgets/sdui_sized_box.dart new file mode 100644 index 0000000..3feb28e --- /dev/null +++ b/lib/src/widgets/sdui_sized_box.dart @@ -0,0 +1,20 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a SizedBox widget in SDUI. +class SduiSizedBox extends SduiWidget { + final double? width; + final double? height; + final SduiWidget? child; + + SduiSizedBox({this.width, this.height, this.child}); + + @override + Widget toFlutterWidget() { + return SizedBox( + width: width, + height: height, + child: child?.toFlutterWidget(), + ); + } +} diff --git a/lib/src/widgets/sdui_spacer.dart b/lib/src/widgets/sdui_spacer.dart new file mode 100644 index 0000000..4095f41 --- /dev/null +++ b/lib/src/widgets/sdui_spacer.dart @@ -0,0 +1,14 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Spacer widget in SDUI. +class SduiSpacer extends SduiWidget { + final int flex; + + SduiSpacer({this.flex = 1}); + + @override + Widget toFlutterWidget() { + return Spacer(flex: flex); + } +} diff --git a/lib/src/widgets/sdui_text.dart b/lib/src/widgets/sdui_text.dart new file mode 100644 index 0000000..4838814 --- /dev/null +++ b/lib/src/widgets/sdui_text.dart @@ -0,0 +1,15 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; + +/// Represents a Text widget in SDUI. +class SduiText extends SduiWidget { + final String text; + final TextStyle? style; + + SduiText(this.text, {this.style}); + + @override + Widget toFlutterWidget() { + return Text(text, style: style); + } +} diff --git a/lib/src/widgets/sdui_widget.dart b/lib/src/widgets/sdui_widget.dart new file mode 100644 index 0000000..2b01502 --- /dev/null +++ b/lib/src/widgets/sdui_widget.dart @@ -0,0 +1,6 @@ +import 'package:flutter/widgets.dart'; + +/// Abstract class for all SDUI widgets. +abstract class SduiWidget { + Widget toFlutterWidget(); +} diff --git a/pubspec.yaml b/pubspec.yaml index e5be782..fe72900 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,54 +1,58 @@ name: flutter_sdui -description: "A new Flutter package project." +description: "A Flutter package to render server driven UI." version: 0.0.1 -homepage: +# homepage: environment: - sdk: ^3.6.0 - flutter: ">=1.17.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.0.0" dependencies: flutter: sdk: flutter + protobuf: ^4.1.0 # For Protobuf support + grpc: ^4.0.4 # For gRPC support + # http: ^1.0.0 # Already implicitly available via flutter, but good to be explicit if direct http calls are made for JSON dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 - + flutter_lints: ^5.0.0 # Keep existing lints + build_runner: ^2.0.0 # For code generation + protoc_plugin: ^22.2.0 # For Protobuf and gRPC code generation # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. -flutter: +# flutter: - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images +# To add assets to your package, add an assets section, like this: +# assets: +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg +# +# For details regarding assets in packages, see +# https://flutter.dev/to/asset-from-package +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/to/resolution-aware-images - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package +# To add custom fonts to your package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/to/font-from-package diff --git a/test/flutter_sdui_test.dart b/test/flutter_sdui_test.dart index 5afd4bf..2cd63e6 100644 --- a/test/flutter_sdui_test.dart +++ b/test/flutter_sdui_test.dart @@ -1,12 +1,12 @@ -import 'package:flutter_test/flutter_test.dart'; +// import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_sdui/flutter_sdui.dart'; +// import 'package:flutter_sdui/flutter_sdui.dart'; -void main() { - test('adds one to input values', () { - final calculator = Calculator(); - expect(calculator.addOne(2), 3); - expect(calculator.addOne(-7), -6); - expect(calculator.addOne(0), 1); - }); -} +// void main() { +// test('adds one to input values', () { +// final calculator = Calculator(); +// expect(calculator.addOne(2), 3); +// expect(calculator.addOne(-7), -6); +// expect(calculator.addOne(0), 1); +// }); +// } diff --git a/tool/generate_protos.ps1 b/tool/generate_protos.ps1 new file mode 100644 index 0000000..0e6ad00 --- /dev/null +++ b/tool/generate_protos.ps1 @@ -0,0 +1,46 @@ +# Script to generate Dart files from Protobuf definitions +# This script assumes you've run setup_protoc.ps1 first to install protoc locally + +# Ensure our local protoc binary is in the PATH +$protoBinDir = "$PSScriptRoot\..\bin\bin" +if (Test-Path $protoBinDir) { + $env:PATH = "$protoBinDir;$env:PATH" +} else { + Write-Host "Local protoc not found. Run setup_protoc.ps1 first to install protoc." -ForegroundColor Yellow + exit 1 +} + +# Ensure the output directory exists +New-Item -ItemType Directory -Force -Path "$PSScriptRoot\..\lib\src\generated" -ErrorAction SilentlyContinue | Out-Null + +Write-Host "Updating packages..." +dart pub upgrade + +Write-Host "Clearing old generated files..." +Remove-Item -Path "$PSScriptRoot\..\lib\src\generated\*" -Force -ErrorAction SilentlyContinue + +# Use the local pub cache protoc_plugin +$PROTOC_GEN_DART = "$env:USERPROFILE\AppData\Local\Pub\Cache\bin\protoc-gen-dart.bat" +if (-not (Test-Path $PROTOC_GEN_DART)) { + Write-Host "Installing protoc_plugin globally..." + dart pub global activate protoc_plugin +} + +# Add the plugin to the PATH +$env:PATH = "$env:PATH;$env:USERPROFILE\AppData\Local\Pub\Cache\bin" + +# For debugging +Write-Host "Using protoc version: $(& $protoBinDir\protoc.exe --version)" +Write-Host "Using protoc_plugin from: $PROTOC_GEN_DART" + +# Run protoc to generate Dart files with our local binary +Write-Host "Generating Protobuf files..." +& "$protoBinDir\protoc.exe" --dart_out=grpc:lib/src/generated --proto_path=lib/src/protos lib/src/protos/sdui.proto + +Write-Host "Protobuf files generated in lib/src/generated/" + +# Alternative approach using dart run build_runner +Write-Host "Running build_runner as an alternative approach..." +dart run build_runner build --delete-conflicting-outputs + +Write-Output "Protobuf files generated in lib/src/generated/" diff --git a/tool/setup_protoc.ps1 b/tool/setup_protoc.ps1 new file mode 100644 index 0000000..2bb6ad0 --- /dev/null +++ b/tool/setup_protoc.ps1 @@ -0,0 +1,32 @@ +# Setup protoc on Windows +Write-Host "Setting up Protocol Buffers compiler (protoc)..." + +# Create a temporary directory for downloads +$tempDir = "$env:TEMP\protoc_setup" +New-Item -ItemType Directory -Force -Path $tempDir | Out-Null + +# Set the version and download URL for protoc +$protocVersion = "24.4" +$downloadUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v$protocVersion/protoc-$protocVersion-win64.zip" +$zipFile = "$tempDir\protoc.zip" + +# Create a directory for the protoc installation +$protoBinDir = "$PSScriptRoot\..\bin" +New-Item -ItemType Directory -Force -Path $protoBinDir | Out-Null + +Write-Host "Downloading protoc v$protocVersion..." +Invoke-WebRequest -Uri $downloadUrl -OutFile $zipFile + +Write-Host "Extracting protoc..." +Expand-Archive -Path $zipFile -DestinationPath $protoBinDir -Force + +Write-Host "Cleaning up..." +Remove-Item -Path $tempDir -Recurse -Force + +# Update environment variable for this session +$env:PATH = "$protoBinDir\bin;$env:PATH" + +Write-Host "protoc has been installed to $protoBinDir\bin" +Write-Host "protoc version: $(& $protoBinDir\bin\protoc.exe --version)" +Write-Host "Please add this directory to your PATH environment variable for future sessions." +Write-Host "To use protoc in this terminal session, it's already added to PATH." From 69d83c6576a6d3501169ac79a74b5167d3f29390 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Wed, 28 May 2025 16:30:23 +0530 Subject: [PATCH 03/12] chore: update README.md --- CHANGELOG.md | 11 +- README.md | 347 +++++++++++++++++---------------------------------- 2 files changed, 124 insertions(+), 234 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41cc7d8..29a813e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# Changelog + ## 0.0.1 -* TODO: Describe initial release. +### Added + +- Basic framework for Server-Driven UI implementation +- Support for rendering UI from server-provided definitions +- gRPC integration with Protocol Buffers +- Core widget support (Text, Column, Row, Container, etc.) +- Example application demonstrating gRPC usage +- Setup scripts for Protocol Buffer compilation diff --git a/README.md b/README.md index 2879199..52a2153 100644 --- a/README.md +++ b/README.md @@ -6,35 +6,39 @@

A Flutter package for implementing Server-Driven UI with both JSON and gRPC support

---- - [![Join Us](https://img.shields.io/badge/Join%20Us-Developer%20Student%20Clubs-red)](https://dsc.community.dev/vellore-institute-of-technology/) [![Discord Chat](https://img.shields.io/discord/760928671698649098.svg)](https://discord.gg/498KVdSKWR) - [![DOCS](https://img.shields.io/badge/Documentation-see%20docs-green?style=flat-square&logo=appveyor)](docs/grpc_support.md) [![UI ](https://img.shields.io/badge/Flutter-SDK-blue?style=flat-square&logo=flutter)](https://flutter.dev) -## Features +A powerful Flutter package for implementing Server-Driven UI (SDUI) with both JSON and gRPC support. + +## What is SDUI? -- [x] Render UI from server-provided definitions -- [x] Support for basic Flutter widgets (Text, Column, Row, Container, etc.) -- [x] JSON parsing for server responses -- [x] gRPC support for efficient communication -- [x] Protocol Buffers for type-safe data exchange -- [x] Easy-to-use client API +Server-Driven UI is an architectural pattern where the UI layout and content definitions come from a backend server rather than being hardcoded in the client application. This approach enables: + +- Dynamic UI updates without app store releases +- A/B testing and feature flagging at the UI level +- Consistent UI across platforms +- Faster iteration cycles for UI changes + +## Features -
+- ✅ Render UI dynamically from server-provided definitions +- ✅ Support for essential Flutter widgets (Text, Column, Row, Container, etc.) +- ✅ JSON parsing for server responses +- ✅ gRPC support for efficient, type-safe communication +- ✅ Protocol Buffers for structured data exchange +- ✅ Easy-to-use client API +- ✅ Customizable error handling and loading states -## Installation & Setup +## Installation Add the package to your `pubspec.yaml`: ```yaml dependencies: flutter_sdui: ^0.0.1 - flutter: ^3.0.0 - protobuf: ^4.1.0 - grpc: ^4.0.4 ``` Or use the Flutter CLI: @@ -43,40 +47,45 @@ Or use the Flutter CLI: flutter pub add flutter_sdui ``` -Then import the package in your Dart code: +Import the package in your Dart code: ```dart import 'package:flutter_sdui/flutter_sdui.dart'; ``` -### Troubleshooting +## Basic Usage -#### Protocol Buffer Issues +This package provides two approaches for implementing server-driven UI: -If you encounter issues with the generated Protocol Buffer files: +### 1. Using gRPC (Recommended) -1. Make sure you have the correct versions of protobuf and grpc packages -2. Install protoc locally and regenerate the files: +For efficient, type-safe server communication: -```powershell -# Run the setup script to install protoc -pwsh ./tool/setup_protoc.ps1 - -# Generate the Protobuf files -pwsh ./tool/generate_protos.ps1 +```dart +// Create a gRPC client +final client = SduiGrpcClient( + host: 'your-server.com', + port: 50051, +); + +// Use the SduiGrpcRenderer widget +SduiGrpcRenderer( + client: client, + screenId: 'home_screen', + loadingWidget: CircularProgressIndicator(), + errorBuilder: (context, error) => Text('Error: $error'), +) ``` -## Usage -There are two ways to use this package: +### 2. Using JSON -1. **JSON-based approach**: For simpler implementations where you fetch UI definitions as JSON -2. **gRPC-based approach**: For more efficient, type-safe implementations using Protocol Buffers +For simpler implementation with standard HTTP requests (coming soon). -### Using the gRPC Client +## Example -To use the gRPC client for fetching server-driven UI: +Here's a complete example of using the gRPC renderer: -````dart +```dart import 'package:flutter/material.dart'; import 'package:flutter_sdui/flutter_sdui.dart'; @@ -90,40 +99,38 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'SDUI gRPC Demo', + title: 'SDUI Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), useMaterial3: true, ), - home: const GrpcDemoScreen(), + home: const SDUIDemo(), ); } } -class GrpcDemoScreen extends StatefulWidget { - const GrpcDemoScreen({super.key}); +class SDUIDemo extends StatefulWidget { + const SDUIDemo({super.key}); @override - State createState() => _GrpcDemoScreenState(); + State createState() => _SDUIDemoState(); } -class _GrpcDemoScreenState extends State { +class _SDUIDemoState extends State { late SduiGrpcClient _grpcClient; String _screenId = 'home'; @override void initState() { super.initState(); - // Connect to your gRPC server _grpcClient = SduiGrpcClient( - host: 'localhost', // Replace with your server address - port: 50051, // Replace with your server port + host: 'localhost', // Replace with your server address + port: 50051, // Replace with your server port ); } @override void dispose() { - // Close the gRPC connection when done _grpcClient.dispose(); super.dispose(); } @@ -132,77 +139,44 @@ class _GrpcDemoScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('SDUI gRPC Demo'), + title: const Text('Server-Driven UI Demo'), ), - body: Column( - children: [ - // Screen selector - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( + body: SduiGrpcRenderer( + client: _grpcClient, + screenId: _screenId, + loadingWidget: const Center( + child: CircularProgressIndicator(), + ), + errorBuilder: (context, error) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - const Text('Screen: '), - const SizedBox(width: 8), - DropdownButton( - value: _screenId, - items: const [ - DropdownMenuItem(value: 'home', child: Text('Home')), - DropdownMenuItem(value: 'profile', child: Text('Profile')), - DropdownMenuItem(value: 'settings', child: Text('Settings')), - ], - onChanged: (value) { - if (value != null) { - setState(() { - _screenId = value; - }); - } - }, + Icon(Icons.error, color: Colors.red, size: 48), + SizedBox(height: 16), + Text('Error: $error'), + SizedBox(height: 16), + ElevatedButton( + onPressed: () => setState(() {}), + child: Text('Retry'), ), ], ), - ), - - // SDUI Renderer that fetches UI from gRPC server - Expanded( - child: SduiGrpcRenderer( - client: _grpcClient, - screenId: _screenId, - loadingWidget: const Center( - child: CircularProgressIndicator(), - ), - errorBuilder: (context, error) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Icon(Icons.error, color: Colors.red, size: 48), - const SizedBox(height: 16), - Text('Error: $error'), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () => setState(() {}), - child: const Text('Retry'), - ), - ], - ), - ); - }, - ), - ), - ], + ); + }, ), ); } } +``` ## Server Implementation ### Setting Up a gRPC Server -To create a server that provides UI definitions via gRPC: +Here's a basic example of a Dart server that provides UI definitions via gRPC: ```dart -// Server implementation example import 'package:grpc/grpc.dart'; import 'package:flutter_sdui/src/generated/sdui.pb.dart'; import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; @@ -214,62 +188,26 @@ Future main() async { ], ); - final port = 50051; - await server.serve(port: port); - print('Server listening on port $port...'); - print('Press Ctrl+C to stop'); + await server.serve(port: 50051); + print('Server listening on port 50051...'); } -// Implementation of the SDUI service class SduiServiceImpl extends SduiServiceBase { @override Future getSduiWidget( ServiceCall call, SduiRequest request) async { - print('Received request for screen: ${request.screenId}'); - - // Based on the requested screen, return different UI definitions + // Return different UI based on the screenId switch (request.screenId) { case 'home': return _createHomeScreen(); - case 'profile': - return _createProfileScreen(); - case 'settings': - return _createSettingsScreen(); default: - // Default or error screen - print('Warning: Unknown screen ID requested: ${request.screenId}'); return _createErrorScreen(); } } - // Example screen definition SduiWidgetData _createHomeScreen() { - final homeScreen = SduiWidgetData() + return SduiWidgetData() ..type = WidgetType.SCAFFOLD - ..appBar = (SduiWidgetData() - ..type = WidgetType.CONTAINER - ..boxDecoration = (BoxDecorationData() - ..color = (ColorData() - ..red = 25 - ..green = 118 - ..blue = 210 - ..alpha = 255)) - ..padding = (EdgeInsetsData() - ..top = 8 - ..left = 16 - ..right = 16 - ..bottom = 8) - ..child = (SduiWidgetData() - ..type = WidgetType.TEXT - ..stringAttributes['text'] = 'Home Screen' - ..textStyle = (TextStyleData() - ..fontSize = 20 - ..fontWeight = 'bold' - ..color = (ColorData() - ..red = 255 - ..green = 255 - ..blue = 255 - ..alpha = 255)))) ..body = (SduiWidgetData() ..type = WidgetType.COLUMN ..children.addAll([ @@ -286,141 +224,84 @@ class SduiServiceImpl extends SduiServiceBase { ..type = WidgetType.TEXT ..stringAttributes['text'] = 'This UI is rendered from gRPC data' ])); - - return homeScreen; } - - // Implement other screen methods similarly... } -```` - -### Testing the gRPC Connection - -You can test the connection using a simple command-line client: - -```dart -// Simple client for testing gRPC connection -import 'dart:io'; -import 'package:flutter_sdui/src/service/sdui_grpc_client.dart'; - -Future main(List args) async { - final screenId = args.isNotEmpty ? args[0] : 'home'; - - print('Testing gRPC SDUI client...'); - print('Connecting to server at localhost:50051'); - print('Requesting screen: $screenId'); - - final client = SduiGrpcClient( - host: 'localhost', - port: 50051, - ); +``` - try { - print('Sending request...'); - final widget = await client.getWidget(screenId); - print('Response received!'); - print('Widget type: ${widget.type}'); +## Supported Widgets - if (widget.hasAppBar()) { - print('Has app bar: yes'); - } +The package currently supports these Flutter widgets: - if (widget.hasBody()) { - print('Has body: yes'); - } - - print('Success!'); - } catch (e) { - print('Error: $e'); - } finally { - await client.dispose(); - } - - print('Test completed'); - exit(0); -} -``` +- `Scaffold` +- `Container` +- `Column` +- `Row` +- `Text` +- `Image` +- `SizedBox` +- `Spacer` +- `Icon` ## Advanced Usage ### Protobuf Definitions -The package uses Protocol Buffers to define the data structures for gRPC communication. The main message types are: +The package uses Protocol Buffers to define the data structures for gRPC communication. Here's a simplified version of the main message types: ```protobuf -// Generic Widget message message SduiWidgetData { WidgetType type = 1; - map string_attributes = 2; // For simple string attributes like text content, image src - map double_attributes = 3; // For numerical attributes like width, height, flex - map bool_attributes = 4; // For boolean attributes - map int_attributes = 5; // For integer attributes like flex + map string_attributes = 2; + map double_attributes = 3; + map bool_attributes = 4; // Complex nested attributes TextStyleData text_style = 6; EdgeInsetsData padding = 7; - EdgeInsetsData margin = 8; - ColorData color = 9; - IconDataMessage icon = 10; - BoxDecorationData box_decoration = 11; // Children widgets repeated SduiWidgetData children = 12; - SduiWidgetData child = 13; // For widgets that take a single child + SduiWidgetData child = 13; // Scaffold specific parts SduiWidgetData app_bar = 14; SduiWidgetData body = 15; - SduiWidgetData floating_action_button = 16; - ColorData background_color = 17; } -// Service definition service SduiService { rpc GetSduiWidget (SduiRequest) returns (SduiWidgetData); } - -message SduiRequest { - string screen_id = 1; // Identifier for which UI to fetch -} ``` -### Custom Widget Support +### Working with Protocol Buffers -The package supports various Flutter widgets out of the box, but you can also extend it to support custom widgets by: +If you need to regenerate the Dart files from the proto definitions: -1. Adding new widget types to the `WidgetType` enum in the proto file -2. Extending the `SduiProtoParser` class to handle the new widget type +1. Install the Protocol Buffer compiler using the provided scripts: -```dart -// Extend the parser to support custom widgets -class MySduiProtoParser extends SduiProtoParser { - @override - SduiWidget parseProto(SduiWidgetData data) { - if (data.type == WidgetType.MY_CUSTOM_WIDGET) { - // Parse custom widget from proto data - return MyCustomSduiWidget( - // Extract attributes from data - ); - } +```bash +# Windows +pwsh ./tool/setup_protoc.ps1 - // Fall back to parent implementation for standard widgets - return super.parseProto(data); - } -} +# Generate the Protobuf files +pwsh ./tool/generate_protos.ps1 ``` -### Regenerating Proto Files +## Roadmap -If you modify the proto definitions, you need to regenerate the Dart files: +- [x] Basic widget support +- [x] gRPC implementation +- [ ] JSON implementation +- [ ] Interactive widgets (buttons, forms) +- [ ] More advanced widget support -1. Install the Protocol Buffer compiler (protoc) -2. Run the generator script: +## Contributing -```bash -cd your_package_directory -pwsh ./tool/generate_protos.ps1 -``` +We welcome contributions! Please see our [contributing guidelines](contributing.md) for details. + +## License + +This project is licensed under the [LICENSE](LICENSE) file in the repository. ## Contributors From 60ccb44ea29bcde795bf059237a95dd98ef48a9e Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Wed, 28 May 2025 16:33:47 +0530 Subject: [PATCH 04/12] chore: updated readme again --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 52a2153..731d0b2 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ Server-Driven UI is an architectural pattern where the UI layout and content def ## Features -- ✅ Render UI dynamically from server-provided definitions -- ✅ Support for essential Flutter widgets (Text, Column, Row, Container, etc.) -- ✅ JSON parsing for server responses -- ✅ gRPC support for efficient, type-safe communication -- ✅ Protocol Buffers for structured data exchange -- ✅ Easy-to-use client API -- ✅ Customizable error handling and loading states +- [x] Render UI dynamically from server-provided definitions +- [x] Support for essential Flutter widgets (Text, Column, Row, Container, etc.) +- [x] JSON parsing for server responses +- [x] gRPC support for efficient, type-safe communication +- [x] Protocol Buffers for structured data exchange +- [x] Easy-to-use client API +- [x] Customizable error handling and loading states ## Installation @@ -41,6 +41,13 @@ dependencies: flutter_sdui: ^0.0.1 ``` +```yaml +# For devs +dependencies: + flutter_sdui: + path: path/to/flutter_sdui +``` + Or use the Flutter CLI: ```bash From b8665c1a91c0bc45dd30f3dd78a4ab9ae00a9a48 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Wed, 28 May 2025 21:56:56 +0530 Subject: [PATCH 05/12] feat: added functionality to protobuf def and parser --- docs/doc.md | 467 ++++ lib/src/generated/sdui.pb.dart | 2589 +++++++++++++++++++--- lib/src/generated/sdui.pbenum.dart | 744 ++++++- lib/src/generated/sdui.pbgrpc.dart | 20 +- lib/src/generated/sdui.pbjson.dart | 1576 ++++++++++++- lib/src/parser/sdui_proto_parser.dart | 618 +++++- lib/src/protos/sdui.proto | 270 ++- lib/src/renderer/sdui_grpc_renderer.dart | 3 +- lib/src/widgets/sdui_column.dart | 23 +- lib/src/widgets/sdui_container.dart | 24 +- lib/src/widgets/sdui_icon.dart | 33 +- lib/src/widgets/sdui_image.dart | 61 +- lib/src/widgets/sdui_row.dart | 23 +- lib/src/widgets/sdui_scaffold.dart | 40 +- lib/src/widgets/sdui_text.dart | 53 +- 15 files changed, 6057 insertions(+), 487 deletions(-) create mode 100644 docs/doc.md diff --git a/docs/doc.md b/docs/doc.md new file mode 100644 index 0000000..2b35aa4 --- /dev/null +++ b/docs/doc.md @@ -0,0 +1,467 @@ +# Comprehensive Guide to Creating Screens with Flutter SDUI and gRPC + +## Overview + +This guide explains how to create dynamic UI screens for Flutter applications using Server-Driven UI (SDUI) with gRPC. The SDUI approach allows you to define your user interface on the server and deliver it to the client app, enabling dynamic updates without requiring app releases. + +## Setup Requirements + +1. **Flutter application** with the `flutter_sdui` package +2. **gRPC server** (can be implemented in any language that supports gRPC) +3. **Proto definitions** from the SDUI package + +## Creating a gRPC Server + +### 1. Set Up Server Environment + +Example in Dart: +```dart +import 'package:grpc/grpc.dart'; +import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; + +Future main() async { + final server = Server.create( + services: [ + SduiServiceImpl(), + ], + ); + + final port = 50051; + await server.serve(port: port); + print('Server listening on port $port...'); +} +``` + +### 2. Implement the SDUI Service + +Create a class that implements the SDUI service from the protobuf definitions: + +```dart +class SduiServiceImpl extends SduiServiceBase { + @override + Future getSduiWidget( + ServiceCall call, SduiRequest request) async { + // Return different UI based on the requested screen ID + switch (request.screenId) { + case 'home': + return _createHomeScreen(); + case 'profile': + return _createProfileScreen(); + // Add more screens as needed + default: + return _createErrorScreen(); + } + } +} +``` + +## Creating Screens + +### Basic Structure of a Screen + +Each screen is built as a tree of `SduiWidgetData` objects: + +```dart +SduiWidgetData createScreen() { + final screen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + // Define appBar properties + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Screen Title')) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + // Add child widgets here + ])); + + return screen; +} +``` + +### Common Widget Types + +#### Scaffold +The root container for a screen: +```dart +SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..backgroundColor = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255) + ..appBar = (SduiWidgetData()...) + ..body = (SduiWidgetData()...) +``` + +#### Container +A box that can have decoration, padding, margin: +```dart +SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData()..all = 16) + ..margin = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16) + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 240 + ..green = 240 + ..blue = 240 + ..alpha = 255) + ..borderRadius = (BorderRadiusData()..all = 8)) + ..child = (SduiWidgetData()...) +``` + +#### Text +Display text with styling: +```dart +SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Hello World' + ..textStyle = (TextStyleData() + ..fontSize = 16 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 0 + ..green = 0 + ..blue = 0 + ..alpha = 255)) +``` + +#### Column and Row +Layout widgets for vertical and horizontal arrangement: +```dart +SduiWidgetData() + ..type = WidgetType.COLUMN // or WidgetType.ROW + ..mainAxisAlignment = MainAxisAlignmentProto.MAIN_AXIS_CENTER + ..crossAxisAlignment = CrossAxisAlignmentProto.CROSS_AXIS_START + ..children.addAll([ + // Child widgets + ]) +``` + +#### Image +Display network images: +```dart +SduiWidgetData() + ..type = WidgetType.IMAGE + ..stringAttributes['src'] = 'https://example.com/image.jpg' + ..stringAttributes['fit'] = 'cover' + ..doubleAttributes['width'] = 200 + ..doubleAttributes['height'] = 150 +``` + +#### Icon +Display Material icons: +```dart +SduiWidgetData() + ..type = WidgetType.ICON + ..icon = (IconDataMessage() + ..name = 'home' // Material icon name + ..color = (ColorData() + ..red = 0 + ..green = 0 + ..blue = 0 + ..alpha = 255) + ..size = 24) +``` + +### Advanced Styling + +#### Gradients +```dart +..boxDecoration = (BoxDecorationData() + ..gradient = (GradientData() + ..type = GradientData_GradientType.LINEAR + ..colors.addAll([ + ColorData() + ..red = 25 + ..green = 118 + ..blue = 210 + ..alpha = 255, + ColorData() + ..red = 66 + ..green = 165 + ..blue = 245 + ..alpha = 255 + ]) + ..begin = (AlignmentData() + ..predefined = AlignmentData_PredefinedAlignment.TOP_LEFT) + ..end = (AlignmentData() + ..predefined = AlignmentData_PredefinedAlignment.BOTTOM_RIGHT))) +``` + +#### Shadows +```dart +..boxDecoration = (BoxDecorationData() + ..boxShadow.add(BoxShadowData() + ..color = (ColorData() + ..red = 0 + ..green = 0 + ..blue = 0 + ..alpha = 50) + ..offsetX = 0 + ..offsetY = 2 + ..blurRadius = 4 + ..spreadRadius = 0)) +``` + +#### Transforms +```dart +..transform = (TransformData() + ..type = TransformData_TransformType.ROTATE + ..rotationAngle = 0.05) // In radians +``` + +## Example Screens + +### Home Screen with Card Layout +```dart +SduiWidgetData _createHomeScreen() { + final homeScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..appBar = (SduiWidgetData() + ..type = WidgetType.CONTAINER + ..boxDecoration = (BoxDecorationData() + ..color = (ColorData() + ..red = 25 + ..green = 118 + ..blue = 210 + ..alpha = 255)) + ..padding = (EdgeInsetsData() + ..top = 8 + ..left = 16 + ..right = 16 + ..bottom = 8) + ..child = (SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Home Screen' + ..textStyle = (TextStyleData() + ..fontSize = 20 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)))) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + // Hero Image + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..doubleAttributes['height'] = 200 + ..child = (SduiWidgetData() + ..type = WidgetType.IMAGE + ..stringAttributes['src'] = 'https://picsum.photos/800/300' + ..stringAttributes['fit'] = 'cover'), + + // Feature card + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..margin = (EdgeInsetsData()..all = 16) + ..padding = (EdgeInsetsData()..all = 16) + ..boxDecoration = (BoxDecorationData() + ..borderRadius = (BorderRadiusData()..all = 8) + ..color = (ColorData() + ..red = 240 + ..green = 240 + ..blue = 240 + ..alpha = 255)) + ..child = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Feature Card' + ..textStyle = (TextStyleData() + ..fontSize = 18 + ..fontWeight = 'bold'), + SduiWidgetData() + ..type = WidgetType.SIZED_BOX + ..doubleAttributes['height'] = 8, + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'This is a description of the feature' + ])) + ])); + + return homeScreen; +} +``` + +### Profile Screen with Avatar +```dart +SduiWidgetData _createProfileScreen() { + final profileScreen = SduiWidgetData() + ..type = WidgetType.SCAFFOLD + ..backgroundColor = (ColorData() + ..red = 245 + ..green = 245 + ..blue = 245 + ..alpha = 255) + ..body = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + // Profile Header + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..color = (ColorData() + ..red = 76 + ..green = 175 + ..blue = 80 + ..alpha = 255) + ..padding = (EdgeInsetsData() + ..top = 40 + ..bottom = 20) + ..child = (SduiWidgetData() + ..type = WidgetType.COLUMN + ..mainAxisAlignment = MainAxisAlignmentProto.MAIN_AXIS_CENTER + ..crossAxisAlignment = CrossAxisAlignmentProto.CROSS_AXIS_CENTER + ..children.addAll([ + // Avatar + SduiWidgetData() + ..type = WidgetType.CONTAINER + ..doubleAttributes['width'] = 100 + ..doubleAttributes['height'] = 100 + ..boxDecoration = (BoxDecorationData() + ..shape = BoxShapeProto.CIRCLE + ..border = (BorderData() + ..all = (BorderSideData() + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255) + ..width = 3 + ..style = BorderStyleProto.SOLID))) + ..child = (SduiWidgetData() + ..type = WidgetType.IMAGE + ..stringAttributes['src'] = 'https://randomuser.me/api/portraits/women/44.jpg' + ..stringAttributes['fit'] = 'cover'), + + // Name + SduiWidgetData() + ..type = WidgetType.SIZED_BOX + ..doubleAttributes['height'] = 16, + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = 'Sarah Johnson' + ..textStyle = (TextStyleData() + ..fontSize = 24 + ..fontWeight = 'bold' + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)) + ])) + ])); + + return profileScreen; +} +``` + +## Best Practices + +1. **Structure Your Code** + - Create helper methods for repeated UI patterns + - Break complex screens into logical sections + +2. **Handle Errors Gracefully** + - Always provide an error screen for unknown screen IDs + - Include helpful information in error screens + +3. **Optimize Network Usage** + - Keep UI definitions concise + - Consider caching common UI components + +4. **Progressive Enhancement** + - Start with simple layouts and add complexity gradually + - Test on different device sizes + +5. **Naming Conventions** + - Use clear, consistent naming for screen IDs + - Document the purpose of each screen + +## Advanced Techniques + +### Reusable Components + +Create helper methods for commonly used components: + +```dart +SduiWidgetData _createSettingItem(String title, String subtitle, String iconName) { + return SduiWidgetData() + ..type = WidgetType.CONTAINER + ..padding = (EdgeInsetsData() + ..all = 12) + ..boxDecoration = (BoxDecorationData() + ..borderRadius = (BorderRadiusData()..all = 8) + ..color = (ColorData() + ..red = 255 + ..green = 255 + ..blue = 255 + ..alpha = 255)) + ..child = (SduiWidgetData() + ..type = WidgetType.ROW + ..children.addAll([ + // Icon + SduiWidgetData() + ..type = WidgetType.ICON + ..icon = (IconDataMessage() + ..name = iconName), + // Content + SduiWidgetData() + ..type = WidgetType.COLUMN + ..children.addAll([ + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = title, + SduiWidgetData() + ..type = WidgetType.TEXT + ..stringAttributes['text'] = subtitle + ]) + ])); +} +``` + +### Responsive Design + +Adjust layouts based on screen size: + +```dart +// Check device width from client and adapt layout +if (deviceWidth > 600) { + // Tablet layout with multi-column grid + return createTabletLayout(); +} else { + // Phone layout with single column + return createPhoneLayout(); +} +``` + +## Troubleshooting + +1. **Missing Properties** + - Ensure all required properties are set for each widget type + - Check for typos in property names + +2. **Enum Value Issues** + - Ensure you're using the correct enum values defined in the proto files + - Watch for renamed enum values to avoid conflicts + +3. **Nested Structure Problems** + - Verify that all parentheses and brackets are properly closed + - Maintain consistent indentation for readability + +4. **Type Mismatches** + - Double-check types for numeric values, especially when converting between int and double + - Ensure string attributes are used for text content + +By following this guide, you can create rich, dynamic UIs that are delivered from your server to Flutter clients via gRPC. \ No newline at end of file diff --git a/lib/src/generated/sdui.pb.dart b/lib/src/generated/sdui.pb.dart index 10caa0e..cb01cf5 100644 --- a/lib/src/generated/sdui.pb.dart +++ b/lib/src/generated/sdui.pb.dart @@ -23,8 +23,10 @@ export 'sdui.pbenum.dart'; class SduiWidgetData extends $pb.GeneratedMessage { factory SduiWidgetData({ WidgetType? type, - $core.Iterable<$core.MapEntry<$core.String, $core.String>>? stringAttributes, - $core.Iterable<$core.MapEntry<$core.String, $core.double>>? doubleAttributes, + $core.Iterable<$core.MapEntry<$core.String, $core.String>>? + stringAttributes, + $core.Iterable<$core.MapEntry<$core.String, $core.double>>? + doubleAttributes, $core.Iterable<$core.MapEntry<$core.String, $core.bool>>? boolAttributes, $core.Iterable<$core.MapEntry<$core.String, $core.int>>? intAttributes, TextStyleData? textStyle, @@ -39,6 +41,53 @@ class SduiWidgetData extends $pb.GeneratedMessage { SduiWidgetData? body, SduiWidgetData? floatingActionButton, ColorData? backgroundColor, + SduiWidgetData? bottomNavigationBar, + SduiWidgetData? drawer, + SduiWidgetData? endDrawer, + SduiWidgetData? bottomSheet, + $core.bool? resizeToAvoidBottomInset, + $core.bool? primary, + FloatingActionButtonLocationProto? floatingActionButtonLocation, + $core.bool? extendBody, + $core.bool? extendBodyBehindAppBar, + ColorData? drawerScrimColor, + $core.double? drawerEdgeDragWidth, + $core.bool? drawerEnableOpenDragGesture, + $core.bool? endDrawerEnableOpenDragGesture, + MainAxisAlignmentProto? mainAxisAlignment, + CrossAxisAlignmentProto? crossAxisAlignment, + MainAxisSizeProto? mainAxisSize, + TextDirectionProto? textDirection, + VerticalDirectionProto? verticalDirection, + TextBaselineProto? textBaseline, + AlignmentData? alignment, + BoxConstraintsData? constraints, + TransformData? transform, + AlignmentData? transformAlignment, + ClipProto? clipBehavior, + TextAlignProto? textAlign, + TextOverflowProto? overflow, + $core.int? maxLines, + $core.bool? softWrap, + $core.double? letterSpacing, + $core.double? wordSpacing, + $core.double? height, + $core.String? fontFamily, + ImageRepeatProto? repeat, + BlendModeProto? colorBlendMode, + RectData? centerSlice, + $core.bool? matchTextDirection, + $core.bool? gaplessPlayback, + FilterQualityProto? filterQuality, + $core.int? cacheWidth, + $core.int? cacheHeight, + $core.double? scale, + $core.String? semanticLabel, + SduiWidgetData? errorWidget, + SduiWidgetData? loadingWidget, + $core.double? opacity, + $core.bool? applyTextScaling, + $core.Iterable? shadows, }) { final $result = create(); if (type != null) { @@ -92,52 +141,359 @@ class SduiWidgetData extends $pb.GeneratedMessage { if (backgroundColor != null) { $result.backgroundColor = backgroundColor; } + if (bottomNavigationBar != null) { + $result.bottomNavigationBar = bottomNavigationBar; + } + if (drawer != null) { + $result.drawer = drawer; + } + if (endDrawer != null) { + $result.endDrawer = endDrawer; + } + if (bottomSheet != null) { + $result.bottomSheet = bottomSheet; + } + if (resizeToAvoidBottomInset != null) { + $result.resizeToAvoidBottomInset = resizeToAvoidBottomInset; + } + if (primary != null) { + $result.primary = primary; + } + if (floatingActionButtonLocation != null) { + $result.floatingActionButtonLocation = floatingActionButtonLocation; + } + if (extendBody != null) { + $result.extendBody = extendBody; + } + if (extendBodyBehindAppBar != null) { + $result.extendBodyBehindAppBar = extendBodyBehindAppBar; + } + if (drawerScrimColor != null) { + $result.drawerScrimColor = drawerScrimColor; + } + if (drawerEdgeDragWidth != null) { + $result.drawerEdgeDragWidth = drawerEdgeDragWidth; + } + if (drawerEnableOpenDragGesture != null) { + $result.drawerEnableOpenDragGesture = drawerEnableOpenDragGesture; + } + if (endDrawerEnableOpenDragGesture != null) { + $result.endDrawerEnableOpenDragGesture = endDrawerEnableOpenDragGesture; + } + if (mainAxisAlignment != null) { + $result.mainAxisAlignment = mainAxisAlignment; + } + if (crossAxisAlignment != null) { + $result.crossAxisAlignment = crossAxisAlignment; + } + if (mainAxisSize != null) { + $result.mainAxisSize = mainAxisSize; + } + if (textDirection != null) { + $result.textDirection = textDirection; + } + if (verticalDirection != null) { + $result.verticalDirection = verticalDirection; + } + if (textBaseline != null) { + $result.textBaseline = textBaseline; + } + if (alignment != null) { + $result.alignment = alignment; + } + if (constraints != null) { + $result.constraints = constraints; + } + if (transform != null) { + $result.transform = transform; + } + if (transformAlignment != null) { + $result.transformAlignment = transformAlignment; + } + if (clipBehavior != null) { + $result.clipBehavior = clipBehavior; + } + if (textAlign != null) { + $result.textAlign = textAlign; + } + if (overflow != null) { + $result.overflow = overflow; + } + if (maxLines != null) { + $result.maxLines = maxLines; + } + if (softWrap != null) { + $result.softWrap = softWrap; + } + if (letterSpacing != null) { + $result.letterSpacing = letterSpacing; + } + if (wordSpacing != null) { + $result.wordSpacing = wordSpacing; + } + if (height != null) { + $result.height = height; + } + if (fontFamily != null) { + $result.fontFamily = fontFamily; + } + if (repeat != null) { + $result.repeat = repeat; + } + if (colorBlendMode != null) { + $result.colorBlendMode = colorBlendMode; + } + if (centerSlice != null) { + $result.centerSlice = centerSlice; + } + if (matchTextDirection != null) { + $result.matchTextDirection = matchTextDirection; + } + if (gaplessPlayback != null) { + $result.gaplessPlayback = gaplessPlayback; + } + if (filterQuality != null) { + $result.filterQuality = filterQuality; + } + if (cacheWidth != null) { + $result.cacheWidth = cacheWidth; + } + if (cacheHeight != null) { + $result.cacheHeight = cacheHeight; + } + if (scale != null) { + $result.scale = scale; + } + if (semanticLabel != null) { + $result.semanticLabel = semanticLabel; + } + if (errorWidget != null) { + $result.errorWidget = errorWidget; + } + if (loadingWidget != null) { + $result.loadingWidget = loadingWidget; + } + if (opacity != null) { + $result.opacity = opacity; + } + if (applyTextScaling != null) { + $result.applyTextScaling = applyTextScaling; + } + if (shadows != null) { + $result.shadows.addAll(shadows); + } return $result; } SduiWidgetData._() : super(); - factory SduiWidgetData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SduiWidgetData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SduiWidgetData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: WidgetType.WIDGET_TYPE_UNSPECIFIED, valueOf: WidgetType.valueOf, enumValues: WidgetType.values) - ..m<$core.String, $core.String>(2, _omitFieldNames ? '' : 'stringAttributes', entryClassName: 'SduiWidgetData.StringAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS, packageName: const $pb.PackageName('flutter_sdui')) - ..m<$core.String, $core.double>(3, _omitFieldNames ? '' : 'doubleAttributes', entryClassName: 'SduiWidgetData.DoubleAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OD, packageName: const $pb.PackageName('flutter_sdui')) - ..m<$core.String, $core.bool>(4, _omitFieldNames ? '' : 'boolAttributes', entryClassName: 'SduiWidgetData.BoolAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OB, packageName: const $pb.PackageName('flutter_sdui')) - ..m<$core.String, $core.int>(5, _omitFieldNames ? '' : 'intAttributes', entryClassName: 'SduiWidgetData.IntAttributesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.O3, packageName: const $pb.PackageName('flutter_sdui')) - ..aOM(6, _omitFieldNames ? '' : 'textStyle', subBuilder: TextStyleData.create) - ..aOM(7, _omitFieldNames ? '' : 'padding', subBuilder: EdgeInsetsData.create) - ..aOM(8, _omitFieldNames ? '' : 'margin', subBuilder: EdgeInsetsData.create) - ..aOM(9, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) - ..aOM(10, _omitFieldNames ? '' : 'icon', subBuilder: IconDataMessage.create) - ..aOM(11, _omitFieldNames ? '' : 'boxDecoration', subBuilder: BoxDecorationData.create) - ..pc(12, _omitFieldNames ? '' : 'children', $pb.PbFieldType.PM, subBuilder: SduiWidgetData.create) - ..aOM(13, _omitFieldNames ? '' : 'child', subBuilder: SduiWidgetData.create) - ..aOM(14, _omitFieldNames ? '' : 'appBar', subBuilder: SduiWidgetData.create) - ..aOM(15, _omitFieldNames ? '' : 'body', subBuilder: SduiWidgetData.create) - ..aOM(16, _omitFieldNames ? '' : 'floatingActionButton', subBuilder: SduiWidgetData.create) - ..aOM(17, _omitFieldNames ? '' : 'backgroundColor', subBuilder: ColorData.create) - ..hasRequiredFields = false - ; + factory SduiWidgetData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory SduiWidgetData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'SduiWidgetData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, + defaultOrMaker: WidgetType.WIDGET_TYPE_UNSPECIFIED, + valueOf: WidgetType.valueOf, + enumValues: WidgetType.values) + ..m<$core.String, $core.String>( + 2, _omitFieldNames ? '' : 'stringAttributes', + entryClassName: 'SduiWidgetData.StringAttributesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OS, + packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.double>( + 3, _omitFieldNames ? '' : 'doubleAttributes', + entryClassName: 'SduiWidgetData.DoubleAttributesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OD, + packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.bool>(4, _omitFieldNames ? '' : 'boolAttributes', + entryClassName: 'SduiWidgetData.BoolAttributesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OB, + packageName: const $pb.PackageName('flutter_sdui')) + ..m<$core.String, $core.int>(5, _omitFieldNames ? '' : 'intAttributes', + entryClassName: 'SduiWidgetData.IntAttributesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.O3, + packageName: const $pb.PackageName('flutter_sdui')) + ..aOM(6, _omitFieldNames ? '' : 'textStyle', + subBuilder: TextStyleData.create) + ..aOM(7, _omitFieldNames ? '' : 'padding', + subBuilder: EdgeInsetsData.create) + ..aOM(8, _omitFieldNames ? '' : 'margin', + subBuilder: EdgeInsetsData.create) + ..aOM(9, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) + ..aOM(10, _omitFieldNames ? '' : 'icon', + subBuilder: IconDataMessage.create) + ..aOM(11, _omitFieldNames ? '' : 'boxDecoration', + subBuilder: BoxDecorationData.create) + ..pc( + 12, _omitFieldNames ? '' : 'children', $pb.PbFieldType.PM, + subBuilder: SduiWidgetData.create) + ..aOM(13, _omitFieldNames ? '' : 'child', + subBuilder: SduiWidgetData.create) + ..aOM(14, _omitFieldNames ? '' : 'appBar', + subBuilder: SduiWidgetData.create) + ..aOM(15, _omitFieldNames ? '' : 'body', + subBuilder: SduiWidgetData.create) + ..aOM(16, _omitFieldNames ? '' : 'floatingActionButton', + subBuilder: SduiWidgetData.create) + ..aOM(17, _omitFieldNames ? '' : 'backgroundColor', + subBuilder: ColorData.create) + ..aOM(18, _omitFieldNames ? '' : 'bottomNavigationBar', + subBuilder: SduiWidgetData.create) + ..aOM(19, _omitFieldNames ? '' : 'drawer', + subBuilder: SduiWidgetData.create) + ..aOM(20, _omitFieldNames ? '' : 'endDrawer', + subBuilder: SduiWidgetData.create) + ..aOM(21, _omitFieldNames ? '' : 'bottomSheet', + subBuilder: SduiWidgetData.create) + ..aOB(22, _omitFieldNames ? '' : 'resizeToAvoidBottomInset') + ..aOB(23, _omitFieldNames ? '' : 'primary') + ..e( + 24, + _omitFieldNames ? '' : 'floatingActionButtonLocation', + $pb.PbFieldType.OE, + defaultOrMaker: + FloatingActionButtonLocationProto.FAB_LOCATION_UNSPECIFIED, + valueOf: FloatingActionButtonLocationProto.valueOf, + enumValues: FloatingActionButtonLocationProto.values) + ..aOB(25, _omitFieldNames ? '' : 'extendBody') + ..aOB(26, _omitFieldNames ? '' : 'extendBodyBehindAppBar') + ..aOM(27, _omitFieldNames ? '' : 'drawerScrimColor', + subBuilder: ColorData.create) + ..a<$core.double>( + 28, _omitFieldNames ? '' : 'drawerEdgeDragWidth', $pb.PbFieldType.OD) + ..aOB(29, _omitFieldNames ? '' : 'drawerEnableOpenDragGesture') + ..aOB(30, _omitFieldNames ? '' : 'endDrawerEnableOpenDragGesture') + ..e( + 31, _omitFieldNames ? '' : 'mainAxisAlignment', $pb.PbFieldType.OE, + defaultOrMaker: MainAxisAlignmentProto.MAIN_AXIS_ALIGNMENT_UNSPECIFIED, + valueOf: MainAxisAlignmentProto.valueOf, + enumValues: MainAxisAlignmentProto.values) + ..e( + 32, _omitFieldNames ? '' : 'crossAxisAlignment', $pb.PbFieldType.OE, + defaultOrMaker: + CrossAxisAlignmentProto.CROSS_AXIS_ALIGNMENT_UNSPECIFIED, + valueOf: CrossAxisAlignmentProto.valueOf, + enumValues: CrossAxisAlignmentProto.values) + ..e( + 33, _omitFieldNames ? '' : 'mainAxisSize', $pb.PbFieldType.OE, + defaultOrMaker: MainAxisSizeProto.MAIN_AXIS_SIZE_UNSPECIFIED, + valueOf: MainAxisSizeProto.valueOf, + enumValues: MainAxisSizeProto.values) + ..e( + 34, _omitFieldNames ? '' : 'textDirection', $pb.PbFieldType.OE, + defaultOrMaker: TextDirectionProto.TEXT_DIRECTION_UNSPECIFIED, + valueOf: TextDirectionProto.valueOf, + enumValues: TextDirectionProto.values) + ..e( + 35, _omitFieldNames ? '' : 'verticalDirection', $pb.PbFieldType.OE, + defaultOrMaker: VerticalDirectionProto.VERTICAL_DIRECTION_UNSPECIFIED, + valueOf: VerticalDirectionProto.valueOf, + enumValues: VerticalDirectionProto.values) + ..e( + 36, _omitFieldNames ? '' : 'textBaseline', $pb.PbFieldType.OE, + defaultOrMaker: TextBaselineProto.TEXT_BASELINE_UNSPECIFIED, + valueOf: TextBaselineProto.valueOf, + enumValues: TextBaselineProto.values) + ..aOM(37, _omitFieldNames ? '' : 'alignment', + subBuilder: AlignmentData.create) + ..aOM(38, _omitFieldNames ? '' : 'constraints', + subBuilder: BoxConstraintsData.create) + ..aOM(39, _omitFieldNames ? '' : 'transform', + subBuilder: TransformData.create) + ..aOM(40, _omitFieldNames ? '' : 'transformAlignment', + subBuilder: AlignmentData.create) + ..e( + 41, _omitFieldNames ? '' : 'clipBehavior', $pb.PbFieldType.OE, + defaultOrMaker: ClipProto.CLIP_UNSPECIFIED, + valueOf: ClipProto.valueOf, + enumValues: ClipProto.values) + ..e( + 42, _omitFieldNames ? '' : 'textAlign', $pb.PbFieldType.OE, + defaultOrMaker: TextAlignProto.TEXT_ALIGN_UNSPECIFIED, + valueOf: TextAlignProto.valueOf, + enumValues: TextAlignProto.values) + ..e( + 43, _omitFieldNames ? '' : 'overflow', $pb.PbFieldType.OE, + defaultOrMaker: TextOverflowProto.TEXT_OVERFLOW_UNSPECIFIED, + valueOf: TextOverflowProto.valueOf, + enumValues: TextOverflowProto.values) + ..a<$core.int>(44, _omitFieldNames ? '' : 'maxLines', $pb.PbFieldType.O3) + ..aOB(45, _omitFieldNames ? '' : 'softWrap') + ..a<$core.double>( + 46, _omitFieldNames ? '' : 'letterSpacing', $pb.PbFieldType.OD) + ..a<$core.double>( + 47, _omitFieldNames ? '' : 'wordSpacing', $pb.PbFieldType.OD) + ..a<$core.double>(48, _omitFieldNames ? '' : 'height', $pb.PbFieldType.OD) + ..aOS(49, _omitFieldNames ? '' : 'fontFamily') + ..e( + 50, _omitFieldNames ? '' : 'repeat', $pb.PbFieldType.OE, + defaultOrMaker: ImageRepeatProto.IMAGE_REPEAT_UNSPECIFIED, + valueOf: ImageRepeatProto.valueOf, + enumValues: ImageRepeatProto.values) + ..e( + 51, _omitFieldNames ? '' : 'colorBlendMode', $pb.PbFieldType.OE, + defaultOrMaker: BlendModeProto.BLEND_MODE_UNSPECIFIED, + valueOf: BlendModeProto.valueOf, + enumValues: BlendModeProto.values) + ..aOM(52, _omitFieldNames ? '' : 'centerSlice', + subBuilder: RectData.create) + ..aOB(53, _omitFieldNames ? '' : 'matchTextDirection') + ..aOB(54, _omitFieldNames ? '' : 'gaplessPlayback') + ..e( + 55, _omitFieldNames ? '' : 'filterQuality', $pb.PbFieldType.OE, + defaultOrMaker: FilterQualityProto.FILTER_QUALITY_UNSPECIFIED, + valueOf: FilterQualityProto.valueOf, + enumValues: FilterQualityProto.values) + ..a<$core.int>(56, _omitFieldNames ? '' : 'cacheWidth', $pb.PbFieldType.O3) + ..a<$core.int>(57, _omitFieldNames ? '' : 'cacheHeight', $pb.PbFieldType.O3) + ..a<$core.double>(58, _omitFieldNames ? '' : 'scale', $pb.PbFieldType.OD) + ..aOS(59, _omitFieldNames ? '' : 'semanticLabel') + ..aOM(60, _omitFieldNames ? '' : 'errorWidget', + subBuilder: SduiWidgetData.create) + ..aOM(61, _omitFieldNames ? '' : 'loadingWidget', + subBuilder: SduiWidgetData.create) + ..a<$core.double>(62, _omitFieldNames ? '' : 'opacity', $pb.PbFieldType.OD) + ..aOB(63, _omitFieldNames ? '' : 'applyTextScaling') + ..pc(64, _omitFieldNames ? '' : 'shadows', $pb.PbFieldType.PM, + subBuilder: ShadowData.create) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') SduiWidgetData clone() => SduiWidgetData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - SduiWidgetData copyWith(void Function(SduiWidgetData) updates) => super.copyWith((message) => updates(message as SduiWidgetData)) as SduiWidgetData; + SduiWidgetData copyWith(void Function(SduiWidgetData) updates) => + super.copyWith((message) => updates(message as SduiWidgetData)) + as SduiWidgetData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static SduiWidgetData create() => SduiWidgetData._(); SduiWidgetData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static SduiWidgetData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SduiWidgetData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static SduiWidgetData? _defaultInstance; @$pb.TagNumber(1) WidgetType get type => $_getN(0); @$pb.TagNumber(1) - set type(WidgetType v) { $_setField(1, v); } + set type(WidgetType v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasType() => $_has(0); @$pb.TagNumber(1) @@ -159,7 +515,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(6) TextStyleData get textStyle => $_getN(5); @$pb.TagNumber(6) - set textStyle(TextStyleData v) { $_setField(6, v); } + set textStyle(TextStyleData v) { + $_setField(6, v); + } + @$pb.TagNumber(6) $core.bool hasTextStyle() => $_has(5); @$pb.TagNumber(6) @@ -170,7 +529,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(7) EdgeInsetsData get padding => $_getN(6); @$pb.TagNumber(7) - set padding(EdgeInsetsData v) { $_setField(7, v); } + set padding(EdgeInsetsData v) { + $_setField(7, v); + } + @$pb.TagNumber(7) $core.bool hasPadding() => $_has(6); @$pb.TagNumber(7) @@ -181,7 +543,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(8) EdgeInsetsData get margin => $_getN(7); @$pb.TagNumber(8) - set margin(EdgeInsetsData v) { $_setField(8, v); } + set margin(EdgeInsetsData v) { + $_setField(8, v); + } + @$pb.TagNumber(8) $core.bool hasMargin() => $_has(7); @$pb.TagNumber(8) @@ -192,7 +557,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(9) ColorData get color => $_getN(8); @$pb.TagNumber(9) - set color(ColorData v) { $_setField(9, v); } + set color(ColorData v) { + $_setField(9, v); + } + @$pb.TagNumber(9) $core.bool hasColor() => $_has(8); @$pb.TagNumber(9) @@ -203,7 +571,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(10) IconDataMessage get icon => $_getN(9); @$pb.TagNumber(10) - set icon(IconDataMessage v) { $_setField(10, v); } + set icon(IconDataMessage v) { + $_setField(10, v); + } + @$pb.TagNumber(10) $core.bool hasIcon() => $_has(9); @$pb.TagNumber(10) @@ -214,7 +585,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(11) BoxDecorationData get boxDecoration => $_getN(10); @$pb.TagNumber(11) - set boxDecoration(BoxDecorationData v) { $_setField(11, v); } + set boxDecoration(BoxDecorationData v) { + $_setField(11, v); + } + @$pb.TagNumber(11) $core.bool hasBoxDecoration() => $_has(10); @$pb.TagNumber(11) @@ -229,7 +603,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(13) SduiWidgetData get child => $_getN(12); @$pb.TagNumber(13) - set child(SduiWidgetData v) { $_setField(13, v); } + set child(SduiWidgetData v) { + $_setField(13, v); + } + @$pb.TagNumber(13) $core.bool hasChild() => $_has(12); @$pb.TagNumber(13) @@ -241,7 +618,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(14) SduiWidgetData get appBar => $_getN(13); @$pb.TagNumber(14) - set appBar(SduiWidgetData v) { $_setField(14, v); } + set appBar(SduiWidgetData v) { + $_setField(14, v); + } + @$pb.TagNumber(14) $core.bool hasAppBar() => $_has(13); @$pb.TagNumber(14) @@ -252,7 +632,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(15) SduiWidgetData get body => $_getN(14); @$pb.TagNumber(15) - set body(SduiWidgetData v) { $_setField(15, v); } + set body(SduiWidgetData v) { + $_setField(15, v); + } + @$pb.TagNumber(15) $core.bool hasBody() => $_has(14); @$pb.TagNumber(15) @@ -263,7 +646,10 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(16) SduiWidgetData get floatingActionButton => $_getN(15); @$pb.TagNumber(16) - set floatingActionButton(SduiWidgetData v) { $_setField(16, v); } + set floatingActionButton(SduiWidgetData v) { + $_setField(16, v); + } + @$pb.TagNumber(16) $core.bool hasFloatingActionButton() => $_has(15); @$pb.TagNumber(16) @@ -274,13 +660,602 @@ class SduiWidgetData extends $pb.GeneratedMessage { @$pb.TagNumber(17) ColorData get backgroundColor => $_getN(16); @$pb.TagNumber(17) - set backgroundColor(ColorData v) { $_setField(17, v); } + set backgroundColor(ColorData v) { + $_setField(17, v); + } + @$pb.TagNumber(17) $core.bool hasBackgroundColor() => $_has(16); @$pb.TagNumber(17) void clearBackgroundColor() => $_clearField(17); @$pb.TagNumber(17) ColorData ensureBackgroundColor() => $_ensure(16); + + /// New Scaffold attributes + @$pb.TagNumber(18) + SduiWidgetData get bottomNavigationBar => $_getN(17); + @$pb.TagNumber(18) + set bottomNavigationBar(SduiWidgetData v) { + $_setField(18, v); + } + + @$pb.TagNumber(18) + $core.bool hasBottomNavigationBar() => $_has(17); + @$pb.TagNumber(18) + void clearBottomNavigationBar() => $_clearField(18); + @$pb.TagNumber(18) + SduiWidgetData ensureBottomNavigationBar() => $_ensure(17); + + @$pb.TagNumber(19) + SduiWidgetData get drawer => $_getN(18); + @$pb.TagNumber(19) + set drawer(SduiWidgetData v) { + $_setField(19, v); + } + + @$pb.TagNumber(19) + $core.bool hasDrawer() => $_has(18); + @$pb.TagNumber(19) + void clearDrawer() => $_clearField(19); + @$pb.TagNumber(19) + SduiWidgetData ensureDrawer() => $_ensure(18); + + @$pb.TagNumber(20) + SduiWidgetData get endDrawer => $_getN(19); + @$pb.TagNumber(20) + set endDrawer(SduiWidgetData v) { + $_setField(20, v); + } + + @$pb.TagNumber(20) + $core.bool hasEndDrawer() => $_has(19); + @$pb.TagNumber(20) + void clearEndDrawer() => $_clearField(20); + @$pb.TagNumber(20) + SduiWidgetData ensureEndDrawer() => $_ensure(19); + + @$pb.TagNumber(21) + SduiWidgetData get bottomSheet => $_getN(20); + @$pb.TagNumber(21) + set bottomSheet(SduiWidgetData v) { + $_setField(21, v); + } + + @$pb.TagNumber(21) + $core.bool hasBottomSheet() => $_has(20); + @$pb.TagNumber(21) + void clearBottomSheet() => $_clearField(21); + @$pb.TagNumber(21) + SduiWidgetData ensureBottomSheet() => $_ensure(20); + + @$pb.TagNumber(22) + $core.bool get resizeToAvoidBottomInset => $_getBF(21); + @$pb.TagNumber(22) + set resizeToAvoidBottomInset($core.bool v) { + $_setBool(21, v); + } + + @$pb.TagNumber(22) + $core.bool hasResizeToAvoidBottomInset() => $_has(21); + @$pb.TagNumber(22) + void clearResizeToAvoidBottomInset() => $_clearField(22); + + @$pb.TagNumber(23) + $core.bool get primary => $_getBF(22); + @$pb.TagNumber(23) + set primary($core.bool v) { + $_setBool(22, v); + } + + @$pb.TagNumber(23) + $core.bool hasPrimary() => $_has(22); + @$pb.TagNumber(23) + void clearPrimary() => $_clearField(23); + + @$pb.TagNumber(24) + FloatingActionButtonLocationProto get floatingActionButtonLocation => + $_getN(23); + @$pb.TagNumber(24) + set floatingActionButtonLocation(FloatingActionButtonLocationProto v) { + $_setField(24, v); + } + + @$pb.TagNumber(24) + $core.bool hasFloatingActionButtonLocation() => $_has(23); + @$pb.TagNumber(24) + void clearFloatingActionButtonLocation() => $_clearField(24); + + @$pb.TagNumber(25) + $core.bool get extendBody => $_getBF(24); + @$pb.TagNumber(25) + set extendBody($core.bool v) { + $_setBool(24, v); + } + + @$pb.TagNumber(25) + $core.bool hasExtendBody() => $_has(24); + @$pb.TagNumber(25) + void clearExtendBody() => $_clearField(25); + + @$pb.TagNumber(26) + $core.bool get extendBodyBehindAppBar => $_getBF(25); + @$pb.TagNumber(26) + set extendBodyBehindAppBar($core.bool v) { + $_setBool(25, v); + } + + @$pb.TagNumber(26) + $core.bool hasExtendBodyBehindAppBar() => $_has(25); + @$pb.TagNumber(26) + void clearExtendBodyBehindAppBar() => $_clearField(26); + + @$pb.TagNumber(27) + ColorData get drawerScrimColor => $_getN(26); + @$pb.TagNumber(27) + set drawerScrimColor(ColorData v) { + $_setField(27, v); + } + + @$pb.TagNumber(27) + $core.bool hasDrawerScrimColor() => $_has(26); + @$pb.TagNumber(27) + void clearDrawerScrimColor() => $_clearField(27); + @$pb.TagNumber(27) + ColorData ensureDrawerScrimColor() => $_ensure(26); + + @$pb.TagNumber(28) + $core.double get drawerEdgeDragWidth => $_getN(27); + @$pb.TagNumber(28) + set drawerEdgeDragWidth($core.double v) { + $_setDouble(27, v); + } + + @$pb.TagNumber(28) + $core.bool hasDrawerEdgeDragWidth() => $_has(27); + @$pb.TagNumber(28) + void clearDrawerEdgeDragWidth() => $_clearField(28); + + @$pb.TagNumber(29) + $core.bool get drawerEnableOpenDragGesture => $_getBF(28); + @$pb.TagNumber(29) + set drawerEnableOpenDragGesture($core.bool v) { + $_setBool(28, v); + } + + @$pb.TagNumber(29) + $core.bool hasDrawerEnableOpenDragGesture() => $_has(28); + @$pb.TagNumber(29) + void clearDrawerEnableOpenDragGesture() => $_clearField(29); + + @$pb.TagNumber(30) + $core.bool get endDrawerEnableOpenDragGesture => $_getBF(29); + @$pb.TagNumber(30) + set endDrawerEnableOpenDragGesture($core.bool v) { + $_setBool(29, v); + } + + @$pb.TagNumber(30) + $core.bool hasEndDrawerEnableOpenDragGesture() => $_has(29); + @$pb.TagNumber(30) + void clearEndDrawerEnableOpenDragGesture() => $_clearField(30); + + /// Layout attributes for Row and Column + @$pb.TagNumber(31) + MainAxisAlignmentProto get mainAxisAlignment => $_getN(30); + @$pb.TagNumber(31) + set mainAxisAlignment(MainAxisAlignmentProto v) { + $_setField(31, v); + } + + @$pb.TagNumber(31) + $core.bool hasMainAxisAlignment() => $_has(30); + @$pb.TagNumber(31) + void clearMainAxisAlignment() => $_clearField(31); + + @$pb.TagNumber(32) + CrossAxisAlignmentProto get crossAxisAlignment => $_getN(31); + @$pb.TagNumber(32) + set crossAxisAlignment(CrossAxisAlignmentProto v) { + $_setField(32, v); + } + + @$pb.TagNumber(32) + $core.bool hasCrossAxisAlignment() => $_has(31); + @$pb.TagNumber(32) + void clearCrossAxisAlignment() => $_clearField(32); + + @$pb.TagNumber(33) + MainAxisSizeProto get mainAxisSize => $_getN(32); + @$pb.TagNumber(33) + set mainAxisSize(MainAxisSizeProto v) { + $_setField(33, v); + } + + @$pb.TagNumber(33) + $core.bool hasMainAxisSize() => $_has(32); + @$pb.TagNumber(33) + void clearMainAxisSize() => $_clearField(33); + + @$pb.TagNumber(34) + TextDirectionProto get textDirection => $_getN(33); + @$pb.TagNumber(34) + set textDirection(TextDirectionProto v) { + $_setField(34, v); + } + + @$pb.TagNumber(34) + $core.bool hasTextDirection() => $_has(33); + @$pb.TagNumber(34) + void clearTextDirection() => $_clearField(34); + + @$pb.TagNumber(35) + VerticalDirectionProto get verticalDirection => $_getN(34); + @$pb.TagNumber(35) + set verticalDirection(VerticalDirectionProto v) { + $_setField(35, v); + } + + @$pb.TagNumber(35) + $core.bool hasVerticalDirection() => $_has(34); + @$pb.TagNumber(35) + void clearVerticalDirection() => $_clearField(35); + + @$pb.TagNumber(36) + TextBaselineProto get textBaseline => $_getN(35); + @$pb.TagNumber(36) + set textBaseline(TextBaselineProto v) { + $_setField(36, v); + } + + @$pb.TagNumber(36) + $core.bool hasTextBaseline() => $_has(35); + @$pb.TagNumber(36) + void clearTextBaseline() => $_clearField(36); + + /// Container specific attributes + @$pb.TagNumber(37) + AlignmentData get alignment => $_getN(36); + @$pb.TagNumber(37) + set alignment(AlignmentData v) { + $_setField(37, v); + } + + @$pb.TagNumber(37) + $core.bool hasAlignment() => $_has(36); + @$pb.TagNumber(37) + void clearAlignment() => $_clearField(37); + @$pb.TagNumber(37) + AlignmentData ensureAlignment() => $_ensure(36); + + @$pb.TagNumber(38) + BoxConstraintsData get constraints => $_getN(37); + @$pb.TagNumber(38) + set constraints(BoxConstraintsData v) { + $_setField(38, v); + } + + @$pb.TagNumber(38) + $core.bool hasConstraints() => $_has(37); + @$pb.TagNumber(38) + void clearConstraints() => $_clearField(38); + @$pb.TagNumber(38) + BoxConstraintsData ensureConstraints() => $_ensure(37); + + @$pb.TagNumber(39) + TransformData get transform => $_getN(38); + @$pb.TagNumber(39) + set transform(TransformData v) { + $_setField(39, v); + } + + @$pb.TagNumber(39) + $core.bool hasTransform() => $_has(38); + @$pb.TagNumber(39) + void clearTransform() => $_clearField(39); + @$pb.TagNumber(39) + TransformData ensureTransform() => $_ensure(38); + + @$pb.TagNumber(40) + AlignmentData get transformAlignment => $_getN(39); + @$pb.TagNumber(40) + set transformAlignment(AlignmentData v) { + $_setField(40, v); + } + + @$pb.TagNumber(40) + $core.bool hasTransformAlignment() => $_has(39); + @$pb.TagNumber(40) + void clearTransformAlignment() => $_clearField(40); + @$pb.TagNumber(40) + AlignmentData ensureTransformAlignment() => $_ensure(39); + + @$pb.TagNumber(41) + ClipProto get clipBehavior => $_getN(40); + @$pb.TagNumber(41) + set clipBehavior(ClipProto v) { + $_setField(41, v); + } + + @$pb.TagNumber(41) + $core.bool hasClipBehavior() => $_has(40); + @$pb.TagNumber(41) + void clearClipBehavior() => $_clearField(41); + + /// Text specific attributes + @$pb.TagNumber(42) + TextAlignProto get textAlign => $_getN(41); + @$pb.TagNumber(42) + set textAlign(TextAlignProto v) { + $_setField(42, v); + } + + @$pb.TagNumber(42) + $core.bool hasTextAlign() => $_has(41); + @$pb.TagNumber(42) + void clearTextAlign() => $_clearField(42); + + @$pb.TagNumber(43) + TextOverflowProto get overflow => $_getN(42); + @$pb.TagNumber(43) + set overflow(TextOverflowProto v) { + $_setField(43, v); + } + + @$pb.TagNumber(43) + $core.bool hasOverflow() => $_has(42); + @$pb.TagNumber(43) + void clearOverflow() => $_clearField(43); + + @$pb.TagNumber(44) + $core.int get maxLines => $_getIZ(43); + @$pb.TagNumber(44) + set maxLines($core.int v) { + $_setSignedInt32(43, v); + } + + @$pb.TagNumber(44) + $core.bool hasMaxLines() => $_has(43); + @$pb.TagNumber(44) + void clearMaxLines() => $_clearField(44); + + @$pb.TagNumber(45) + $core.bool get softWrap => $_getBF(44); + @$pb.TagNumber(45) + set softWrap($core.bool v) { + $_setBool(44, v); + } + + @$pb.TagNumber(45) + $core.bool hasSoftWrap() => $_has(44); + @$pb.TagNumber(45) + void clearSoftWrap() => $_clearField(45); + + @$pb.TagNumber(46) + $core.double get letterSpacing => $_getN(45); + @$pb.TagNumber(46) + set letterSpacing($core.double v) { + $_setDouble(45, v); + } + + @$pb.TagNumber(46) + $core.bool hasLetterSpacing() => $_has(45); + @$pb.TagNumber(46) + void clearLetterSpacing() => $_clearField(46); + + @$pb.TagNumber(47) + $core.double get wordSpacing => $_getN(46); + @$pb.TagNumber(47) + set wordSpacing($core.double v) { + $_setDouble(46, v); + } + + @$pb.TagNumber(47) + $core.bool hasWordSpacing() => $_has(46); + @$pb.TagNumber(47) + void clearWordSpacing() => $_clearField(47); + + @$pb.TagNumber(48) + $core.double get height => $_getN(47); + @$pb.TagNumber(48) + set height($core.double v) { + $_setDouble(47, v); + } + + @$pb.TagNumber(48) + $core.bool hasHeight() => $_has(47); + @$pb.TagNumber(48) + void clearHeight() => $_clearField(48); + + @$pb.TagNumber(49) + $core.String get fontFamily => $_getSZ(48); + @$pb.TagNumber(49) + set fontFamily($core.String v) { + $_setString(48, v); + } + + @$pb.TagNumber(49) + $core.bool hasFontFamily() => $_has(48); + @$pb.TagNumber(49) + void clearFontFamily() => $_clearField(49); + + /// Image specific attributes + @$pb.TagNumber(50) + ImageRepeatProto get repeat => $_getN(49); + @$pb.TagNumber(50) + set repeat(ImageRepeatProto v) { + $_setField(50, v); + } + + @$pb.TagNumber(50) + $core.bool hasRepeat() => $_has(49); + @$pb.TagNumber(50) + void clearRepeat() => $_clearField(50); + + @$pb.TagNumber(51) + BlendModeProto get colorBlendMode => $_getN(50); + @$pb.TagNumber(51) + set colorBlendMode(BlendModeProto v) { + $_setField(51, v); + } + + @$pb.TagNumber(51) + $core.bool hasColorBlendMode() => $_has(50); + @$pb.TagNumber(51) + void clearColorBlendMode() => $_clearField(51); + + @$pb.TagNumber(52) + RectData get centerSlice => $_getN(51); + @$pb.TagNumber(52) + set centerSlice(RectData v) { + $_setField(52, v); + } + + @$pb.TagNumber(52) + $core.bool hasCenterSlice() => $_has(51); + @$pb.TagNumber(52) + void clearCenterSlice() => $_clearField(52); + @$pb.TagNumber(52) + RectData ensureCenterSlice() => $_ensure(51); + + @$pb.TagNumber(53) + $core.bool get matchTextDirection => $_getBF(52); + @$pb.TagNumber(53) + set matchTextDirection($core.bool v) { + $_setBool(52, v); + } + + @$pb.TagNumber(53) + $core.bool hasMatchTextDirection() => $_has(52); + @$pb.TagNumber(53) + void clearMatchTextDirection() => $_clearField(53); + + @$pb.TagNumber(54) + $core.bool get gaplessPlayback => $_getBF(53); + @$pb.TagNumber(54) + set gaplessPlayback($core.bool v) { + $_setBool(53, v); + } + + @$pb.TagNumber(54) + $core.bool hasGaplessPlayback() => $_has(53); + @$pb.TagNumber(54) + void clearGaplessPlayback() => $_clearField(54); + + @$pb.TagNumber(55) + FilterQualityProto get filterQuality => $_getN(54); + @$pb.TagNumber(55) + set filterQuality(FilterQualityProto v) { + $_setField(55, v); + } + + @$pb.TagNumber(55) + $core.bool hasFilterQuality() => $_has(54); + @$pb.TagNumber(55) + void clearFilterQuality() => $_clearField(55); + + @$pb.TagNumber(56) + $core.int get cacheWidth => $_getIZ(55); + @$pb.TagNumber(56) + set cacheWidth($core.int v) { + $_setSignedInt32(55, v); + } + + @$pb.TagNumber(56) + $core.bool hasCacheWidth() => $_has(55); + @$pb.TagNumber(56) + void clearCacheWidth() => $_clearField(56); + + @$pb.TagNumber(57) + $core.int get cacheHeight => $_getIZ(56); + @$pb.TagNumber(57) + set cacheHeight($core.int v) { + $_setSignedInt32(56, v); + } + + @$pb.TagNumber(57) + $core.bool hasCacheHeight() => $_has(56); + @$pb.TagNumber(57) + void clearCacheHeight() => $_clearField(57); + + @$pb.TagNumber(58) + $core.double get scale => $_getN(57); + @$pb.TagNumber(58) + set scale($core.double v) { + $_setDouble(57, v); + } + + @$pb.TagNumber(58) + $core.bool hasScale() => $_has(57); + @$pb.TagNumber(58) + void clearScale() => $_clearField(58); + + @$pb.TagNumber(59) + $core.String get semanticLabel => $_getSZ(58); + @$pb.TagNumber(59) + set semanticLabel($core.String v) { + $_setString(58, v); + } + + @$pb.TagNumber(59) + $core.bool hasSemanticLabel() => $_has(58); + @$pb.TagNumber(59) + void clearSemanticLabel() => $_clearField(59); + + @$pb.TagNumber(60) + SduiWidgetData get errorWidget => $_getN(59); + @$pb.TagNumber(60) + set errorWidget(SduiWidgetData v) { + $_setField(60, v); + } + + @$pb.TagNumber(60) + $core.bool hasErrorWidget() => $_has(59); + @$pb.TagNumber(60) + void clearErrorWidget() => $_clearField(60); + @$pb.TagNumber(60) + SduiWidgetData ensureErrorWidget() => $_ensure(59); + + @$pb.TagNumber(61) + SduiWidgetData get loadingWidget => $_getN(60); + @$pb.TagNumber(61) + set loadingWidget(SduiWidgetData v) { + $_setField(61, v); + } + + @$pb.TagNumber(61) + $core.bool hasLoadingWidget() => $_has(60); + @$pb.TagNumber(61) + void clearLoadingWidget() => $_clearField(61); + @$pb.TagNumber(61) + SduiWidgetData ensureLoadingWidget() => $_ensure(60); + + /// Icon specific attributes + @$pb.TagNumber(62) + $core.double get opacity => $_getN(61); + @$pb.TagNumber(62) + set opacity($core.double v) { + $_setDouble(61, v); + } + + @$pb.TagNumber(62) + $core.bool hasOpacity() => $_has(61); + @$pb.TagNumber(62) + void clearOpacity() => $_clearField(62); + + @$pb.TagNumber(63) + $core.bool get applyTextScaling => $_getBF(62); + @$pb.TagNumber(63) + set applyTextScaling($core.bool v) { + $_setBool(62, v); + } + + @$pb.TagNumber(63) + $core.bool hasApplyTextScaling() => $_has(62); + @$pb.TagNumber(63) + void clearApplyTextScaling() => $_clearField(63); + + @$pb.TagNumber(64) + $pb.PbList get shadows => $_getList(63); } /// Message for Color @@ -307,21 +1282,28 @@ class ColorData extends $pb.GeneratedMessage { return $result; } ColorData._() : super(); - factory ColorData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ColorData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ColorData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory ColorData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ColorData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ColorData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..a<$core.int>(1, _omitFieldNames ? '' : 'alpha', $pb.PbFieldType.O3) ..a<$core.int>(2, _omitFieldNames ? '' : 'red', $pb.PbFieldType.O3) ..a<$core.int>(3, _omitFieldNames ? '' : 'green', $pb.PbFieldType.O3) ..a<$core.int>(4, _omitFieldNames ? '' : 'blue', $pb.PbFieldType.O3) - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') ColorData clone() => ColorData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - ColorData copyWith(void Function(ColorData) updates) => super.copyWith((message) => updates(message as ColorData)) as ColorData; + ColorData copyWith(void Function(ColorData) updates) => + super.copyWith((message) => updates(message as ColorData)) as ColorData; $pb.BuilderInfo get info_ => _i; @@ -330,13 +1312,17 @@ class ColorData extends $pb.GeneratedMessage { ColorData createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static ColorData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ColorData getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ColorData? _defaultInstance; @$pb.TagNumber(1) $core.int get alpha => $_getIZ(0); @$pb.TagNumber(1) - set alpha($core.int v) { $_setSignedInt32(0, v); } + set alpha($core.int v) { + $_setSignedInt32(0, v); + } + @$pb.TagNumber(1) $core.bool hasAlpha() => $_has(0); @$pb.TagNumber(1) @@ -345,7 +1331,10 @@ class ColorData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.int get red => $_getIZ(1); @$pb.TagNumber(2) - set red($core.int v) { $_setSignedInt32(1, v); } + set red($core.int v) { + $_setSignedInt32(1, v); + } + @$pb.TagNumber(2) $core.bool hasRed() => $_has(1); @$pb.TagNumber(2) @@ -354,7 +1343,10 @@ class ColorData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.int get green => $_getIZ(2); @$pb.TagNumber(3) - set green($core.int v) { $_setSignedInt32(2, v); } + set green($core.int v) { + $_setSignedInt32(2, v); + } + @$pb.TagNumber(3) $core.bool hasGreen() => $_has(2); @$pb.TagNumber(3) @@ -363,7 +1355,10 @@ class ColorData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.int get blue => $_getIZ(3); @$pb.TagNumber(4) - set blue($core.int v) { $_setSignedInt32(3, v); } + set blue($core.int v) { + $_setSignedInt32(3, v); + } + @$pb.TagNumber(4) $core.bool hasBlue() => $_has(3); @$pb.TagNumber(4) @@ -398,37 +1393,50 @@ class EdgeInsetsData extends $pb.GeneratedMessage { return $result; } EdgeInsetsData._() : super(); - factory EdgeInsetsData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory EdgeInsetsData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EdgeInsetsData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory EdgeInsetsData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory EdgeInsetsData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'EdgeInsetsData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..a<$core.double>(1, _omitFieldNames ? '' : 'left', $pb.PbFieldType.OD) ..a<$core.double>(2, _omitFieldNames ? '' : 'top', $pb.PbFieldType.OD) ..a<$core.double>(3, _omitFieldNames ? '' : 'right', $pb.PbFieldType.OD) ..a<$core.double>(4, _omitFieldNames ? '' : 'bottom', $pb.PbFieldType.OD) ..a<$core.double>(5, _omitFieldNames ? '' : 'all', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') EdgeInsetsData clone() => EdgeInsetsData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - EdgeInsetsData copyWith(void Function(EdgeInsetsData) updates) => super.copyWith((message) => updates(message as EdgeInsetsData)) as EdgeInsetsData; + EdgeInsetsData copyWith(void Function(EdgeInsetsData) updates) => + super.copyWith((message) => updates(message as EdgeInsetsData)) + as EdgeInsetsData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static EdgeInsetsData create() => EdgeInsetsData._(); EdgeInsetsData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static EdgeInsetsData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static EdgeInsetsData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static EdgeInsetsData? _defaultInstance; @$pb.TagNumber(1) $core.double get left => $_getN(0); @$pb.TagNumber(1) - set left($core.double v) { $_setDouble(0, v); } + set left($core.double v) { + $_setDouble(0, v); + } + @$pb.TagNumber(1) $core.bool hasLeft() => $_has(0); @$pb.TagNumber(1) @@ -437,7 +1445,10 @@ class EdgeInsetsData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get top => $_getN(1); @$pb.TagNumber(2) - set top($core.double v) { $_setDouble(1, v); } + set top($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasTop() => $_has(1); @$pb.TagNumber(2) @@ -446,7 +1457,10 @@ class EdgeInsetsData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.double get right => $_getN(2); @$pb.TagNumber(3) - set right($core.double v) { $_setDouble(2, v); } + set right($core.double v) { + $_setDouble(2, v); + } + @$pb.TagNumber(3) $core.bool hasRight() => $_has(2); @$pb.TagNumber(3) @@ -455,7 +1469,10 @@ class EdgeInsetsData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.double get bottom => $_getN(3); @$pb.TagNumber(4) - set bottom($core.double v) { $_setDouble(3, v); } + set bottom($core.double v) { + $_setDouble(3, v); + } + @$pb.TagNumber(4) $core.bool hasBottom() => $_has(3); @$pb.TagNumber(4) @@ -464,7 +1481,10 @@ class EdgeInsetsData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.double get all => $_getN(4); @$pb.TagNumber(5) - set all($core.double v) { $_setDouble(4, v); } + set all($core.double v) { + $_setDouble(4, v); + } + @$pb.TagNumber(5) $core.bool hasAll() => $_has(4); @$pb.TagNumber(5) @@ -477,6 +1497,12 @@ class TextStyleData extends $pb.GeneratedMessage { ColorData? color, $core.double? fontSize, $core.String? fontWeight, + TextDecorationProto? decoration, + $core.double? letterSpacing, + $core.double? wordSpacing, + $core.double? height, + $core.String? fontFamily, + FontStyleProto? fontStyle, }) { final $result = create(); if (color != null) { @@ -488,38 +1514,86 @@ class TextStyleData extends $pb.GeneratedMessage { if (fontWeight != null) { $result.fontWeight = fontWeight; } + if (decoration != null) { + $result.decoration = decoration; + } + if (letterSpacing != null) { + $result.letterSpacing = letterSpacing; + } + if (wordSpacing != null) { + $result.wordSpacing = wordSpacing; + } + if (height != null) { + $result.height = height; + } + if (fontFamily != null) { + $result.fontFamily = fontFamily; + } + if (fontStyle != null) { + $result.fontStyle = fontStyle; + } return $result; } TextStyleData._() : super(); - factory TextStyleData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TextStyleData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'TextStyleData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + factory TextStyleData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory TextStyleData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'TextStyleData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) ..a<$core.double>(2, _omitFieldNames ? '' : 'fontSize', $pb.PbFieldType.OD) ..aOS(3, _omitFieldNames ? '' : 'fontWeight') - ..hasRequiredFields = false - ; + ..e( + 4, _omitFieldNames ? '' : 'decoration', $pb.PbFieldType.OE, + defaultOrMaker: TextDecorationProto.TEXT_DECORATION_UNSPECIFIED, + valueOf: TextDecorationProto.valueOf, + enumValues: TextDecorationProto.values) + ..a<$core.double>( + 5, _omitFieldNames ? '' : 'letterSpacing', $pb.PbFieldType.OD) + ..a<$core.double>( + 6, _omitFieldNames ? '' : 'wordSpacing', $pb.PbFieldType.OD) + ..a<$core.double>(7, _omitFieldNames ? '' : 'height', $pb.PbFieldType.OD) + ..aOS(8, _omitFieldNames ? '' : 'fontFamily') + ..e( + 9, _omitFieldNames ? '' : 'fontStyle', $pb.PbFieldType.OE, + defaultOrMaker: FontStyleProto.FONT_STYLE_UNSPECIFIED, + valueOf: FontStyleProto.valueOf, + enumValues: FontStyleProto.values) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') TextStyleData clone() => TextStyleData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - TextStyleData copyWith(void Function(TextStyleData) updates) => super.copyWith((message) => updates(message as TextStyleData)) as TextStyleData; + TextStyleData copyWith(void Function(TextStyleData) updates) => + super.copyWith((message) => updates(message as TextStyleData)) + as TextStyleData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static TextStyleData create() => TextStyleData._(); TextStyleData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static TextStyleData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static TextStyleData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static TextStyleData? _defaultInstance; @$pb.TagNumber(1) ColorData get color => $_getN(0); @$pb.TagNumber(1) - set color(ColorData v) { $_setField(1, v); } + set color(ColorData v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasColor() => $_has(0); @$pb.TagNumber(1) @@ -530,7 +1604,10 @@ class TextStyleData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get fontSize => $_getN(1); @$pb.TagNumber(2) - set fontSize($core.double v) { $_setDouble(1, v); } + set fontSize($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasFontSize() => $_has(1); @$pb.TagNumber(2) @@ -539,18 +1616,93 @@ class TextStyleData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get fontWeight => $_getSZ(2); @$pb.TagNumber(3) - set fontWeight($core.String v) { $_setString(2, v); } + set fontWeight($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasFontWeight() => $_has(2); @$pb.TagNumber(3) void clearFontWeight() => $_clearField(3); -} -/// Message for IconData -class IconDataMessage extends $pb.GeneratedMessage { - factory IconDataMessage({ - $core.String? name, - $core.int? codePoint, + @$pb.TagNumber(4) + TextDecorationProto get decoration => $_getN(3); + @$pb.TagNumber(4) + set decoration(TextDecorationProto v) { + $_setField(4, v); + } + + @$pb.TagNumber(4) + $core.bool hasDecoration() => $_has(3); + @$pb.TagNumber(4) + void clearDecoration() => $_clearField(4); + + @$pb.TagNumber(5) + $core.double get letterSpacing => $_getN(4); + @$pb.TagNumber(5) + set letterSpacing($core.double v) { + $_setDouble(4, v); + } + + @$pb.TagNumber(5) + $core.bool hasLetterSpacing() => $_has(4); + @$pb.TagNumber(5) + void clearLetterSpacing() => $_clearField(5); + + @$pb.TagNumber(6) + $core.double get wordSpacing => $_getN(5); + @$pb.TagNumber(6) + set wordSpacing($core.double v) { + $_setDouble(5, v); + } + + @$pb.TagNumber(6) + $core.bool hasWordSpacing() => $_has(5); + @$pb.TagNumber(6) + void clearWordSpacing() => $_clearField(6); + + @$pb.TagNumber(7) + $core.double get height => $_getN(6); + @$pb.TagNumber(7) + set height($core.double v) { + $_setDouble(6, v); + } + + @$pb.TagNumber(7) + $core.bool hasHeight() => $_has(6); + @$pb.TagNumber(7) + void clearHeight() => $_clearField(7); + + @$pb.TagNumber(8) + $core.String get fontFamily => $_getSZ(7); + @$pb.TagNumber(8) + set fontFamily($core.String v) { + $_setString(7, v); + } + + @$pb.TagNumber(8) + $core.bool hasFontFamily() => $_has(7); + @$pb.TagNumber(8) + void clearFontFamily() => $_clearField(8); + + @$pb.TagNumber(9) + FontStyleProto get fontStyle => $_getN(8); + @$pb.TagNumber(9) + set fontStyle(FontStyleProto v) { + $_setField(9, v); + } + + @$pb.TagNumber(9) + $core.bool hasFontStyle() => $_has(8); + @$pb.TagNumber(9) + void clearFontStyle() => $_clearField(9); +} + +/// Message for IconData +class IconDataMessage extends $pb.GeneratedMessage { + factory IconDataMessage({ + $core.String? name, + $core.int? codePoint, $core.String? fontFamily, ColorData? color, $core.double? size, @@ -574,37 +1726,51 @@ class IconDataMessage extends $pb.GeneratedMessage { return $result; } IconDataMessage._() : super(); - factory IconDataMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory IconDataMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'IconDataMessage', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory IconDataMessage.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory IconDataMessage.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'IconDataMessage', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') ..a<$core.int>(2, _omitFieldNames ? '' : 'codePoint', $pb.PbFieldType.O3) ..aOS(3, _omitFieldNames ? '' : 'fontFamily') - ..aOM(4, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + ..aOM(4, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) ..a<$core.double>(5, _omitFieldNames ? '' : 'size', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') IconDataMessage clone() => IconDataMessage()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - IconDataMessage copyWith(void Function(IconDataMessage) updates) => super.copyWith((message) => updates(message as IconDataMessage)) as IconDataMessage; + IconDataMessage copyWith(void Function(IconDataMessage) updates) => + super.copyWith((message) => updates(message as IconDataMessage)) + as IconDataMessage; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static IconDataMessage create() => IconDataMessage._(); IconDataMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static IconDataMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static IconDataMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static IconDataMessage? _defaultInstance; @$pb.TagNumber(1) $core.String get name => $_getSZ(0); @$pb.TagNumber(1) - set name($core.String v) { $_setString(0, v); } + set name($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasName() => $_has(0); @$pb.TagNumber(1) @@ -613,7 +1779,10 @@ class IconDataMessage extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.int get codePoint => $_getIZ(1); @$pb.TagNumber(2) - set codePoint($core.int v) { $_setSignedInt32(1, v); } + set codePoint($core.int v) { + $_setSignedInt32(1, v); + } + @$pb.TagNumber(2) $core.bool hasCodePoint() => $_has(1); @$pb.TagNumber(2) @@ -622,7 +1791,10 @@ class IconDataMessage extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get fontFamily => $_getSZ(2); @$pb.TagNumber(3) - set fontFamily($core.String v) { $_setString(2, v); } + set fontFamily($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasFontFamily() => $_has(2); @$pb.TagNumber(3) @@ -631,7 +1803,10 @@ class IconDataMessage extends $pb.GeneratedMessage { @$pb.TagNumber(4) ColorData get color => $_getN(3); @$pb.TagNumber(4) - set color(ColorData v) { $_setField(4, v); } + set color(ColorData v) { + $_setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasColor() => $_has(3); @$pb.TagNumber(4) @@ -642,7 +1817,10 @@ class IconDataMessage extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.double get size => $_getN(4); @$pb.TagNumber(5) - set size($core.double v) { $_setDouble(4, v); } + set size($core.double v) { + $_setDouble(4, v); + } + @$pb.TagNumber(5) $core.bool hasSize() => $_has(4); @$pb.TagNumber(5) @@ -685,39 +1863,62 @@ class BoxDecorationData extends $pb.GeneratedMessage { return $result; } BoxDecorationData._() : super(); - factory BoxDecorationData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BoxDecorationData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BoxDecorationData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) - ..aOM(2, _omitFieldNames ? '' : 'borderRadius', subBuilder: BorderRadiusData.create) - ..aOM(3, _omitFieldNames ? '' : 'border', subBuilder: BorderData.create) - ..pc(4, _omitFieldNames ? '' : 'boxShadow', $pb.PbFieldType.PM, subBuilder: BoxShadowData.create) - ..aOM(5, _omitFieldNames ? '' : 'gradient', subBuilder: GradientData.create) - ..e(6, _omitFieldNames ? '' : 'shape', $pb.PbFieldType.OE, defaultOrMaker: BoxShapeProto.BOX_SHAPE_UNSPECIFIED, valueOf: BoxShapeProto.valueOf, enumValues: BoxShapeProto.values) - ..aOM(7, _omitFieldNames ? '' : 'image', subBuilder: DecorationImageData.create) - ..hasRequiredFields = false - ; + factory BoxDecorationData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BoxDecorationData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BoxDecorationData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) + ..aOM(2, _omitFieldNames ? '' : 'borderRadius', + subBuilder: BorderRadiusData.create) + ..aOM(3, _omitFieldNames ? '' : 'border', + subBuilder: BorderData.create) + ..pc( + 4, _omitFieldNames ? '' : 'boxShadow', $pb.PbFieldType.PM, + subBuilder: BoxShadowData.create) + ..aOM(5, _omitFieldNames ? '' : 'gradient', + subBuilder: GradientData.create) + ..e(6, _omitFieldNames ? '' : 'shape', $pb.PbFieldType.OE, + defaultOrMaker: BoxShapeProto.BOX_SHAPE_UNSPECIFIED, + valueOf: BoxShapeProto.valueOf, + enumValues: BoxShapeProto.values) + ..aOM(7, _omitFieldNames ? '' : 'image', + subBuilder: DecorationImageData.create) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') BoxDecorationData clone() => BoxDecorationData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - BoxDecorationData copyWith(void Function(BoxDecorationData) updates) => super.copyWith((message) => updates(message as BoxDecorationData)) as BoxDecorationData; + BoxDecorationData copyWith(void Function(BoxDecorationData) updates) => + super.copyWith((message) => updates(message as BoxDecorationData)) + as BoxDecorationData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BoxDecorationData create() => BoxDecorationData._(); BoxDecorationData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BoxDecorationData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BoxDecorationData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BoxDecorationData? _defaultInstance; @$pb.TagNumber(1) ColorData get color => $_getN(0); @$pb.TagNumber(1) - set color(ColorData v) { $_setField(1, v); } + set color(ColorData v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasColor() => $_has(0); @$pb.TagNumber(1) @@ -728,7 +1929,10 @@ class BoxDecorationData extends $pb.GeneratedMessage { @$pb.TagNumber(2) BorderRadiusData get borderRadius => $_getN(1); @$pb.TagNumber(2) - set borderRadius(BorderRadiusData v) { $_setField(2, v); } + set borderRadius(BorderRadiusData v) { + $_setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasBorderRadius() => $_has(1); @$pb.TagNumber(2) @@ -739,7 +1943,10 @@ class BoxDecorationData extends $pb.GeneratedMessage { @$pb.TagNumber(3) BorderData get border => $_getN(2); @$pb.TagNumber(3) - set border(BorderData v) { $_setField(3, v); } + set border(BorderData v) { + $_setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasBorder() => $_has(2); @$pb.TagNumber(3) @@ -753,7 +1960,10 @@ class BoxDecorationData extends $pb.GeneratedMessage { @$pb.TagNumber(5) GradientData get gradient => $_getN(4); @$pb.TagNumber(5) - set gradient(GradientData v) { $_setField(5, v); } + set gradient(GradientData v) { + $_setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasGradient() => $_has(4); @$pb.TagNumber(5) @@ -764,7 +1974,10 @@ class BoxDecorationData extends $pb.GeneratedMessage { @$pb.TagNumber(6) BoxShapeProto get shape => $_getN(5); @$pb.TagNumber(6) - set shape(BoxShapeProto v) { $_setField(6, v); } + set shape(BoxShapeProto v) { + $_setField(6, v); + } + @$pb.TagNumber(6) $core.bool hasShape() => $_has(5); @$pb.TagNumber(6) @@ -773,7 +1986,10 @@ class BoxDecorationData extends $pb.GeneratedMessage { @$pb.TagNumber(7) DecorationImageData get image => $_getN(6); @$pb.TagNumber(7) - set image(DecorationImageData v) { $_setField(7, v); } + set image(DecorationImageData v) { + $_setField(7, v); + } + @$pb.TagNumber(7) $core.bool hasImage() => $_has(6); @$pb.TagNumber(7) @@ -810,37 +2026,52 @@ class BorderRadiusData extends $pb.GeneratedMessage { return $result; } BorderRadiusData._() : super(); - factory BorderRadiusData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BorderRadiusData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderRadiusData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory BorderRadiusData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BorderRadiusData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BorderRadiusData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..a<$core.double>(1, _omitFieldNames ? '' : 'all', $pb.PbFieldType.OD) ..a<$core.double>(2, _omitFieldNames ? '' : 'topLeft', $pb.PbFieldType.OD) ..a<$core.double>(3, _omitFieldNames ? '' : 'topRight', $pb.PbFieldType.OD) - ..a<$core.double>(4, _omitFieldNames ? '' : 'bottomLeft', $pb.PbFieldType.OD) - ..a<$core.double>(5, _omitFieldNames ? '' : 'bottomRight', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..a<$core.double>( + 4, _omitFieldNames ? '' : 'bottomLeft', $pb.PbFieldType.OD) + ..a<$core.double>( + 5, _omitFieldNames ? '' : 'bottomRight', $pb.PbFieldType.OD) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') BorderRadiusData clone() => BorderRadiusData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - BorderRadiusData copyWith(void Function(BorderRadiusData) updates) => super.copyWith((message) => updates(message as BorderRadiusData)) as BorderRadiusData; + BorderRadiusData copyWith(void Function(BorderRadiusData) updates) => + super.copyWith((message) => updates(message as BorderRadiusData)) + as BorderRadiusData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BorderRadiusData create() => BorderRadiusData._(); BorderRadiusData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BorderRadiusData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderRadiusData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BorderRadiusData? _defaultInstance; @$pb.TagNumber(1) $core.double get all => $_getN(0); @$pb.TagNumber(1) - set all($core.double v) { $_setDouble(0, v); } + set all($core.double v) { + $_setDouble(0, v); + } + @$pb.TagNumber(1) $core.bool hasAll() => $_has(0); @$pb.TagNumber(1) @@ -850,7 +2081,10 @@ class BorderRadiusData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get topLeft => $_getN(1); @$pb.TagNumber(2) - set topLeft($core.double v) { $_setDouble(1, v); } + set topLeft($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasTopLeft() => $_has(1); @$pb.TagNumber(2) @@ -859,7 +2093,10 @@ class BorderRadiusData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.double get topRight => $_getN(2); @$pb.TagNumber(3) - set topRight($core.double v) { $_setDouble(2, v); } + set topRight($core.double v) { + $_setDouble(2, v); + } + @$pb.TagNumber(3) $core.bool hasTopRight() => $_has(2); @$pb.TagNumber(3) @@ -868,7 +2105,10 @@ class BorderRadiusData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.double get bottomLeft => $_getN(3); @$pb.TagNumber(4) - set bottomLeft($core.double v) { $_setDouble(3, v); } + set bottomLeft($core.double v) { + $_setDouble(3, v); + } + @$pb.TagNumber(4) $core.bool hasBottomLeft() => $_has(3); @$pb.TagNumber(4) @@ -877,7 +2117,10 @@ class BorderRadiusData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.double get bottomRight => $_getN(4); @$pb.TagNumber(5) - set bottomRight($core.double v) { $_setDouble(4, v); } + set bottomRight($core.double v) { + $_setDouble(4, v); + } + @$pb.TagNumber(5) $core.bool hasBottomRight() => $_has(4); @$pb.TagNumber(5) @@ -904,35 +2147,52 @@ class BorderSideData extends $pb.GeneratedMessage { return $result; } BorderSideData._() : super(); - factory BorderSideData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BorderSideData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderSideData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + factory BorderSideData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BorderSideData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BorderSideData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) ..a<$core.double>(2, _omitFieldNames ? '' : 'width', $pb.PbFieldType.OD) - ..e(3, _omitFieldNames ? '' : 'style', $pb.PbFieldType.OE, defaultOrMaker: BorderStyleProto.BORDER_STYLE_UNSPECIFIED, valueOf: BorderStyleProto.valueOf, enumValues: BorderStyleProto.values) - ..hasRequiredFields = false - ; + ..e(3, _omitFieldNames ? '' : 'style', $pb.PbFieldType.OE, + defaultOrMaker: BorderStyleProto.BORDER_STYLE_UNSPECIFIED, + valueOf: BorderStyleProto.valueOf, + enumValues: BorderStyleProto.values) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') BorderSideData clone() => BorderSideData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - BorderSideData copyWith(void Function(BorderSideData) updates) => super.copyWith((message) => updates(message as BorderSideData)) as BorderSideData; + BorderSideData copyWith(void Function(BorderSideData) updates) => + super.copyWith((message) => updates(message as BorderSideData)) + as BorderSideData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BorderSideData create() => BorderSideData._(); BorderSideData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BorderSideData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderSideData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BorderSideData? _defaultInstance; @$pb.TagNumber(1) ColorData get color => $_getN(0); @$pb.TagNumber(1) - set color(ColorData v) { $_setField(1, v); } + set color(ColorData v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasColor() => $_has(0); @$pb.TagNumber(1) @@ -943,7 +2203,10 @@ class BorderSideData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get width => $_getN(1); @$pb.TagNumber(2) - set width($core.double v) { $_setDouble(1, v); } + set width($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasWidth() => $_has(1); @$pb.TagNumber(2) @@ -952,7 +2215,10 @@ class BorderSideData extends $pb.GeneratedMessage { @$pb.TagNumber(3) BorderStyleProto get style => $_getN(2); @$pb.TagNumber(3) - set style(BorderStyleProto v) { $_setField(3, v); } + set style(BorderStyleProto v) { + $_setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasStyle() => $_has(2); @$pb.TagNumber(3) @@ -987,22 +2253,34 @@ class BorderData extends $pb.GeneratedMessage { return $result; } BorderData._() : super(); - factory BorderData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BorderData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BorderData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'top', subBuilder: BorderSideData.create) - ..aOM(2, _omitFieldNames ? '' : 'right', subBuilder: BorderSideData.create) - ..aOM(3, _omitFieldNames ? '' : 'bottom', subBuilder: BorderSideData.create) - ..aOM(4, _omitFieldNames ? '' : 'left', subBuilder: BorderSideData.create) - ..aOM(5, _omitFieldNames ? '' : 'all', subBuilder: BorderSideData.create) - ..hasRequiredFields = false - ; + factory BorderData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BorderData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BorderData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'top', + subBuilder: BorderSideData.create) + ..aOM(2, _omitFieldNames ? '' : 'right', + subBuilder: BorderSideData.create) + ..aOM(3, _omitFieldNames ? '' : 'bottom', + subBuilder: BorderSideData.create) + ..aOM(4, _omitFieldNames ? '' : 'left', + subBuilder: BorderSideData.create) + ..aOM(5, _omitFieldNames ? '' : 'all', + subBuilder: BorderSideData.create) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') BorderData clone() => BorderData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - BorderData copyWith(void Function(BorderData) updates) => super.copyWith((message) => updates(message as BorderData)) as BorderData; + BorderData copyWith(void Function(BorderData) updates) => + super.copyWith((message) => updates(message as BorderData)) as BorderData; $pb.BuilderInfo get info_ => _i; @@ -1011,13 +2289,17 @@ class BorderData extends $pb.GeneratedMessage { BorderData createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static BorderData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BorderData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BorderData? _defaultInstance; @$pb.TagNumber(1) BorderSideData get top => $_getN(0); @$pb.TagNumber(1) - set top(BorderSideData v) { $_setField(1, v); } + set top(BorderSideData v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasTop() => $_has(0); @$pb.TagNumber(1) @@ -1028,7 +2310,10 @@ class BorderData extends $pb.GeneratedMessage { @$pb.TagNumber(2) BorderSideData get right => $_getN(1); @$pb.TagNumber(2) - set right(BorderSideData v) { $_setField(2, v); } + set right(BorderSideData v) { + $_setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasRight() => $_has(1); @$pb.TagNumber(2) @@ -1039,7 +2324,10 @@ class BorderData extends $pb.GeneratedMessage { @$pb.TagNumber(3) BorderSideData get bottom => $_getN(2); @$pb.TagNumber(3) - set bottom(BorderSideData v) { $_setField(3, v); } + set bottom(BorderSideData v) { + $_setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasBottom() => $_has(2); @$pb.TagNumber(3) @@ -1050,7 +2338,10 @@ class BorderData extends $pb.GeneratedMessage { @$pb.TagNumber(4) BorderSideData get left => $_getN(3); @$pb.TagNumber(4) - set left(BorderSideData v) { $_setField(4, v); } + set left(BorderSideData v) { + $_setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasLeft() => $_has(3); @$pb.TagNumber(4) @@ -1061,7 +2352,10 @@ class BorderData extends $pb.GeneratedMessage { @$pb.TagNumber(5) BorderSideData get all => $_getN(4); @$pb.TagNumber(5) - set all(BorderSideData v) { $_setField(5, v); } + set all(BorderSideData v) { + $_setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasAll() => $_has(4); @$pb.TagNumber(5) @@ -1098,37 +2392,53 @@ class BoxShadowData extends $pb.GeneratedMessage { return $result; } BoxShadowData._() : super(); - factory BoxShadowData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BoxShadowData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BoxShadowData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'color', subBuilder: ColorData.create) + factory BoxShadowData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BoxShadowData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BoxShadowData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) ..a<$core.double>(2, _omitFieldNames ? '' : 'offsetX', $pb.PbFieldType.OD) ..a<$core.double>(3, _omitFieldNames ? '' : 'offsetY', $pb.PbFieldType.OD) - ..a<$core.double>(4, _omitFieldNames ? '' : 'blurRadius', $pb.PbFieldType.OD) - ..a<$core.double>(5, _omitFieldNames ? '' : 'spreadRadius', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..a<$core.double>( + 4, _omitFieldNames ? '' : 'blurRadius', $pb.PbFieldType.OD) + ..a<$core.double>( + 5, _omitFieldNames ? '' : 'spreadRadius', $pb.PbFieldType.OD) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') BoxShadowData clone() => BoxShadowData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - BoxShadowData copyWith(void Function(BoxShadowData) updates) => super.copyWith((message) => updates(message as BoxShadowData)) as BoxShadowData; + BoxShadowData copyWith(void Function(BoxShadowData) updates) => + super.copyWith((message) => updates(message as BoxShadowData)) + as BoxShadowData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BoxShadowData create() => BoxShadowData._(); BoxShadowData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BoxShadowData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BoxShadowData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BoxShadowData? _defaultInstance; @$pb.TagNumber(1) ColorData get color => $_getN(0); @$pb.TagNumber(1) - set color(ColorData v) { $_setField(1, v); } + set color(ColorData v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasColor() => $_has(0); @$pb.TagNumber(1) @@ -1139,7 +2449,10 @@ class BoxShadowData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get offsetX => $_getN(1); @$pb.TagNumber(2) - set offsetX($core.double v) { $_setDouble(1, v); } + set offsetX($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasOffsetX() => $_has(1); @$pb.TagNumber(2) @@ -1148,7 +2461,10 @@ class BoxShadowData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.double get offsetY => $_getN(2); @$pb.TagNumber(3) - set offsetY($core.double v) { $_setDouble(2, v); } + set offsetY($core.double v) { + $_setDouble(2, v); + } + @$pb.TagNumber(3) $core.bool hasOffsetY() => $_has(2); @$pb.TagNumber(3) @@ -1157,7 +2473,10 @@ class BoxShadowData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.double get blurRadius => $_getN(3); @$pb.TagNumber(4) - set blurRadius($core.double v) { $_setDouble(3, v); } + set blurRadius($core.double v) { + $_setDouble(3, v); + } + @$pb.TagNumber(4) $core.bool hasBlurRadius() => $_has(3); @$pb.TagNumber(4) @@ -1166,7 +2485,10 @@ class BoxShadowData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.double get spreadRadius => $_getN(4); @$pb.TagNumber(5) - set spreadRadius($core.double v) { $_setDouble(4, v); } + set spreadRadius($core.double v) { + $_setDouble(4, v); + } + @$pb.TagNumber(5) $core.bool hasSpreadRadius() => $_has(4); @$pb.TagNumber(5) @@ -1217,41 +2539,63 @@ class GradientData extends $pb.GeneratedMessage { return $result; } GradientData._() : super(); - factory GradientData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GradientData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GradientData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) - ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: GradientData_GradientType.GRADIENT_TYPE_UNSPECIFIED, valueOf: GradientData_GradientType.valueOf, enumValues: GradientData_GradientType.values) - ..pc(2, _omitFieldNames ? '' : 'colors', $pb.PbFieldType.PM, subBuilder: ColorData.create) + factory GradientData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory GradientData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'GradientData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..e( + 1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, + defaultOrMaker: GradientData_GradientType.GRADIENT_TYPE_UNSPECIFIED, + valueOf: GradientData_GradientType.valueOf, + enumValues: GradientData_GradientType.values) + ..pc(2, _omitFieldNames ? '' : 'colors', $pb.PbFieldType.PM, + subBuilder: ColorData.create) ..p<$core.double>(3, _omitFieldNames ? '' : 'stops', $pb.PbFieldType.KD) - ..aOM(4, _omitFieldNames ? '' : 'begin', subBuilder: AlignmentData.create) - ..aOM(5, _omitFieldNames ? '' : 'end', subBuilder: AlignmentData.create) - ..aOM(6, _omitFieldNames ? '' : 'center', subBuilder: AlignmentData.create) + ..aOM(4, _omitFieldNames ? '' : 'begin', + subBuilder: AlignmentData.create) + ..aOM(5, _omitFieldNames ? '' : 'end', + subBuilder: AlignmentData.create) + ..aOM(6, _omitFieldNames ? '' : 'center', + subBuilder: AlignmentData.create) ..a<$core.double>(7, _omitFieldNames ? '' : 'radius', $pb.PbFieldType.OD) - ..a<$core.double>(8, _omitFieldNames ? '' : 'startAngle', $pb.PbFieldType.OD) + ..a<$core.double>( + 8, _omitFieldNames ? '' : 'startAngle', $pb.PbFieldType.OD) ..a<$core.double>(9, _omitFieldNames ? '' : 'endAngle', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') GradientData clone() => GradientData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - GradientData copyWith(void Function(GradientData) updates) => super.copyWith((message) => updates(message as GradientData)) as GradientData; + GradientData copyWith(void Function(GradientData) updates) => + super.copyWith((message) => updates(message as GradientData)) + as GradientData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static GradientData create() => GradientData._(); GradientData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static GradientData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GradientData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static GradientData? _defaultInstance; @$pb.TagNumber(1) GradientData_GradientType get type => $_getN(0); @$pb.TagNumber(1) - set type(GradientData_GradientType v) { $_setField(1, v); } + set type(GradientData_GradientType v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasType() => $_has(0); @$pb.TagNumber(1) @@ -1266,7 +2610,10 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(4) AlignmentData get begin => $_getN(3); @$pb.TagNumber(4) - set begin(AlignmentData v) { $_setField(4, v); } + set begin(AlignmentData v) { + $_setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasBegin() => $_has(3); @$pb.TagNumber(4) @@ -1277,7 +2624,10 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(5) AlignmentData get end => $_getN(4); @$pb.TagNumber(5) - set end(AlignmentData v) { $_setField(5, v); } + set end(AlignmentData v) { + $_setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasEnd() => $_has(4); @$pb.TagNumber(5) @@ -1288,7 +2638,10 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(6) AlignmentData get center => $_getN(5); @$pb.TagNumber(6) - set center(AlignmentData v) { $_setField(6, v); } + set center(AlignmentData v) { + $_setField(6, v); + } + @$pb.TagNumber(6) $core.bool hasCenter() => $_has(5); @$pb.TagNumber(6) @@ -1299,7 +2652,10 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.double get radius => $_getN(6); @$pb.TagNumber(7) - set radius($core.double v) { $_setDouble(6, v); } + set radius($core.double v) { + $_setDouble(6, v); + } + @$pb.TagNumber(7) $core.bool hasRadius() => $_has(6); @$pb.TagNumber(7) @@ -1308,7 +2664,10 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(8) $core.double get startAngle => $_getN(7); @$pb.TagNumber(8) - set startAngle($core.double v) { $_setDouble(7, v); } + set startAngle($core.double v) { + $_setDouble(7, v); + } + @$pb.TagNumber(8) $core.bool hasStartAngle() => $_has(7); @$pb.TagNumber(8) @@ -1317,18 +2676,17 @@ class GradientData extends $pb.GeneratedMessage { @$pb.TagNumber(9) $core.double get endAngle => $_getN(8); @$pb.TagNumber(9) - set endAngle($core.double v) { $_setDouble(8, v); } + set endAngle($core.double v) { + $_setDouble(8, v); + } + @$pb.TagNumber(9) $core.bool hasEndAngle() => $_has(8); @$pb.TagNumber(9) void clearEndAngle() => $_clearField(9); } -enum AlignmentData_AlignmentType { - predefined, - xy, - notSet -} +enum AlignmentData_AlignmentType { predefined, xy, notSet } /// Message for Alignment (used in Gradient, DecorationImage) class AlignmentData extends $pb.GeneratedMessage { @@ -1346,43 +2704,64 @@ class AlignmentData extends $pb.GeneratedMessage { return $result; } AlignmentData._() : super(); - factory AlignmentData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AlignmentData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static const $core.Map<$core.int, AlignmentData_AlignmentType> _AlignmentData_AlignmentTypeByTag = { - 1 : AlignmentData_AlignmentType.predefined, - 2 : AlignmentData_AlignmentType.xy, - 0 : AlignmentData_AlignmentType.notSet + factory AlignmentData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory AlignmentData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static const $core.Map<$core.int, AlignmentData_AlignmentType> + _AlignmentData_AlignmentTypeByTag = { + 1: AlignmentData_AlignmentType.predefined, + 2: AlignmentData_AlignmentType.xy, + 0: AlignmentData_AlignmentType.notSet }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AlignmentData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'AlignmentData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..oo(0, [1, 2]) - ..e(1, _omitFieldNames ? '' : 'predefined', $pb.PbFieldType.OE, defaultOrMaker: AlignmentData_PredefinedAlignment.PREDEFINED_ALIGNMENT_UNSPECIFIED, valueOf: AlignmentData_PredefinedAlignment.valueOf, enumValues: AlignmentData_PredefinedAlignment.values) - ..aOM(2, _omitFieldNames ? '' : 'xy', subBuilder: XYAlignment.create) - ..hasRequiredFields = false - ; + ..e( + 1, _omitFieldNames ? '' : 'predefined', $pb.PbFieldType.OE, + defaultOrMaker: + AlignmentData_PredefinedAlignment.PREDEFINED_ALIGNMENT_UNSPECIFIED, + valueOf: AlignmentData_PredefinedAlignment.valueOf, + enumValues: AlignmentData_PredefinedAlignment.values) + ..aOM(2, _omitFieldNames ? '' : 'xy', + subBuilder: XYAlignment.create) + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') AlignmentData clone() => AlignmentData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - AlignmentData copyWith(void Function(AlignmentData) updates) => super.copyWith((message) => updates(message as AlignmentData)) as AlignmentData; + AlignmentData copyWith(void Function(AlignmentData) updates) => + super.copyWith((message) => updates(message as AlignmentData)) + as AlignmentData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static AlignmentData create() => AlignmentData._(); AlignmentData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static AlignmentData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AlignmentData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static AlignmentData? _defaultInstance; - AlignmentData_AlignmentType whichAlignmentType() => _AlignmentData_AlignmentTypeByTag[$_whichOneof(0)]!; + AlignmentData_AlignmentType whichAlignmentType() => + _AlignmentData_AlignmentTypeByTag[$_whichOneof(0)]!; void clearAlignmentType() => $_clearField($_whichOneof(0)); @$pb.TagNumber(1) AlignmentData_PredefinedAlignment get predefined => $_getN(0); @$pb.TagNumber(1) - set predefined(AlignmentData_PredefinedAlignment v) { $_setField(1, v); } + set predefined(AlignmentData_PredefinedAlignment v) { + $_setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasPredefined() => $_has(0); @$pb.TagNumber(1) @@ -1391,7 +2770,10 @@ class AlignmentData extends $pb.GeneratedMessage { @$pb.TagNumber(2) XYAlignment get xy => $_getN(1); @$pb.TagNumber(2) - set xy(XYAlignment v) { $_setField(2, v); } + set xy(XYAlignment v) { + $_setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasXy() => $_has(1); @$pb.TagNumber(2) @@ -1415,19 +2797,27 @@ class XYAlignment extends $pb.GeneratedMessage { return $result; } XYAlignment._() : super(); - factory XYAlignment.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory XYAlignment.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'XYAlignment', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory XYAlignment.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory XYAlignment.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'XYAlignment', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..a<$core.double>(1, _omitFieldNames ? '' : 'x', $pb.PbFieldType.OD) ..a<$core.double>(2, _omitFieldNames ? '' : 'y', $pb.PbFieldType.OD) - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') XYAlignment clone() => XYAlignment()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - XYAlignment copyWith(void Function(XYAlignment) updates) => super.copyWith((message) => updates(message as XYAlignment)) as XYAlignment; + XYAlignment copyWith(void Function(XYAlignment) updates) => + super.copyWith((message) => updates(message as XYAlignment)) + as XYAlignment; $pb.BuilderInfo get info_ => _i; @@ -1436,13 +2826,17 @@ class XYAlignment extends $pb.GeneratedMessage { XYAlignment createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static XYAlignment getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static XYAlignment getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static XYAlignment? _defaultInstance; @$pb.TagNumber(1) $core.double get x => $_getN(0); @$pb.TagNumber(1) - set x($core.double v) { $_setDouble(0, v); } + set x($core.double v) { + $_setDouble(0, v); + } + @$pb.TagNumber(1) $core.bool hasX() => $_has(0); @$pb.TagNumber(1) @@ -1451,7 +2845,10 @@ class XYAlignment extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.double get y => $_getN(1); @$pb.TagNumber(2) - set y($core.double v) { $_setDouble(1, v); } + set y($core.double v) { + $_setDouble(1, v); + } + @$pb.TagNumber(2) $core.bool hasY() => $_has(1); @$pb.TagNumber(2) @@ -1506,42 +2903,67 @@ class DecorationImageData extends $pb.GeneratedMessage { return $result; } DecorationImageData._() : super(); - factory DecorationImageData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory DecorationImageData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'DecorationImageData', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory DecorationImageData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory DecorationImageData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'DecorationImageData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'src') - ..e(2, _omitFieldNames ? '' : 'fit', $pb.PbFieldType.OE, defaultOrMaker: BoxFitProto.BOX_FIT_UNSPECIFIED, valueOf: BoxFitProto.valueOf, enumValues: BoxFitProto.values) - ..aOM(3, _omitFieldNames ? '' : 'alignment', subBuilder: AlignmentData.create) - ..e(4, _omitFieldNames ? '' : 'repeat', $pb.PbFieldType.OE, defaultOrMaker: ImageRepeatProto.IMAGE_REPEAT_UNSPECIFIED, valueOf: ImageRepeatProto.valueOf, enumValues: ImageRepeatProto.values) + ..e(2, _omitFieldNames ? '' : 'fit', $pb.PbFieldType.OE, + defaultOrMaker: BoxFitProto.BOX_FIT_UNSPECIFIED, + valueOf: BoxFitProto.valueOf, + enumValues: BoxFitProto.values) + ..aOM(3, _omitFieldNames ? '' : 'alignment', + subBuilder: AlignmentData.create) + ..e( + 4, _omitFieldNames ? '' : 'repeat', $pb.PbFieldType.OE, + defaultOrMaker: ImageRepeatProto.IMAGE_REPEAT_UNSPECIFIED, + valueOf: ImageRepeatProto.valueOf, + enumValues: ImageRepeatProto.values) ..aOB(5, _omitFieldNames ? '' : 'matchTextDirection') ..a<$core.double>(6, _omitFieldNames ? '' : 'scale', $pb.PbFieldType.OD) ..a<$core.double>(7, _omitFieldNames ? '' : 'opacity', $pb.PbFieldType.OD) - ..e(8, _omitFieldNames ? '' : 'filterQuality', $pb.PbFieldType.OE, defaultOrMaker: FilterQualityProto.FILTER_QUALITY_UNSPECIFIED, valueOf: FilterQualityProto.valueOf, enumValues: FilterQualityProto.values) + ..e( + 8, _omitFieldNames ? '' : 'filterQuality', $pb.PbFieldType.OE, + defaultOrMaker: FilterQualityProto.FILTER_QUALITY_UNSPECIFIED, + valueOf: FilterQualityProto.valueOf, + enumValues: FilterQualityProto.values) ..aOB(9, _omitFieldNames ? '' : 'invertColors') ..aOB(10, _omitFieldNames ? '' : 'isAntiAlias') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') DecorationImageData clone() => DecorationImageData()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - DecorationImageData copyWith(void Function(DecorationImageData) updates) => super.copyWith((message) => updates(message as DecorationImageData)) as DecorationImageData; + DecorationImageData copyWith(void Function(DecorationImageData) updates) => + super.copyWith((message) => updates(message as DecorationImageData)) + as DecorationImageData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static DecorationImageData create() => DecorationImageData._(); DecorationImageData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static DecorationImageData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static DecorationImageData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static DecorationImageData? _defaultInstance; @$pb.TagNumber(1) $core.String get src => $_getSZ(0); @$pb.TagNumber(1) - set src($core.String v) { $_setString(0, v); } + set src($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasSrc() => $_has(0); @$pb.TagNumber(1) @@ -1550,7 +2972,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(2) BoxFitProto get fit => $_getN(1); @$pb.TagNumber(2) - set fit(BoxFitProto v) { $_setField(2, v); } + set fit(BoxFitProto v) { + $_setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasFit() => $_has(1); @$pb.TagNumber(2) @@ -1559,7 +2984,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(3) AlignmentData get alignment => $_getN(2); @$pb.TagNumber(3) - set alignment(AlignmentData v) { $_setField(3, v); } + set alignment(AlignmentData v) { + $_setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasAlignment() => $_has(2); @$pb.TagNumber(3) @@ -1570,7 +2998,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(4) ImageRepeatProto get repeat => $_getN(3); @$pb.TagNumber(4) - set repeat(ImageRepeatProto v) { $_setField(4, v); } + set repeat(ImageRepeatProto v) { + $_setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasRepeat() => $_has(3); @$pb.TagNumber(4) @@ -1579,7 +3010,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.bool get matchTextDirection => $_getBF(4); @$pb.TagNumber(5) - set matchTextDirection($core.bool v) { $_setBool(4, v); } + set matchTextDirection($core.bool v) { + $_setBool(4, v); + } + @$pb.TagNumber(5) $core.bool hasMatchTextDirection() => $_has(4); @$pb.TagNumber(5) @@ -1588,7 +3022,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(6) $core.double get scale => $_getN(5); @$pb.TagNumber(6) - set scale($core.double v) { $_setDouble(5, v); } + set scale($core.double v) { + $_setDouble(5, v); + } + @$pb.TagNumber(6) $core.bool hasScale() => $_has(5); @$pb.TagNumber(6) @@ -1597,7 +3034,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.double get opacity => $_getN(6); @$pb.TagNumber(7) - set opacity($core.double v) { $_setDouble(6, v); } + set opacity($core.double v) { + $_setDouble(6, v); + } + @$pb.TagNumber(7) $core.bool hasOpacity() => $_has(6); @$pb.TagNumber(7) @@ -1606,7 +3046,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(8) FilterQualityProto get filterQuality => $_getN(7); @$pb.TagNumber(8) - set filterQuality(FilterQualityProto v) { $_setField(8, v); } + set filterQuality(FilterQualityProto v) { + $_setField(8, v); + } + @$pb.TagNumber(8) $core.bool hasFilterQuality() => $_has(7); @$pb.TagNumber(8) @@ -1615,7 +3058,10 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(9) $core.bool get invertColors => $_getBF(8); @$pb.TagNumber(9) - set invertColors($core.bool v) { $_setBool(8, v); } + set invertColors($core.bool v) { + $_setBool(8, v); + } + @$pb.TagNumber(9) $core.bool hasInvertColors() => $_has(8); @$pb.TagNumber(9) @@ -1624,13 +3070,592 @@ class DecorationImageData extends $pb.GeneratedMessage { @$pb.TagNumber(10) $core.bool get isAntiAlias => $_getBF(9); @$pb.TagNumber(10) - set isAntiAlias($core.bool v) { $_setBool(9, v); } + set isAntiAlias($core.bool v) { + $_setBool(9, v); + } + @$pb.TagNumber(10) $core.bool hasIsAntiAlias() => $_has(9); @$pb.TagNumber(10) void clearIsAntiAlias() => $_clearField(10); } +/// New message for Box Constraints +class BoxConstraintsData extends $pb.GeneratedMessage { + factory BoxConstraintsData({ + $core.double? minWidth, + $core.double? maxWidth, + $core.double? minHeight, + $core.double? maxHeight, + }) { + final $result = create(); + if (minWidth != null) { + $result.minWidth = minWidth; + } + if (maxWidth != null) { + $result.maxWidth = maxWidth; + } + if (minHeight != null) { + $result.minHeight = minHeight; + } + if (maxHeight != null) { + $result.maxHeight = maxHeight; + } + return $result; + } + BoxConstraintsData._() : super(); + factory BoxConstraintsData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BoxConstraintsData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BoxConstraintsData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'minWidth', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'maxWidth', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'minHeight', $pb.PbFieldType.OD) + ..a<$core.double>(4, _omitFieldNames ? '' : 'maxHeight', $pb.PbFieldType.OD) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxConstraintsData clone() => BoxConstraintsData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + BoxConstraintsData copyWith(void Function(BoxConstraintsData) updates) => + super.copyWith((message) => updates(message as BoxConstraintsData)) + as BoxConstraintsData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static BoxConstraintsData create() => BoxConstraintsData._(); + BoxConstraintsData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static BoxConstraintsData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static BoxConstraintsData? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get minWidth => $_getN(0); + @$pb.TagNumber(1) + set minWidth($core.double v) { + $_setDouble(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasMinWidth() => $_has(0); + @$pb.TagNumber(1) + void clearMinWidth() => $_clearField(1); + + @$pb.TagNumber(2) + $core.double get maxWidth => $_getN(1); + @$pb.TagNumber(2) + set maxWidth($core.double v) { + $_setDouble(1, v); + } + + @$pb.TagNumber(2) + $core.bool hasMaxWidth() => $_has(1); + @$pb.TagNumber(2) + void clearMaxWidth() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get minHeight => $_getN(2); + @$pb.TagNumber(3) + set minHeight($core.double v) { + $_setDouble(2, v); + } + + @$pb.TagNumber(3) + $core.bool hasMinHeight() => $_has(2); + @$pb.TagNumber(3) + void clearMinHeight() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get maxHeight => $_getN(3); + @$pb.TagNumber(4) + set maxHeight($core.double v) { + $_setDouble(3, v); + } + + @$pb.TagNumber(4) + $core.bool hasMaxHeight() => $_has(3); + @$pb.TagNumber(4) + void clearMaxHeight() => $_clearField(4); +} + +/// New message for Transform +class TransformData extends $pb.GeneratedMessage { + factory TransformData({ + TransformData_TransformType? type, + $core.Iterable<$core.double>? matrixValues, + $core.double? translateX, + $core.double? translateY, + $core.double? translateZ, + $core.double? rotationAngle, + $core.double? rotationX, + $core.double? rotationY, + $core.double? rotationZ, + $core.double? scaleX, + $core.double? scaleY, + $core.double? scaleZ, + }) { + final $result = create(); + if (type != null) { + $result.type = type; + } + if (matrixValues != null) { + $result.matrixValues.addAll(matrixValues); + } + if (translateX != null) { + $result.translateX = translateX; + } + if (translateY != null) { + $result.translateY = translateY; + } + if (translateZ != null) { + $result.translateZ = translateZ; + } + if (rotationAngle != null) { + $result.rotationAngle = rotationAngle; + } + if (rotationX != null) { + $result.rotationX = rotationX; + } + if (rotationY != null) { + $result.rotationY = rotationY; + } + if (rotationZ != null) { + $result.rotationZ = rotationZ; + } + if (scaleX != null) { + $result.scaleX = scaleX; + } + if (scaleY != null) { + $result.scaleY = scaleY; + } + if (scaleZ != null) { + $result.scaleZ = scaleZ; + } + return $result; + } + TransformData._() : super(); + factory TransformData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory TransformData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'TransformData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..e( + 1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, + defaultOrMaker: TransformData_TransformType.TRANSFORM_TYPE_UNSPECIFIED, + valueOf: TransformData_TransformType.valueOf, + enumValues: TransformData_TransformType.values) + ..p<$core.double>( + 2, _omitFieldNames ? '' : 'matrixValues', $pb.PbFieldType.KD) + ..a<$core.double>( + 3, _omitFieldNames ? '' : 'translateX', $pb.PbFieldType.OD) + ..a<$core.double>( + 4, _omitFieldNames ? '' : 'translateY', $pb.PbFieldType.OD) + ..a<$core.double>( + 5, _omitFieldNames ? '' : 'translateZ', $pb.PbFieldType.OD) + ..a<$core.double>( + 6, _omitFieldNames ? '' : 'rotationAngle', $pb.PbFieldType.OD) + ..a<$core.double>(7, _omitFieldNames ? '' : 'rotationX', $pb.PbFieldType.OD) + ..a<$core.double>(8, _omitFieldNames ? '' : 'rotationY', $pb.PbFieldType.OD) + ..a<$core.double>(9, _omitFieldNames ? '' : 'rotationZ', $pb.PbFieldType.OD) + ..a<$core.double>(10, _omitFieldNames ? '' : 'scaleX', $pb.PbFieldType.OD) + ..a<$core.double>(11, _omitFieldNames ? '' : 'scaleY', $pb.PbFieldType.OD) + ..a<$core.double>(12, _omitFieldNames ? '' : 'scaleZ', $pb.PbFieldType.OD) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TransformData clone() => TransformData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TransformData copyWith(void Function(TransformData) updates) => + super.copyWith((message) => updates(message as TransformData)) + as TransformData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static TransformData create() => TransformData._(); + TransformData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static TransformData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static TransformData? _defaultInstance; + + @$pb.TagNumber(1) + TransformData_TransformType get type => $_getN(0); + @$pb.TagNumber(1) + set type(TransformData_TransformType v) { + $_setField(1, v); + } + + @$pb.TagNumber(1) + $core.bool hasType() => $_has(0); + @$pb.TagNumber(1) + void clearType() => $_clearField(1); + + /// Matrix 4x4 (row-major order) + @$pb.TagNumber(2) + $pb.PbList<$core.double> get matrixValues => $_getList(1); + + /// Translation + @$pb.TagNumber(3) + $core.double get translateX => $_getN(2); + @$pb.TagNumber(3) + set translateX($core.double v) { + $_setDouble(2, v); + } + + @$pb.TagNumber(3) + $core.bool hasTranslateX() => $_has(2); + @$pb.TagNumber(3) + void clearTranslateX() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get translateY => $_getN(3); + @$pb.TagNumber(4) + set translateY($core.double v) { + $_setDouble(3, v); + } + + @$pb.TagNumber(4) + $core.bool hasTranslateY() => $_has(3); + @$pb.TagNumber(4) + void clearTranslateY() => $_clearField(4); + + @$pb.TagNumber(5) + $core.double get translateZ => $_getN(4); + @$pb.TagNumber(5) + set translateZ($core.double v) { + $_setDouble(4, v); + } + + @$pb.TagNumber(5) + $core.bool hasTranslateZ() => $_has(4); + @$pb.TagNumber(5) + void clearTranslateZ() => $_clearField(5); + + /// Rotation + @$pb.TagNumber(6) + $core.double get rotationAngle => $_getN(5); + @$pb.TagNumber(6) + set rotationAngle($core.double v) { + $_setDouble(5, v); + } + + @$pb.TagNumber(6) + $core.bool hasRotationAngle() => $_has(5); + @$pb.TagNumber(6) + void clearRotationAngle() => $_clearField(6); + + @$pb.TagNumber(7) + $core.double get rotationX => $_getN(6); + @$pb.TagNumber(7) + set rotationX($core.double v) { + $_setDouble(6, v); + } + + @$pb.TagNumber(7) + $core.bool hasRotationX() => $_has(6); + @$pb.TagNumber(7) + void clearRotationX() => $_clearField(7); + + @$pb.TagNumber(8) + $core.double get rotationY => $_getN(7); + @$pb.TagNumber(8) + set rotationY($core.double v) { + $_setDouble(7, v); + } + + @$pb.TagNumber(8) + $core.bool hasRotationY() => $_has(7); + @$pb.TagNumber(8) + void clearRotationY() => $_clearField(8); + + @$pb.TagNumber(9) + $core.double get rotationZ => $_getN(8); + @$pb.TagNumber(9) + set rotationZ($core.double v) { + $_setDouble(8, v); + } + + @$pb.TagNumber(9) + $core.bool hasRotationZ() => $_has(8); + @$pb.TagNumber(9) + void clearRotationZ() => $_clearField(9); + + /// Scale + @$pb.TagNumber(10) + $core.double get scaleX => $_getN(9); + @$pb.TagNumber(10) + set scaleX($core.double v) { + $_setDouble(9, v); + } + + @$pb.TagNumber(10) + $core.bool hasScaleX() => $_has(9); + @$pb.TagNumber(10) + void clearScaleX() => $_clearField(10); + + @$pb.TagNumber(11) + $core.double get scaleY => $_getN(10); + @$pb.TagNumber(11) + set scaleY($core.double v) { + $_setDouble(10, v); + } + + @$pb.TagNumber(11) + $core.bool hasScaleY() => $_has(10); + @$pb.TagNumber(11) + void clearScaleY() => $_clearField(11); + + @$pb.TagNumber(12) + $core.double get scaleZ => $_getN(11); + @$pb.TagNumber(12) + set scaleZ($core.double v) { + $_setDouble(11, v); + } + + @$pb.TagNumber(12) + $core.bool hasScaleZ() => $_has(11); + @$pb.TagNumber(12) + void clearScaleZ() => $_clearField(12); +} + +/// New message for Rectangle data +class RectData extends $pb.GeneratedMessage { + factory RectData({ + $core.double? left, + $core.double? top, + $core.double? right, + $core.double? bottom, + }) { + final $result = create(); + if (left != null) { + $result.left = left; + } + if (top != null) { + $result.top = top; + } + if (right != null) { + $result.right = right; + } + if (bottom != null) { + $result.bottom = bottom; + } + return $result; + } + RectData._() : super(); + factory RectData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RectData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RectData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'left', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'top', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'right', $pb.PbFieldType.OD) + ..a<$core.double>(4, _omitFieldNames ? '' : 'bottom', $pb.PbFieldType.OD) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + RectData clone() => RectData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + RectData copyWith(void Function(RectData) updates) => + super.copyWith((message) => updates(message as RectData)) as RectData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static RectData create() => RectData._(); + RectData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RectData getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RectData? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get left => $_getN(0); + @$pb.TagNumber(1) + set left($core.double v) { + $_setDouble(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasLeft() => $_has(0); + @$pb.TagNumber(1) + void clearLeft() => $_clearField(1); + + @$pb.TagNumber(2) + $core.double get top => $_getN(1); + @$pb.TagNumber(2) + set top($core.double v) { + $_setDouble(1, v); + } + + @$pb.TagNumber(2) + $core.bool hasTop() => $_has(1); + @$pb.TagNumber(2) + void clearTop() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get right => $_getN(2); + @$pb.TagNumber(3) + set right($core.double v) { + $_setDouble(2, v); + } + + @$pb.TagNumber(3) + $core.bool hasRight() => $_has(2); + @$pb.TagNumber(3) + void clearRight() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get bottom => $_getN(3); + @$pb.TagNumber(4) + set bottom($core.double v) { + $_setDouble(3, v); + } + + @$pb.TagNumber(4) + $core.bool hasBottom() => $_has(3); + @$pb.TagNumber(4) + void clearBottom() => $_clearField(4); +} + +/// New message for Shadow +class ShadowData extends $pb.GeneratedMessage { + factory ShadowData({ + ColorData? color, + $core.double? offsetX, + $core.double? offsetY, + $core.double? blurRadius, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (offsetX != null) { + $result.offsetX = offsetX; + } + if (offsetY != null) { + $result.offsetY = offsetY; + } + if (blurRadius != null) { + $result.blurRadius = blurRadius; + } + return $result; + } + ShadowData._() : super(); + factory ShadowData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ShadowData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ShadowData', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'color', + subBuilder: ColorData.create) + ..a<$core.double>(2, _omitFieldNames ? '' : 'offsetX', $pb.PbFieldType.OD) + ..a<$core.double>(3, _omitFieldNames ? '' : 'offsetY', $pb.PbFieldType.OD) + ..a<$core.double>( + 4, _omitFieldNames ? '' : 'blurRadius', $pb.PbFieldType.OD) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ShadowData clone() => ShadowData()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ShadowData copyWith(void Function(ShadowData) updates) => + super.copyWith((message) => updates(message as ShadowData)) as ShadowData; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ShadowData create() => ShadowData._(); + ShadowData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ShadowData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ShadowData? _defaultInstance; + + @$pb.TagNumber(1) + ColorData get color => $_getN(0); + @$pb.TagNumber(1) + set color(ColorData v) { + $_setField(1, v); + } + + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => $_clearField(1); + @$pb.TagNumber(1) + ColorData ensureColor() => $_ensure(0); + + @$pb.TagNumber(2) + $core.double get offsetX => $_getN(1); + @$pb.TagNumber(2) + set offsetX($core.double v) { + $_setDouble(1, v); + } + + @$pb.TagNumber(2) + $core.bool hasOffsetX() => $_has(1); + @$pb.TagNumber(2) + void clearOffsetX() => $_clearField(2); + + @$pb.TagNumber(3) + $core.double get offsetY => $_getN(2); + @$pb.TagNumber(3) + set offsetY($core.double v) { + $_setDouble(2, v); + } + + @$pb.TagNumber(3) + $core.bool hasOffsetY() => $_has(2); + @$pb.TagNumber(3) + void clearOffsetY() => $_clearField(3); + + @$pb.TagNumber(4) + $core.double get blurRadius => $_getN(3); + @$pb.TagNumber(4) + set blurRadius($core.double v) { + $_setDouble(3, v); + } + + @$pb.TagNumber(4) + $core.bool hasBlurRadius() => $_has(3); + @$pb.TagNumber(4) + void clearBlurRadius() => $_clearField(4); +} + class SduiRequest extends $pb.GeneratedMessage { factory SduiRequest({ $core.String? screenId, @@ -1642,18 +3667,26 @@ class SduiRequest extends $pb.GeneratedMessage { return $result; } SduiRequest._() : super(); - factory SduiRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SduiRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SduiRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), createEmptyInstance: create) + factory SduiRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory SduiRequest.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'SduiRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'flutter_sdui'), + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'screenId') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') SduiRequest clone() => SduiRequest()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - SduiRequest copyWith(void Function(SduiRequest) updates) => super.copyWith((message) => updates(message as SduiRequest)) as SduiRequest; + SduiRequest copyWith(void Function(SduiRequest) updates) => + super.copyWith((message) => updates(message as SduiRequest)) + as SduiRequest; $pb.BuilderInfo get info_ => _i; @@ -1662,19 +3695,23 @@ class SduiRequest extends $pb.GeneratedMessage { SduiRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static SduiRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SduiRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static SduiRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get screenId => $_getSZ(0); @$pb.TagNumber(1) - set screenId($core.String v) { $_setString(0, v); } + set screenId($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasScreenId() => $_has(0); @$pb.TagNumber(1) void clearScreenId() => $_clearField(1); } - const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/src/generated/sdui.pbenum.dart b/lib/src/generated/sdui.pbenum.dart index 5cb6cab..cd5fe13 100644 --- a/lib/src/generated/sdui.pbenum.dart +++ b/lib/src/generated/sdui.pbenum.dart @@ -15,18 +15,25 @@ import 'package:protobuf/protobuf.dart' as $pb; /// Enum for Widget Types class WidgetType extends $pb.ProtobufEnum { - static const WidgetType WIDGET_TYPE_UNSPECIFIED = WidgetType._(0, _omitEnumNames ? '' : 'WIDGET_TYPE_UNSPECIFIED'); - static const WidgetType COLUMN = WidgetType._(1, _omitEnumNames ? '' : 'COLUMN'); + static const WidgetType WIDGET_TYPE_UNSPECIFIED = + WidgetType._(0, _omitEnumNames ? '' : 'WIDGET_TYPE_UNSPECIFIED'); + static const WidgetType COLUMN = + WidgetType._(1, _omitEnumNames ? '' : 'COLUMN'); static const WidgetType ROW = WidgetType._(2, _omitEnumNames ? '' : 'ROW'); static const WidgetType TEXT = WidgetType._(3, _omitEnumNames ? '' : 'TEXT'); - static const WidgetType IMAGE = WidgetType._(4, _omitEnumNames ? '' : 'IMAGE'); - static const WidgetType SIZED_BOX = WidgetType._(5, _omitEnumNames ? '' : 'SIZED_BOX'); - static const WidgetType CONTAINER = WidgetType._(6, _omitEnumNames ? '' : 'CONTAINER'); - static const WidgetType SCAFFOLD = WidgetType._(7, _omitEnumNames ? '' : 'SCAFFOLD'); - static const WidgetType SPACER = WidgetType._(8, _omitEnumNames ? '' : 'SPACER'); + static const WidgetType IMAGE = + WidgetType._(4, _omitEnumNames ? '' : 'IMAGE'); + static const WidgetType SIZED_BOX = + WidgetType._(5, _omitEnumNames ? '' : 'SIZED_BOX'); + static const WidgetType CONTAINER = + WidgetType._(6, _omitEnumNames ? '' : 'CONTAINER'); + static const WidgetType SCAFFOLD = + WidgetType._(7, _omitEnumNames ? '' : 'SCAFFOLD'); + static const WidgetType SPACER = + WidgetType._(8, _omitEnumNames ? '' : 'SPACER'); static const WidgetType ICON = WidgetType._(9, _omitEnumNames ? '' : 'ICON'); - static const $core.List values = [ + static const $core.List values = [ WIDGET_TYPE_UNSPECIFIED, COLUMN, ROW, @@ -39,85 +46,112 @@ class WidgetType extends $pb.ProtobufEnum { ICON, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 9); - static WidgetType? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 9); + static WidgetType? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const WidgetType._(super.v, super.n); } /// Message for BoxFit class BoxFitProto extends $pb.ProtobufEnum { - static const BoxFitProto BOX_FIT_UNSPECIFIED = BoxFitProto._(0, _omitEnumNames ? '' : 'BOX_FIT_UNSPECIFIED'); - static const BoxFitProto FILL = BoxFitProto._(1, _omitEnumNames ? '' : 'FILL'); - static const BoxFitProto CONTAIN = BoxFitProto._(2, _omitEnumNames ? '' : 'CONTAIN'); - static const BoxFitProto COVER = BoxFitProto._(3, _omitEnumNames ? '' : 'COVER'); - static const BoxFitProto FIT_WIDTH = BoxFitProto._(4, _omitEnumNames ? '' : 'FIT_WIDTH'); - static const BoxFitProto FIT_HEIGHT = BoxFitProto._(5, _omitEnumNames ? '' : 'FIT_HEIGHT'); - static const BoxFitProto NONE = BoxFitProto._(6, _omitEnumNames ? '' : 'NONE'); - static const BoxFitProto SCALE_DOWN = BoxFitProto._(7, _omitEnumNames ? '' : 'SCALE_DOWN'); - - static const $core.List values = [ + static const BoxFitProto BOX_FIT_UNSPECIFIED = + BoxFitProto._(0, _omitEnumNames ? '' : 'BOX_FIT_UNSPECIFIED'); + static const BoxFitProto FILL = + BoxFitProto._(1, _omitEnumNames ? '' : 'FILL'); + static const BoxFitProto CONTAIN = + BoxFitProto._(2, _omitEnumNames ? '' : 'CONTAIN'); + static const BoxFitProto COVER = + BoxFitProto._(3, _omitEnumNames ? '' : 'COVER'); + static const BoxFitProto FIT_WIDTH = + BoxFitProto._(4, _omitEnumNames ? '' : 'FIT_WIDTH'); + static const BoxFitProto FIT_HEIGHT = + BoxFitProto._(5, _omitEnumNames ? '' : 'FIT_HEIGHT'); + static const BoxFitProto NONE_BOX_FIT = + BoxFitProto._(6, _omitEnumNames ? '' : 'NONE_BOX_FIT'); + static const BoxFitProto SCALE_DOWN = + BoxFitProto._(7, _omitEnumNames ? '' : 'SCALE_DOWN'); + + static const $core.List values = [ BOX_FIT_UNSPECIFIED, FILL, CONTAIN, COVER, FIT_WIDTH, FIT_HEIGHT, - NONE, + NONE_BOX_FIT, SCALE_DOWN, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 7); - static BoxFitProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 7); + static BoxFitProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const BoxFitProto._(super.v, super.n); } /// Enum for BorderStyle class BorderStyleProto extends $pb.ProtobufEnum { - static const BorderStyleProto BORDER_STYLE_UNSPECIFIED = BorderStyleProto._(0, _omitEnumNames ? '' : 'BORDER_STYLE_UNSPECIFIED'); - static const BorderStyleProto SOLID = BorderStyleProto._(1, _omitEnumNames ? '' : 'SOLID'); - static const BorderStyleProto NONE_BORDER = BorderStyleProto._(2, _omitEnumNames ? '' : 'NONE_BORDER'); - - static const $core.List values = [ + static const BorderStyleProto BORDER_STYLE_UNSPECIFIED = + BorderStyleProto._(0, _omitEnumNames ? '' : 'BORDER_STYLE_UNSPECIFIED'); + static const BorderStyleProto SOLID = + BorderStyleProto._(1, _omitEnumNames ? '' : 'SOLID'); + static const BorderStyleProto NONE_BORDER = + BorderStyleProto._(2, _omitEnumNames ? '' : 'NONE_BORDER'); + + static const $core.List values = [ BORDER_STYLE_UNSPECIFIED, SOLID, NONE_BORDER, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 2); - static BorderStyleProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static BorderStyleProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const BorderStyleProto._(super.v, super.n); } /// Enum for BoxShape class BoxShapeProto extends $pb.ProtobufEnum { - static const BoxShapeProto BOX_SHAPE_UNSPECIFIED = BoxShapeProto._(0, _omitEnumNames ? '' : 'BOX_SHAPE_UNSPECIFIED'); - static const BoxShapeProto RECTANGLE = BoxShapeProto._(1, _omitEnumNames ? '' : 'RECTANGLE'); - static const BoxShapeProto CIRCLE = BoxShapeProto._(2, _omitEnumNames ? '' : 'CIRCLE'); - - static const $core.List values = [ + static const BoxShapeProto BOX_SHAPE_UNSPECIFIED = + BoxShapeProto._(0, _omitEnumNames ? '' : 'BOX_SHAPE_UNSPECIFIED'); + static const BoxShapeProto RECTANGLE = + BoxShapeProto._(1, _omitEnumNames ? '' : 'RECTANGLE'); + static const BoxShapeProto CIRCLE = + BoxShapeProto._(2, _omitEnumNames ? '' : 'CIRCLE'); + + static const $core.List values = [ BOX_SHAPE_UNSPECIFIED, RECTANGLE, CIRCLE, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 2); - static BoxShapeProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static BoxShapeProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const BoxShapeProto._(super.v, super.n); } /// Enum for ImageRepeat class ImageRepeatProto extends $pb.ProtobufEnum { - static const ImageRepeatProto IMAGE_REPEAT_UNSPECIFIED = ImageRepeatProto._(0, _omitEnumNames ? '' : 'IMAGE_REPEAT_UNSPECIFIED'); - static const ImageRepeatProto REPEAT = ImageRepeatProto._(1, _omitEnumNames ? '' : 'REPEAT'); - static const ImageRepeatProto REPEAT_X = ImageRepeatProto._(2, _omitEnumNames ? '' : 'REPEAT_X'); - static const ImageRepeatProto REPEAT_Y = ImageRepeatProto._(3, _omitEnumNames ? '' : 'REPEAT_Y'); - static const ImageRepeatProto NO_REPEAT = ImageRepeatProto._(4, _omitEnumNames ? '' : 'NO_REPEAT'); - - static const $core.List values = [ + static const ImageRepeatProto IMAGE_REPEAT_UNSPECIFIED = + ImageRepeatProto._(0, _omitEnumNames ? '' : 'IMAGE_REPEAT_UNSPECIFIED'); + static const ImageRepeatProto REPEAT = + ImageRepeatProto._(1, _omitEnumNames ? '' : 'REPEAT'); + static const ImageRepeatProto REPEAT_X = + ImageRepeatProto._(2, _omitEnumNames ? '' : 'REPEAT_X'); + static const ImageRepeatProto REPEAT_Y = + ImageRepeatProto._(3, _omitEnumNames ? '' : 'REPEAT_Y'); + static const ImageRepeatProto NO_REPEAT = + ImageRepeatProto._(4, _omitEnumNames ? '' : 'NO_REPEAT'); + + static const $core.List values = [ IMAGE_REPEAT_UNSPECIFIED, REPEAT, REPEAT_X, @@ -125,21 +159,29 @@ class ImageRepeatProto extends $pb.ProtobufEnum { NO_REPEAT, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 4); - static ImageRepeatProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static ImageRepeatProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const ImageRepeatProto._(super.v, super.n); } /// Enum for FilterQuality class FilterQualityProto extends $pb.ProtobufEnum { - static const FilterQualityProto FILTER_QUALITY_UNSPECIFIED = FilterQualityProto._(0, _omitEnumNames ? '' : 'FILTER_QUALITY_UNSPECIFIED'); - static const FilterQualityProto NONE_FQ = FilterQualityProto._(1, _omitEnumNames ? '' : 'NONE_FQ'); - static const FilterQualityProto LOW = FilterQualityProto._(2, _omitEnumNames ? '' : 'LOW'); - static const FilterQualityProto MEDIUM = FilterQualityProto._(3, _omitEnumNames ? '' : 'MEDIUM'); - static const FilterQualityProto HIGH = FilterQualityProto._(4, _omitEnumNames ? '' : 'HIGH'); - - static const $core.List values = [ + static const FilterQualityProto FILTER_QUALITY_UNSPECIFIED = + FilterQualityProto._( + 0, _omitEnumNames ? '' : 'FILTER_QUALITY_UNSPECIFIED'); + static const FilterQualityProto NONE_FQ = + FilterQualityProto._(1, _omitEnumNames ? '' : 'NONE_FQ'); + static const FilterQualityProto LOW = + FilterQualityProto._(2, _omitEnumNames ? '' : 'LOW'); + static const FilterQualityProto MEDIUM = + FilterQualityProto._(3, _omitEnumNames ? '' : 'MEDIUM'); + static const FilterQualityProto HIGH = + FilterQualityProto._(4, _omitEnumNames ? '' : 'HIGH'); + + static const $core.List values = [ FILTER_QUALITY_UNSPECIFIED, NONE_FQ, LOW, @@ -147,50 +189,565 @@ class FilterQualityProto extends $pb.ProtobufEnum { HIGH, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 4); - static FilterQualityProto? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static FilterQualityProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const FilterQualityProto._(super.v, super.n); } -class GradientData_GradientType extends $pb.ProtobufEnum { - static const GradientData_GradientType GRADIENT_TYPE_UNSPECIFIED = GradientData_GradientType._(0, _omitEnumNames ? '' : 'GRADIENT_TYPE_UNSPECIFIED'); - static const GradientData_GradientType LINEAR = GradientData_GradientType._(1, _omitEnumNames ? '' : 'LINEAR'); - static const GradientData_GradientType RADIAL = GradientData_GradientType._(2, _omitEnumNames ? '' : 'RADIAL'); - static const GradientData_GradientType SWEEP = GradientData_GradientType._(3, _omitEnumNames ? '' : 'SWEEP'); +/// New enums for Row and Column properties +class MainAxisAlignmentProto extends $pb.ProtobufEnum { + static const MainAxisAlignmentProto MAIN_AXIS_ALIGNMENT_UNSPECIFIED = + MainAxisAlignmentProto._( + 0, _omitEnumNames ? '' : 'MAIN_AXIS_ALIGNMENT_UNSPECIFIED'); + static const MainAxisAlignmentProto MAIN_AXIS_START = + MainAxisAlignmentProto._(1, _omitEnumNames ? '' : 'MAIN_AXIS_START'); + static const MainAxisAlignmentProto MAIN_AXIS_END = + MainAxisAlignmentProto._(2, _omitEnumNames ? '' : 'MAIN_AXIS_END'); + static const MainAxisAlignmentProto MAIN_AXIS_CENTER = + MainAxisAlignmentProto._(3, _omitEnumNames ? '' : 'MAIN_AXIS_CENTER'); + static const MainAxisAlignmentProto SPACE_BETWEEN = + MainAxisAlignmentProto._(4, _omitEnumNames ? '' : 'SPACE_BETWEEN'); + static const MainAxisAlignmentProto SPACE_AROUND = + MainAxisAlignmentProto._(5, _omitEnumNames ? '' : 'SPACE_AROUND'); + static const MainAxisAlignmentProto SPACE_EVENLY = + MainAxisAlignmentProto._(6, _omitEnumNames ? '' : 'SPACE_EVENLY'); + + static const $core.List values = + [ + MAIN_AXIS_ALIGNMENT_UNSPECIFIED, + MAIN_AXIS_START, + MAIN_AXIS_END, + MAIN_AXIS_CENTER, + SPACE_BETWEEN, + SPACE_AROUND, + SPACE_EVENLY, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 6); + static MainAxisAlignmentProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const MainAxisAlignmentProto._(super.v, super.n); +} + +class CrossAxisAlignmentProto extends $pb.ProtobufEnum { + static const CrossAxisAlignmentProto CROSS_AXIS_ALIGNMENT_UNSPECIFIED = + CrossAxisAlignmentProto._( + 0, _omitEnumNames ? '' : 'CROSS_AXIS_ALIGNMENT_UNSPECIFIED'); + static const CrossAxisAlignmentProto CROSS_AXIS_START = + CrossAxisAlignmentProto._(1, _omitEnumNames ? '' : 'CROSS_AXIS_START'); + static const CrossAxisAlignmentProto CROSS_AXIS_END = + CrossAxisAlignmentProto._(2, _omitEnumNames ? '' : 'CROSS_AXIS_END'); + static const CrossAxisAlignmentProto CROSS_AXIS_CENTER = + CrossAxisAlignmentProto._(3, _omitEnumNames ? '' : 'CROSS_AXIS_CENTER'); + static const CrossAxisAlignmentProto STRETCH = + CrossAxisAlignmentProto._(4, _omitEnumNames ? '' : 'STRETCH'); + static const CrossAxisAlignmentProto BASELINE = + CrossAxisAlignmentProto._(5, _omitEnumNames ? '' : 'BASELINE'); + + static const $core.List values = + [ + CROSS_AXIS_ALIGNMENT_UNSPECIFIED, + CROSS_AXIS_START, + CROSS_AXIS_END, + CROSS_AXIS_CENTER, + STRETCH, + BASELINE, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 5); + static CrossAxisAlignmentProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const CrossAxisAlignmentProto._(super.v, super.n); +} + +class MainAxisSizeProto extends $pb.ProtobufEnum { + static const MainAxisSizeProto MAIN_AXIS_SIZE_UNSPECIFIED = + MainAxisSizeProto._( + 0, _omitEnumNames ? '' : 'MAIN_AXIS_SIZE_UNSPECIFIED'); + static const MainAxisSizeProto MIN = + MainAxisSizeProto._(1, _omitEnumNames ? '' : 'MIN'); + static const MainAxisSizeProto MAX = + MainAxisSizeProto._(2, _omitEnumNames ? '' : 'MAX'); + + static const $core.List values = [ + MAIN_AXIS_SIZE_UNSPECIFIED, + MIN, + MAX, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static MainAxisSizeProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const MainAxisSizeProto._(super.v, super.n); +} + +class TextDirectionProto extends $pb.ProtobufEnum { + static const TextDirectionProto TEXT_DIRECTION_UNSPECIFIED = + TextDirectionProto._( + 0, _omitEnumNames ? '' : 'TEXT_DIRECTION_UNSPECIFIED'); + static const TextDirectionProto LTR = + TextDirectionProto._(1, _omitEnumNames ? '' : 'LTR'); + static const TextDirectionProto RTL = + TextDirectionProto._(2, _omitEnumNames ? '' : 'RTL'); + + static const $core.List values = [ + TEXT_DIRECTION_UNSPECIFIED, + LTR, + RTL, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static TextDirectionProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TextDirectionProto._(super.v, super.n); +} + +class VerticalDirectionProto extends $pb.ProtobufEnum { + static const VerticalDirectionProto VERTICAL_DIRECTION_UNSPECIFIED = + VerticalDirectionProto._( + 0, _omitEnumNames ? '' : 'VERTICAL_DIRECTION_UNSPECIFIED'); + static const VerticalDirectionProto UP = + VerticalDirectionProto._(1, _omitEnumNames ? '' : 'UP'); + static const VerticalDirectionProto DOWN = + VerticalDirectionProto._(2, _omitEnumNames ? '' : 'DOWN'); + + static const $core.List values = + [ + VERTICAL_DIRECTION_UNSPECIFIED, + UP, + DOWN, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static VerticalDirectionProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const VerticalDirectionProto._(super.v, super.n); +} + +class TextBaselineProto extends $pb.ProtobufEnum { + static const TextBaselineProto TEXT_BASELINE_UNSPECIFIED = + TextBaselineProto._(0, _omitEnumNames ? '' : 'TEXT_BASELINE_UNSPECIFIED'); + static const TextBaselineProto ALPHABETIC = + TextBaselineProto._(1, _omitEnumNames ? '' : 'ALPHABETIC'); + static const TextBaselineProto IDEOGRAPHIC = + TextBaselineProto._(2, _omitEnumNames ? '' : 'IDEOGRAPHIC'); + + static const $core.List values = [ + TEXT_BASELINE_UNSPECIFIED, + ALPHABETIC, + IDEOGRAPHIC, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static TextBaselineProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TextBaselineProto._(super.v, super.n); +} + +/// New enum for Clip behavior +class ClipProto extends $pb.ProtobufEnum { + static const ClipProto CLIP_UNSPECIFIED = + ClipProto._(0, _omitEnumNames ? '' : 'CLIP_UNSPECIFIED'); + static const ClipProto CLIP_NONE = + ClipProto._(1, _omitEnumNames ? '' : 'CLIP_NONE'); + static const ClipProto HARD_EDGE = + ClipProto._(2, _omitEnumNames ? '' : 'HARD_EDGE'); + static const ClipProto ANTI_ALIAS = + ClipProto._(3, _omitEnumNames ? '' : 'ANTI_ALIAS'); + static const ClipProto ANTI_ALIAS_WITH_SAVE_LAYER = + ClipProto._(4, _omitEnumNames ? '' : 'ANTI_ALIAS_WITH_SAVE_LAYER'); + + static const $core.List values = [ + CLIP_UNSPECIFIED, + CLIP_NONE, + HARD_EDGE, + ANTI_ALIAS, + ANTI_ALIAS_WITH_SAVE_LAYER, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static ClipProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; - static const $core.List values = [ + const ClipProto._(super.v, super.n); +} + +/// New enums for Text properties +class TextAlignProto extends $pb.ProtobufEnum { + static const TextAlignProto TEXT_ALIGN_UNSPECIFIED = + TextAlignProto._(0, _omitEnumNames ? '' : 'TEXT_ALIGN_UNSPECIFIED'); + static const TextAlignProto LEFT = + TextAlignProto._(1, _omitEnumNames ? '' : 'LEFT'); + static const TextAlignProto RIGHT = + TextAlignProto._(2, _omitEnumNames ? '' : 'RIGHT'); + static const TextAlignProto TEXT_ALIGN_CENTER = + TextAlignProto._(3, _omitEnumNames ? '' : 'TEXT_ALIGN_CENTER'); + static const TextAlignProto JUSTIFY = + TextAlignProto._(4, _omitEnumNames ? '' : 'JUSTIFY'); + static const TextAlignProto TEXT_ALIGN_START = + TextAlignProto._(5, _omitEnumNames ? '' : 'TEXT_ALIGN_START'); + static const TextAlignProto TEXT_ALIGN_END = + TextAlignProto._(6, _omitEnumNames ? '' : 'TEXT_ALIGN_END'); + + static const $core.List values = [ + TEXT_ALIGN_UNSPECIFIED, + LEFT, + RIGHT, + TEXT_ALIGN_CENTER, + JUSTIFY, + TEXT_ALIGN_START, + TEXT_ALIGN_END, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 6); + static TextAlignProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TextAlignProto._(super.v, super.n); +} + +class TextOverflowProto extends $pb.ProtobufEnum { + static const TextOverflowProto TEXT_OVERFLOW_UNSPECIFIED = + TextOverflowProto._(0, _omitEnumNames ? '' : 'TEXT_OVERFLOW_UNSPECIFIED'); + static const TextOverflowProto CLIP = + TextOverflowProto._(1, _omitEnumNames ? '' : 'CLIP'); + static const TextOverflowProto ELLIPSIS = + TextOverflowProto._(2, _omitEnumNames ? '' : 'ELLIPSIS'); + static const TextOverflowProto FADE = + TextOverflowProto._(3, _omitEnumNames ? '' : 'FADE'); + static const TextOverflowProto VISIBLE = + TextOverflowProto._(4, _omitEnumNames ? '' : 'VISIBLE'); + + static const $core.List values = [ + TEXT_OVERFLOW_UNSPECIFIED, + CLIP, + ELLIPSIS, + FADE, + VISIBLE, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static TextOverflowProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TextOverflowProto._(super.v, super.n); +} + +class TextDecorationProto extends $pb.ProtobufEnum { + static const TextDecorationProto TEXT_DECORATION_UNSPECIFIED = + TextDecorationProto._( + 0, _omitEnumNames ? '' : 'TEXT_DECORATION_UNSPECIFIED'); + static const TextDecorationProto TEXT_DECORATION_NONE = + TextDecorationProto._(1, _omitEnumNames ? '' : 'TEXT_DECORATION_NONE'); + static const TextDecorationProto UNDERLINE = + TextDecorationProto._(2, _omitEnumNames ? '' : 'UNDERLINE'); + static const TextDecorationProto OVERLINE = + TextDecorationProto._(3, _omitEnumNames ? '' : 'OVERLINE'); + static const TextDecorationProto LINE_THROUGH = + TextDecorationProto._(4, _omitEnumNames ? '' : 'LINE_THROUGH'); + + static const $core.List values = [ + TEXT_DECORATION_UNSPECIFIED, + TEXT_DECORATION_NONE, + UNDERLINE, + OVERLINE, + LINE_THROUGH, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static TextDecorationProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TextDecorationProto._(super.v, super.n); +} + +class FontStyleProto extends $pb.ProtobufEnum { + static const FontStyleProto FONT_STYLE_UNSPECIFIED = + FontStyleProto._(0, _omitEnumNames ? '' : 'FONT_STYLE_UNSPECIFIED'); + static const FontStyleProto NORMAL = + FontStyleProto._(1, _omitEnumNames ? '' : 'NORMAL'); + static const FontStyleProto ITALIC = + FontStyleProto._(2, _omitEnumNames ? '' : 'ITALIC'); + + static const $core.List values = [ + FONT_STYLE_UNSPECIFIED, + NORMAL, + ITALIC, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 2); + static FontStyleProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const FontStyleProto._(super.v, super.n); +} + +/// New enum for Blend modes +class BlendModeProto extends $pb.ProtobufEnum { + static const BlendModeProto BLEND_MODE_UNSPECIFIED = + BlendModeProto._(0, _omitEnumNames ? '' : 'BLEND_MODE_UNSPECIFIED'); + static const BlendModeProto CLEAR = + BlendModeProto._(1, _omitEnumNames ? '' : 'CLEAR'); + static const BlendModeProto SRC = + BlendModeProto._(2, _omitEnumNames ? '' : 'SRC'); + static const BlendModeProto DST = + BlendModeProto._(3, _omitEnumNames ? '' : 'DST'); + static const BlendModeProto SRC_OVER = + BlendModeProto._(4, _omitEnumNames ? '' : 'SRC_OVER'); + static const BlendModeProto DST_OVER = + BlendModeProto._(5, _omitEnumNames ? '' : 'DST_OVER'); + static const BlendModeProto SRC_IN = + BlendModeProto._(6, _omitEnumNames ? '' : 'SRC_IN'); + static const BlendModeProto DST_IN = + BlendModeProto._(7, _omitEnumNames ? '' : 'DST_IN'); + static const BlendModeProto SRC_OUT = + BlendModeProto._(8, _omitEnumNames ? '' : 'SRC_OUT'); + static const BlendModeProto DST_OUT = + BlendModeProto._(9, _omitEnumNames ? '' : 'DST_OUT'); + static const BlendModeProto SRC_ATOP = + BlendModeProto._(10, _omitEnumNames ? '' : 'SRC_ATOP'); + static const BlendModeProto DST_ATOP = + BlendModeProto._(11, _omitEnumNames ? '' : 'DST_ATOP'); + static const BlendModeProto XOR = + BlendModeProto._(12, _omitEnumNames ? '' : 'XOR'); + static const BlendModeProto PLUS = + BlendModeProto._(13, _omitEnumNames ? '' : 'PLUS'); + static const BlendModeProto MODULATE = + BlendModeProto._(14, _omitEnumNames ? '' : 'MODULATE'); + static const BlendModeProto SCREEN = + BlendModeProto._(15, _omitEnumNames ? '' : 'SCREEN'); + static const BlendModeProto OVERLAY = + BlendModeProto._(16, _omitEnumNames ? '' : 'OVERLAY'); + static const BlendModeProto DARKEN = + BlendModeProto._(17, _omitEnumNames ? '' : 'DARKEN'); + static const BlendModeProto LIGHTEN = + BlendModeProto._(18, _omitEnumNames ? '' : 'LIGHTEN'); + static const BlendModeProto COLOR_DODGE = + BlendModeProto._(19, _omitEnumNames ? '' : 'COLOR_DODGE'); + static const BlendModeProto COLOR_BURN = + BlendModeProto._(20, _omitEnumNames ? '' : 'COLOR_BURN'); + static const BlendModeProto HARD_LIGHT = + BlendModeProto._(21, _omitEnumNames ? '' : 'HARD_LIGHT'); + static const BlendModeProto SOFT_LIGHT = + BlendModeProto._(22, _omitEnumNames ? '' : 'SOFT_LIGHT'); + static const BlendModeProto DIFFERENCE = + BlendModeProto._(23, _omitEnumNames ? '' : 'DIFFERENCE'); + static const BlendModeProto EXCLUSION = + BlendModeProto._(24, _omitEnumNames ? '' : 'EXCLUSION'); + static const BlendModeProto MULTIPLY = + BlendModeProto._(25, _omitEnumNames ? '' : 'MULTIPLY'); + static const BlendModeProto HUE = + BlendModeProto._(26, _omitEnumNames ? '' : 'HUE'); + static const BlendModeProto SATURATION = + BlendModeProto._(27, _omitEnumNames ? '' : 'SATURATION'); + static const BlendModeProto COLOR = + BlendModeProto._(28, _omitEnumNames ? '' : 'COLOR'); + static const BlendModeProto LUMINOSITY = + BlendModeProto._(29, _omitEnumNames ? '' : 'LUMINOSITY'); + + static const $core.List values = [ + BLEND_MODE_UNSPECIFIED, + CLEAR, + SRC, + DST, + SRC_OVER, + DST_OVER, + SRC_IN, + DST_IN, + SRC_OUT, + DST_OUT, + SRC_ATOP, + DST_ATOP, + XOR, + PLUS, + MODULATE, + SCREEN, + OVERLAY, + DARKEN, + LIGHTEN, + COLOR_DODGE, + COLOR_BURN, + HARD_LIGHT, + SOFT_LIGHT, + DIFFERENCE, + EXCLUSION, + MULTIPLY, + HUE, + SATURATION, + COLOR, + LUMINOSITY, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 29); + static BlendModeProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const BlendModeProto._(super.v, super.n); +} + +/// New enum for FloatingActionButtonLocation +class FloatingActionButtonLocationProto extends $pb.ProtobufEnum { + static const FloatingActionButtonLocationProto FAB_LOCATION_UNSPECIFIED = + FloatingActionButtonLocationProto._( + 0, _omitEnumNames ? '' : 'FAB_LOCATION_UNSPECIFIED'); + static const FloatingActionButtonLocationProto FAB_START_TOP = + FloatingActionButtonLocationProto._( + 1, _omitEnumNames ? '' : 'FAB_START_TOP'); + static const FloatingActionButtonLocationProto FAB_START = + FloatingActionButtonLocationProto._(2, _omitEnumNames ? '' : 'FAB_START'); + static const FloatingActionButtonLocationProto FAB_START_FLOAT = + FloatingActionButtonLocationProto._( + 3, _omitEnumNames ? '' : 'FAB_START_FLOAT'); + static const FloatingActionButtonLocationProto FAB_CENTER_TOP = + FloatingActionButtonLocationProto._( + 4, _omitEnumNames ? '' : 'FAB_CENTER_TOP'); + static const FloatingActionButtonLocationProto FAB_CENTER = + FloatingActionButtonLocationProto._( + 5, _omitEnumNames ? '' : 'FAB_CENTER'); + static const FloatingActionButtonLocationProto FAB_CENTER_FLOAT = + FloatingActionButtonLocationProto._( + 6, _omitEnumNames ? '' : 'FAB_CENTER_FLOAT'); + static const FloatingActionButtonLocationProto FAB_END_TOP = + FloatingActionButtonLocationProto._( + 7, _omitEnumNames ? '' : 'FAB_END_TOP'); + static const FloatingActionButtonLocationProto FAB_END = + FloatingActionButtonLocationProto._(8, _omitEnumNames ? '' : 'FAB_END'); + static const FloatingActionButtonLocationProto FAB_END_FLOAT = + FloatingActionButtonLocationProto._( + 9, _omitEnumNames ? '' : 'FAB_END_FLOAT'); + static const FloatingActionButtonLocationProto FAB_MINI_CENTER_TOP = + FloatingActionButtonLocationProto._( + 10, _omitEnumNames ? '' : 'FAB_MINI_CENTER_TOP'); + static const FloatingActionButtonLocationProto FAB_MINI_CENTER_FLOAT = + FloatingActionButtonLocationProto._( + 11, _omitEnumNames ? '' : 'FAB_MINI_CENTER_FLOAT'); + static const FloatingActionButtonLocationProto FAB_MINI_START_TOP = + FloatingActionButtonLocationProto._( + 12, _omitEnumNames ? '' : 'FAB_MINI_START_TOP'); + static const FloatingActionButtonLocationProto FAB_MINI_START_FLOAT = + FloatingActionButtonLocationProto._( + 13, _omitEnumNames ? '' : 'FAB_MINI_START_FLOAT'); + static const FloatingActionButtonLocationProto FAB_MINI_END_TOP = + FloatingActionButtonLocationProto._( + 14, _omitEnumNames ? '' : 'FAB_MINI_END_TOP'); + static const FloatingActionButtonLocationProto FAB_MINI_END_FLOAT = + FloatingActionButtonLocationProto._( + 15, _omitEnumNames ? '' : 'FAB_MINI_END_FLOAT'); + + static const $core.List values = + [ + FAB_LOCATION_UNSPECIFIED, + FAB_START_TOP, + FAB_START, + FAB_START_FLOAT, + FAB_CENTER_TOP, + FAB_CENTER, + FAB_CENTER_FLOAT, + FAB_END_TOP, + FAB_END, + FAB_END_FLOAT, + FAB_MINI_CENTER_TOP, + FAB_MINI_CENTER_FLOAT, + FAB_MINI_START_TOP, + FAB_MINI_START_FLOAT, + FAB_MINI_END_TOP, + FAB_MINI_END_FLOAT, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 15); + static FloatingActionButtonLocationProto? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const FloatingActionButtonLocationProto._(super.v, super.n); +} + +class GradientData_GradientType extends $pb.ProtobufEnum { + static const GradientData_GradientType GRADIENT_TYPE_UNSPECIFIED = + GradientData_GradientType._( + 0, _omitEnumNames ? '' : 'GRADIENT_TYPE_UNSPECIFIED'); + static const GradientData_GradientType LINEAR = + GradientData_GradientType._(1, _omitEnumNames ? '' : 'LINEAR'); + static const GradientData_GradientType RADIAL = + GradientData_GradientType._(2, _omitEnumNames ? '' : 'RADIAL'); + static const GradientData_GradientType SWEEP = + GradientData_GradientType._(3, _omitEnumNames ? '' : 'SWEEP'); + + static const $core.List values = + [ GRADIENT_TYPE_UNSPECIFIED, LINEAR, RADIAL, SWEEP, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 3); - static GradientData_GradientType? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 3); + static GradientData_GradientType? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const GradientData_GradientType._(super.v, super.n); } /// Predefined alignments class AlignmentData_PredefinedAlignment extends $pb.ProtobufEnum { - static const AlignmentData_PredefinedAlignment PREDEFINED_ALIGNMENT_UNSPECIFIED = AlignmentData_PredefinedAlignment._(0, _omitEnumNames ? '' : 'PREDEFINED_ALIGNMENT_UNSPECIFIED'); - static const AlignmentData_PredefinedAlignment BOTTOM_CENTER = AlignmentData_PredefinedAlignment._(1, _omitEnumNames ? '' : 'BOTTOM_CENTER'); - static const AlignmentData_PredefinedAlignment BOTTOM_LEFT = AlignmentData_PredefinedAlignment._(2, _omitEnumNames ? '' : 'BOTTOM_LEFT'); - static const AlignmentData_PredefinedAlignment BOTTOM_RIGHT = AlignmentData_PredefinedAlignment._(3, _omitEnumNames ? '' : 'BOTTOM_RIGHT'); - static const AlignmentData_PredefinedAlignment CENTER = AlignmentData_PredefinedAlignment._(4, _omitEnumNames ? '' : 'CENTER'); - static const AlignmentData_PredefinedAlignment CENTER_LEFT = AlignmentData_PredefinedAlignment._(5, _omitEnumNames ? '' : 'CENTER_LEFT'); - static const AlignmentData_PredefinedAlignment CENTER_RIGHT = AlignmentData_PredefinedAlignment._(6, _omitEnumNames ? '' : 'CENTER_RIGHT'); - static const AlignmentData_PredefinedAlignment TOP_CENTER = AlignmentData_PredefinedAlignment._(7, _omitEnumNames ? '' : 'TOP_CENTER'); - static const AlignmentData_PredefinedAlignment TOP_LEFT = AlignmentData_PredefinedAlignment._(8, _omitEnumNames ? '' : 'TOP_LEFT'); - static const AlignmentData_PredefinedAlignment TOP_RIGHT = AlignmentData_PredefinedAlignment._(9, _omitEnumNames ? '' : 'TOP_RIGHT'); - - static const $core.List values = [ + static const AlignmentData_PredefinedAlignment + PREDEFINED_ALIGNMENT_UNSPECIFIED = AlignmentData_PredefinedAlignment._( + 0, _omitEnumNames ? '' : 'PREDEFINED_ALIGNMENT_UNSPECIFIED'); + static const AlignmentData_PredefinedAlignment BOTTOM_CENTER = + AlignmentData_PredefinedAlignment._( + 1, _omitEnumNames ? '' : 'BOTTOM_CENTER'); + static const AlignmentData_PredefinedAlignment BOTTOM_LEFT = + AlignmentData_PredefinedAlignment._( + 2, _omitEnumNames ? '' : 'BOTTOM_LEFT'); + static const AlignmentData_PredefinedAlignment BOTTOM_RIGHT = + AlignmentData_PredefinedAlignment._( + 3, _omitEnumNames ? '' : 'BOTTOM_RIGHT'); + static const AlignmentData_PredefinedAlignment CENTER_ALIGN = + AlignmentData_PredefinedAlignment._( + 4, _omitEnumNames ? '' : 'CENTER_ALIGN'); + static const AlignmentData_PredefinedAlignment CENTER_LEFT = + AlignmentData_PredefinedAlignment._( + 5, _omitEnumNames ? '' : 'CENTER_LEFT'); + static const AlignmentData_PredefinedAlignment CENTER_RIGHT = + AlignmentData_PredefinedAlignment._( + 6, _omitEnumNames ? '' : 'CENTER_RIGHT'); + static const AlignmentData_PredefinedAlignment TOP_CENTER = + AlignmentData_PredefinedAlignment._( + 7, _omitEnumNames ? '' : 'TOP_CENTER'); + static const AlignmentData_PredefinedAlignment TOP_LEFT = + AlignmentData_PredefinedAlignment._(8, _omitEnumNames ? '' : 'TOP_LEFT'); + static const AlignmentData_PredefinedAlignment TOP_RIGHT = + AlignmentData_PredefinedAlignment._(9, _omitEnumNames ? '' : 'TOP_RIGHT'); + + static const $core.List values = + [ PREDEFINED_ALIGNMENT_UNSPECIFIED, BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT, - CENTER, + CENTER_ALIGN, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, @@ -198,11 +755,42 @@ class AlignmentData_PredefinedAlignment extends $pb.ProtobufEnum { TOP_RIGHT, ]; - static final $core.List _byValue = $pb.ProtobufEnum.$_initByValueList(values, 9); - static AlignmentData_PredefinedAlignment? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 9); + static AlignmentData_PredefinedAlignment? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; const AlignmentData_PredefinedAlignment._(super.v, super.n); } +class TransformData_TransformType extends $pb.ProtobufEnum { + static const TransformData_TransformType TRANSFORM_TYPE_UNSPECIFIED = + TransformData_TransformType._( + 0, _omitEnumNames ? '' : 'TRANSFORM_TYPE_UNSPECIFIED'); + static const TransformData_TransformType MATRIX_4X4 = + TransformData_TransformType._(1, _omitEnumNames ? '' : 'MATRIX_4X4'); + static const TransformData_TransformType TRANSLATE = + TransformData_TransformType._(2, _omitEnumNames ? '' : 'TRANSLATE'); + static const TransformData_TransformType ROTATE = + TransformData_TransformType._(3, _omitEnumNames ? '' : 'ROTATE'); + static const TransformData_TransformType SCALE = + TransformData_TransformType._(4, _omitEnumNames ? '' : 'SCALE'); + + static const $core.List values = + [ + TRANSFORM_TYPE_UNSPECIFIED, + MATRIX_4X4, + TRANSLATE, + ROTATE, + SCALE, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 4); + static TransformData_TransformType? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const TransformData_TransformType._(super.v, super.n); +} const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/lib/src/generated/sdui.pbgrpc.dart b/lib/src/generated/sdui.pbgrpc.dart index 375b447..57a2a75 100644 --- a/lib/src/generated/sdui.pbgrpc.dart +++ b/lib/src/generated/sdui.pbgrpc.dart @@ -19,7 +19,7 @@ import 'sdui.pb.dart' as $0; export 'sdui.pb.dart'; -/// Service definition (optional for now, but good for future gRPC) +/// Service definition @$pb.GrpcServiceName('flutter_sdui.SduiService') class SduiServiceClient extends $grpc.Client { /// The hostname for this service. @@ -30,14 +30,16 @@ class SduiServiceClient extends $grpc.Client { '', ]; - static final _$getSduiWidget = $grpc.ClientMethod<$0.SduiRequest, $0.SduiWidgetData>( - '/flutter_sdui.SduiService/GetSduiWidget', - ($0.SduiRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.SduiWidgetData.fromBuffer(value)); + static final _$getSduiWidget = + $grpc.ClientMethod<$0.SduiRequest, $0.SduiWidgetData>( + '/flutter_sdui.SduiService/GetSduiWidget', + ($0.SduiRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.SduiWidgetData.fromBuffer(value)); SduiServiceClient(super.channel, {super.options, super.interceptors}); - $grpc.ResponseFuture<$0.SduiWidgetData> getSduiWidget($0.SduiRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.SduiWidgetData> getSduiWidget($0.SduiRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$getSduiWidget, request, options: options); } } @@ -56,9 +58,11 @@ abstract class SduiServiceBase extends $grpc.Service { ($0.SduiWidgetData value) => value.writeToBuffer())); } - $async.Future<$0.SduiWidgetData> getSduiWidget_Pre($grpc.ServiceCall $call, $async.Future<$0.SduiRequest> $request) async { + $async.Future<$0.SduiWidgetData> getSduiWidget_Pre( + $grpc.ServiceCall $call, $async.Future<$0.SduiRequest> $request) async { return getSduiWidget($call, await $request); } - $async.Future<$0.SduiWidgetData> getSduiWidget($grpc.ServiceCall call, $0.SduiRequest request); + $async.Future<$0.SduiWidgetData> getSduiWidget( + $grpc.ServiceCall call, $0.SduiRequest request); } diff --git a/lib/src/generated/sdui.pbjson.dart b/lib/src/generated/sdui.pbjson.dart index d3b2847..14b1ae9 100644 --- a/lib/src/generated/sdui.pbjson.dart +++ b/lib/src/generated/sdui.pbjson.dart @@ -46,7 +46,7 @@ const BoxFitProto$json = { {'1': 'COVER', '2': 3}, {'1': 'FIT_WIDTH', '2': 4}, {'1': 'FIT_HEIGHT', '2': 5}, - {'1': 'NONE', '2': 6}, + {'1': 'NONE_BOX_FIT', '2': 6}, {'1': 'SCALE_DOWN', '2': 7}, ], }; @@ -54,8 +54,8 @@ const BoxFitProto$json = { /// Descriptor for `BoxFitProto`. Decode as a `google.protobuf.EnumDescriptorProto`. final $typed_data.Uint8List boxFitProtoDescriptor = $convert.base64Decode( 'CgtCb3hGaXRQcm90bxIXChNCT1hfRklUX1VOU1BFQ0lGSUVEEAASCAoERklMTBABEgsKB0NPTl' - 'RBSU4QAhIJCgVDT1ZFUhADEg0KCUZJVF9XSURUSBAEEg4KCkZJVF9IRUlHSFQQBRIICgROT05F' - 'EAYSDgoKU0NBTEVfRE9XThAH'); + 'RBSU4QAhIJCgVDT1ZFUhADEg0KCUZJVF9XSURUSBAEEg4KCkZJVF9IRUlHSFQQBRIQCgxOT05F' + 'X0JPWF9GSVQQBhIOCgpTQ0FMRV9ET1dOEAc='); @$core.Deprecated('Use borderStyleProtoDescriptor instead') const BorderStyleProto$json = { @@ -121,29 +121,693 @@ final $typed_data.Uint8List filterQualityProtoDescriptor = $convert.base64Decode 'ChJGaWx0ZXJRdWFsaXR5UHJvdG8SHgoaRklMVEVSX1FVQUxJVFlfVU5TUEVDSUZJRUQQABILCg' 'dOT05FX0ZREAESBwoDTE9XEAISCgoGTUVESVVNEAMSCAoESElHSBAE'); +@$core.Deprecated('Use mainAxisAlignmentProtoDescriptor instead') +const MainAxisAlignmentProto$json = { + '1': 'MainAxisAlignmentProto', + '2': [ + {'1': 'MAIN_AXIS_ALIGNMENT_UNSPECIFIED', '2': 0}, + {'1': 'MAIN_AXIS_START', '2': 1}, + {'1': 'MAIN_AXIS_END', '2': 2}, + {'1': 'MAIN_AXIS_CENTER', '2': 3}, + {'1': 'SPACE_BETWEEN', '2': 4}, + {'1': 'SPACE_AROUND', '2': 5}, + {'1': 'SPACE_EVENLY', '2': 6}, + ], +}; + +/// Descriptor for `MainAxisAlignmentProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List mainAxisAlignmentProtoDescriptor = $convert.base64Decode( + 'ChZNYWluQXhpc0FsaWdubWVudFByb3RvEiMKH01BSU5fQVhJU19BTElHTk1FTlRfVU5TUEVDSU' + 'ZJRUQQABITCg9NQUlOX0FYSVNfU1RBUlQQARIRCg1NQUlOX0FYSVNfRU5EEAISFAoQTUFJTl9B' + 'WElTX0NFTlRFUhADEhEKDVNQQUNFX0JFVFdFRU4QBBIQCgxTUEFDRV9BUk9VTkQQBRIQCgxTUE' + 'FDRV9FVkVOTFkQBg=='); + +@$core.Deprecated('Use crossAxisAlignmentProtoDescriptor instead') +const CrossAxisAlignmentProto$json = { + '1': 'CrossAxisAlignmentProto', + '2': [ + {'1': 'CROSS_AXIS_ALIGNMENT_UNSPECIFIED', '2': 0}, + {'1': 'CROSS_AXIS_START', '2': 1}, + {'1': 'CROSS_AXIS_END', '2': 2}, + {'1': 'CROSS_AXIS_CENTER', '2': 3}, + {'1': 'STRETCH', '2': 4}, + {'1': 'BASELINE', '2': 5}, + ], +}; + +/// Descriptor for `CrossAxisAlignmentProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List crossAxisAlignmentProtoDescriptor = $convert.base64Decode( + 'ChdDcm9zc0F4aXNBbGlnbm1lbnRQcm90bxIkCiBDUk9TU19BWElTX0FMSUdOTUVOVF9VTlNQRU' + 'NJRklFRBAAEhQKEENST1NTX0FYSVNfU1RBUlQQARISCg5DUk9TU19BWElTX0VORBACEhUKEUNS' + 'T1NTX0FYSVNfQ0VOVEVSEAMSCwoHU1RSRVRDSBAEEgwKCEJBU0VMSU5FEAU='); + +@$core.Deprecated('Use mainAxisSizeProtoDescriptor instead') +const MainAxisSizeProto$json = { + '1': 'MainAxisSizeProto', + '2': [ + {'1': 'MAIN_AXIS_SIZE_UNSPECIFIED', '2': 0}, + {'1': 'MIN', '2': 1}, + {'1': 'MAX', '2': 2}, + ], +}; + +/// Descriptor for `MainAxisSizeProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List mainAxisSizeProtoDescriptor = $convert.base64Decode( + 'ChFNYWluQXhpc1NpemVQcm90bxIeChpNQUlOX0FYSVNfU0laRV9VTlNQRUNJRklFRBAAEgcKA0' + '1JThABEgcKA01BWBAC'); + +@$core.Deprecated('Use textDirectionProtoDescriptor instead') +const TextDirectionProto$json = { + '1': 'TextDirectionProto', + '2': [ + {'1': 'TEXT_DIRECTION_UNSPECIFIED', '2': 0}, + {'1': 'LTR', '2': 1}, + {'1': 'RTL', '2': 2}, + ], +}; + +/// Descriptor for `TextDirectionProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List textDirectionProtoDescriptor = $convert.base64Decode( + 'ChJUZXh0RGlyZWN0aW9uUHJvdG8SHgoaVEVYVF9ESVJFQ1RJT05fVU5TUEVDSUZJRUQQABIHCg' + 'NMVFIQARIHCgNSVEwQAg=='); + +@$core.Deprecated('Use verticalDirectionProtoDescriptor instead') +const VerticalDirectionProto$json = { + '1': 'VerticalDirectionProto', + '2': [ + {'1': 'VERTICAL_DIRECTION_UNSPECIFIED', '2': 0}, + {'1': 'UP', '2': 1}, + {'1': 'DOWN', '2': 2}, + ], +}; + +/// Descriptor for `VerticalDirectionProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List verticalDirectionProtoDescriptor = + $convert.base64Decode( + 'ChZWZXJ0aWNhbERpcmVjdGlvblByb3RvEiIKHlZFUlRJQ0FMX0RJUkVDVElPTl9VTlNQRUNJRk' + 'lFRBAAEgYKAlVQEAESCAoERE9XThAC'); + +@$core.Deprecated('Use textBaselineProtoDescriptor instead') +const TextBaselineProto$json = { + '1': 'TextBaselineProto', + '2': [ + {'1': 'TEXT_BASELINE_UNSPECIFIED', '2': 0}, + {'1': 'ALPHABETIC', '2': 1}, + {'1': 'IDEOGRAPHIC', '2': 2}, + ], +}; + +/// Descriptor for `TextBaselineProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List textBaselineProtoDescriptor = $convert.base64Decode( + 'ChFUZXh0QmFzZWxpbmVQcm90bxIdChlURVhUX0JBU0VMSU5FX1VOU1BFQ0lGSUVEEAASDgoKQU' + 'xQSEFCRVRJQxABEg8KC0lERU9HUkFQSElDEAI='); + +@$core.Deprecated('Use clipProtoDescriptor instead') +const ClipProto$json = { + '1': 'ClipProto', + '2': [ + {'1': 'CLIP_UNSPECIFIED', '2': 0}, + {'1': 'CLIP_NONE', '2': 1}, + {'1': 'HARD_EDGE', '2': 2}, + {'1': 'ANTI_ALIAS', '2': 3}, + {'1': 'ANTI_ALIAS_WITH_SAVE_LAYER', '2': 4}, + ], +}; + +/// Descriptor for `ClipProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List clipProtoDescriptor = $convert.base64Decode( + 'CglDbGlwUHJvdG8SFAoQQ0xJUF9VTlNQRUNJRklFRBAAEg0KCUNMSVBfTk9ORRABEg0KCUhBUk' + 'RfRURHRRACEg4KCkFOVElfQUxJQVMQAxIeChpBTlRJX0FMSUFTX1dJVEhfU0FWRV9MQVlFUhAE'); + +@$core.Deprecated('Use textAlignProtoDescriptor instead') +const TextAlignProto$json = { + '1': 'TextAlignProto', + '2': [ + {'1': 'TEXT_ALIGN_UNSPECIFIED', '2': 0}, + {'1': 'LEFT', '2': 1}, + {'1': 'RIGHT', '2': 2}, + {'1': 'TEXT_ALIGN_CENTER', '2': 3}, + {'1': 'JUSTIFY', '2': 4}, + {'1': 'TEXT_ALIGN_START', '2': 5}, + {'1': 'TEXT_ALIGN_END', '2': 6}, + ], +}; + +/// Descriptor for `TextAlignProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List textAlignProtoDescriptor = $convert.base64Decode( + 'Cg5UZXh0QWxpZ25Qcm90bxIaChZURVhUX0FMSUdOX1VOU1BFQ0lGSUVEEAASCAoETEVGVBABEg' + 'kKBVJJR0hUEAISFQoRVEVYVF9BTElHTl9DRU5URVIQAxILCgdKVVNUSUZZEAQSFAoQVEVYVF9B' + 'TElHTl9TVEFSVBAFEhIKDlRFWFRfQUxJR05fRU5EEAY='); + +@$core.Deprecated('Use textOverflowProtoDescriptor instead') +const TextOverflowProto$json = { + '1': 'TextOverflowProto', + '2': [ + {'1': 'TEXT_OVERFLOW_UNSPECIFIED', '2': 0}, + {'1': 'CLIP', '2': 1}, + {'1': 'ELLIPSIS', '2': 2}, + {'1': 'FADE', '2': 3}, + {'1': 'VISIBLE', '2': 4}, + ], +}; + +/// Descriptor for `TextOverflowProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List textOverflowProtoDescriptor = $convert.base64Decode( + 'ChFUZXh0T3ZlcmZsb3dQcm90bxIdChlURVhUX09WRVJGTE9XX1VOU1BFQ0lGSUVEEAASCAoEQ0' + 'xJUBABEgwKCEVMTElQU0lTEAISCAoERkFERRADEgsKB1ZJU0lCTEUQBA=='); + +@$core.Deprecated('Use textDecorationProtoDescriptor instead') +const TextDecorationProto$json = { + '1': 'TextDecorationProto', + '2': [ + {'1': 'TEXT_DECORATION_UNSPECIFIED', '2': 0}, + {'1': 'TEXT_DECORATION_NONE', '2': 1}, + {'1': 'UNDERLINE', '2': 2}, + {'1': 'OVERLINE', '2': 3}, + {'1': 'LINE_THROUGH', '2': 4}, + ], +}; + +/// Descriptor for `TextDecorationProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List textDecorationProtoDescriptor = $convert.base64Decode( + 'ChNUZXh0RGVjb3JhdGlvblByb3RvEh8KG1RFWFRfREVDT1JBVElPTl9VTlNQRUNJRklFRBAAEh' + 'gKFFRFWFRfREVDT1JBVElPTl9OT05FEAESDQoJVU5ERVJMSU5FEAISDAoIT1ZFUkxJTkUQAxIQ' + 'CgxMSU5FX1RIUk9VR0gQBA=='); + +@$core.Deprecated('Use fontStyleProtoDescriptor instead') +const FontStyleProto$json = { + '1': 'FontStyleProto', + '2': [ + {'1': 'FONT_STYLE_UNSPECIFIED', '2': 0}, + {'1': 'NORMAL', '2': 1}, + {'1': 'ITALIC', '2': 2}, + ], +}; + +/// Descriptor for `FontStyleProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List fontStyleProtoDescriptor = $convert.base64Decode( + 'Cg5Gb250U3R5bGVQcm90bxIaChZGT05UX1NUWUxFX1VOU1BFQ0lGSUVEEAASCgoGTk9STUFMEA' + 'ESCgoGSVRBTElDEAI='); + +@$core.Deprecated('Use blendModeProtoDescriptor instead') +const BlendModeProto$json = { + '1': 'BlendModeProto', + '2': [ + {'1': 'BLEND_MODE_UNSPECIFIED', '2': 0}, + {'1': 'CLEAR', '2': 1}, + {'1': 'SRC', '2': 2}, + {'1': 'DST', '2': 3}, + {'1': 'SRC_OVER', '2': 4}, + {'1': 'DST_OVER', '2': 5}, + {'1': 'SRC_IN', '2': 6}, + {'1': 'DST_IN', '2': 7}, + {'1': 'SRC_OUT', '2': 8}, + {'1': 'DST_OUT', '2': 9}, + {'1': 'SRC_ATOP', '2': 10}, + {'1': 'DST_ATOP', '2': 11}, + {'1': 'XOR', '2': 12}, + {'1': 'PLUS', '2': 13}, + {'1': 'MODULATE', '2': 14}, + {'1': 'SCREEN', '2': 15}, + {'1': 'OVERLAY', '2': 16}, + {'1': 'DARKEN', '2': 17}, + {'1': 'LIGHTEN', '2': 18}, + {'1': 'COLOR_DODGE', '2': 19}, + {'1': 'COLOR_BURN', '2': 20}, + {'1': 'HARD_LIGHT', '2': 21}, + {'1': 'SOFT_LIGHT', '2': 22}, + {'1': 'DIFFERENCE', '2': 23}, + {'1': 'EXCLUSION', '2': 24}, + {'1': 'MULTIPLY', '2': 25}, + {'1': 'HUE', '2': 26}, + {'1': 'SATURATION', '2': 27}, + {'1': 'COLOR', '2': 28}, + {'1': 'LUMINOSITY', '2': 29}, + ], +}; + +/// Descriptor for `BlendModeProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List blendModeProtoDescriptor = $convert.base64Decode( + 'Cg5CbGVuZE1vZGVQcm90bxIaChZCTEVORF9NT0RFX1VOU1BFQ0lGSUVEEAASCQoFQ0xFQVIQAR' + 'IHCgNTUkMQAhIHCgNEU1QQAxIMCghTUkNfT1ZFUhAEEgwKCERTVF9PVkVSEAUSCgoGU1JDX0lO' + 'EAYSCgoGRFNUX0lOEAcSCwoHU1JDX09VVBAIEgsKB0RTVF9PVVQQCRIMCghTUkNfQVRPUBAKEg' + 'wKCERTVF9BVE9QEAsSBwoDWE9SEAwSCAoEUExVUxANEgwKCE1PRFVMQVRFEA4SCgoGU0NSRUVO' + 'EA8SCwoHT1ZFUkxBWRAQEgoKBkRBUktFThAREgsKB0xJR0hURU4QEhIPCgtDT0xPUl9ET0RHRR' + 'ATEg4KCkNPTE9SX0JVUk4QFBIOCgpIQVJEX0xJR0hUEBUSDgoKU09GVF9MSUdIVBAWEg4KCkRJ' + 'RkZFUkVOQ0UQFxINCglFWENMVVNJT04QGBIMCghNVUxUSVBMWRAZEgcKA0hVRRAaEg4KClNBVF' + 'VSQVRJT04QGxIJCgVDT0xPUhAcEg4KCkxVTUlOT1NJVFkQHQ=='); + +@$core.Deprecated('Use floatingActionButtonLocationProtoDescriptor instead') +const FloatingActionButtonLocationProto$json = { + '1': 'FloatingActionButtonLocationProto', + '2': [ + {'1': 'FAB_LOCATION_UNSPECIFIED', '2': 0}, + {'1': 'FAB_START_TOP', '2': 1}, + {'1': 'FAB_START', '2': 2}, + {'1': 'FAB_START_FLOAT', '2': 3}, + {'1': 'FAB_CENTER_TOP', '2': 4}, + {'1': 'FAB_CENTER', '2': 5}, + {'1': 'FAB_CENTER_FLOAT', '2': 6}, + {'1': 'FAB_END_TOP', '2': 7}, + {'1': 'FAB_END', '2': 8}, + {'1': 'FAB_END_FLOAT', '2': 9}, + {'1': 'FAB_MINI_CENTER_TOP', '2': 10}, + {'1': 'FAB_MINI_CENTER_FLOAT', '2': 11}, + {'1': 'FAB_MINI_START_TOP', '2': 12}, + {'1': 'FAB_MINI_START_FLOAT', '2': 13}, + {'1': 'FAB_MINI_END_TOP', '2': 14}, + {'1': 'FAB_MINI_END_FLOAT', '2': 15}, + ], +}; + +/// Descriptor for `FloatingActionButtonLocationProto`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List floatingActionButtonLocationProtoDescriptor = $convert.base64Decode( + 'CiFGbG9hdGluZ0FjdGlvbkJ1dHRvbkxvY2F0aW9uUHJvdG8SHAoYRkFCX0xPQ0FUSU9OX1VOU1' + 'BFQ0lGSUVEEAASEQoNRkFCX1NUQVJUX1RPUBABEg0KCUZBQl9TVEFSVBACEhMKD0ZBQl9TVEFS' + 'VF9GTE9BVBADEhIKDkZBQl9DRU5URVJfVE9QEAQSDgoKRkFCX0NFTlRFUhAFEhQKEEZBQl9DRU' + '5URVJfRkxPQVQQBhIPCgtGQUJfRU5EX1RPUBAHEgsKB0ZBQl9FTkQQCBIRCg1GQUJfRU5EX0ZM' + 'T0FUEAkSFwoTRkFCX01JTklfQ0VOVEVSX1RPUBAKEhkKFUZBQl9NSU5JX0NFTlRFUl9GTE9BVB' + 'ALEhYKEkZBQl9NSU5JX1NUQVJUX1RPUBAMEhgKFEZBQl9NSU5JX1NUQVJUX0ZMT0FUEA0SFAoQ' + 'RkFCX01JTklfRU5EX1RPUBAOEhYKEkZBQl9NSU5JX0VORF9GTE9BVBAP'); + @$core.Deprecated('Use sduiWidgetDataDescriptor instead') const SduiWidgetData$json = { '1': 'SduiWidgetData', '2': [ - {'1': 'type', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.WidgetType', '10': 'type'}, - {'1': 'string_attributes', '3': 2, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.StringAttributesEntry', '10': 'stringAttributes'}, - {'1': 'double_attributes', '3': 3, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.DoubleAttributesEntry', '10': 'doubleAttributes'}, - {'1': 'bool_attributes', '3': 4, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.BoolAttributesEntry', '10': 'boolAttributes'}, - {'1': 'int_attributes', '3': 5, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData.IntAttributesEntry', '10': 'intAttributes'}, - {'1': 'text_style', '3': 6, '4': 1, '5': 11, '6': '.flutter_sdui.TextStyleData', '10': 'textStyle'}, - {'1': 'padding', '3': 7, '4': 1, '5': 11, '6': '.flutter_sdui.EdgeInsetsData', '10': 'padding'}, - {'1': 'margin', '3': 8, '4': 1, '5': 11, '6': '.flutter_sdui.EdgeInsetsData', '10': 'margin'}, - {'1': 'color', '3': 9, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'color'}, - {'1': 'icon', '3': 10, '4': 1, '5': 11, '6': '.flutter_sdui.IconDataMessage', '10': 'icon'}, - {'1': 'box_decoration', '3': 11, '4': 1, '5': 11, '6': '.flutter_sdui.BoxDecorationData', '10': 'boxDecoration'}, - {'1': 'children', '3': 12, '4': 3, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'children'}, - {'1': 'child', '3': 13, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'child'}, - {'1': 'app_bar', '3': 14, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'appBar'}, - {'1': 'body', '3': 15, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'body'}, - {'1': 'floating_action_button', '3': 16, '4': 1, '5': 11, '6': '.flutter_sdui.SduiWidgetData', '10': 'floatingActionButton'}, - {'1': 'background_color', '3': 17, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'backgroundColor'}, - ], - '3': [SduiWidgetData_StringAttributesEntry$json, SduiWidgetData_DoubleAttributesEntry$json, SduiWidgetData_BoolAttributesEntry$json, SduiWidgetData_IntAttributesEntry$json], + { + '1': 'type', + '3': 1, + '4': 1, + '5': 14, + '6': '.flutter_sdui.WidgetType', + '10': 'type' + }, + { + '1': 'string_attributes', + '3': 2, + '4': 3, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData.StringAttributesEntry', + '10': 'stringAttributes' + }, + { + '1': 'double_attributes', + '3': 3, + '4': 3, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData.DoubleAttributesEntry', + '10': 'doubleAttributes' + }, + { + '1': 'bool_attributes', + '3': 4, + '4': 3, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData.BoolAttributesEntry', + '10': 'boolAttributes' + }, + { + '1': 'int_attributes', + '3': 5, + '4': 3, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData.IntAttributesEntry', + '10': 'intAttributes' + }, + { + '1': 'text_style', + '3': 6, + '4': 1, + '5': 11, + '6': '.flutter_sdui.TextStyleData', + '10': 'textStyle' + }, + { + '1': 'padding', + '3': 7, + '4': 1, + '5': 11, + '6': '.flutter_sdui.EdgeInsetsData', + '10': 'padding' + }, + { + '1': 'margin', + '3': 8, + '4': 1, + '5': 11, + '6': '.flutter_sdui.EdgeInsetsData', + '10': 'margin' + }, + { + '1': 'color', + '3': 9, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '10': 'color' + }, + { + '1': 'icon', + '3': 10, + '4': 1, + '5': 11, + '6': '.flutter_sdui.IconDataMessage', + '10': 'icon' + }, + { + '1': 'box_decoration', + '3': 11, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BoxDecorationData', + '10': 'boxDecoration' + }, + { + '1': 'children', + '3': 12, + '4': 3, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'children' + }, + { + '1': 'child', + '3': 13, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'child' + }, + { + '1': 'app_bar', + '3': 14, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'appBar' + }, + { + '1': 'body', + '3': 15, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'body' + }, + { + '1': 'floating_action_button', + '3': 16, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'floatingActionButton' + }, + { + '1': 'background_color', + '3': 17, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '10': 'backgroundColor' + }, + { + '1': 'bottom_navigation_bar', + '3': 18, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'bottomNavigationBar' + }, + { + '1': 'drawer', + '3': 19, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'drawer' + }, + { + '1': 'end_drawer', + '3': 20, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'endDrawer' + }, + { + '1': 'bottom_sheet', + '3': 21, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'bottomSheet' + }, + { + '1': 'resize_to_avoid_bottom_inset', + '3': 22, + '4': 1, + '5': 8, + '10': 'resizeToAvoidBottomInset' + }, + {'1': 'primary', '3': 23, '4': 1, '5': 8, '10': 'primary'}, + { + '1': 'floating_action_button_location', + '3': 24, + '4': 1, + '5': 14, + '6': '.flutter_sdui.FloatingActionButtonLocationProto', + '10': 'floatingActionButtonLocation' + }, + {'1': 'extend_body', '3': 25, '4': 1, '5': 8, '10': 'extendBody'}, + { + '1': 'extend_body_behind_app_bar', + '3': 26, + '4': 1, + '5': 8, + '10': 'extendBodyBehindAppBar' + }, + { + '1': 'drawer_scrim_color', + '3': 27, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '10': 'drawerScrimColor' + }, + { + '1': 'drawer_edge_drag_width', + '3': 28, + '4': 1, + '5': 1, + '10': 'drawerEdgeDragWidth' + }, + { + '1': 'drawer_enable_open_drag_gesture', + '3': 29, + '4': 1, + '5': 8, + '10': 'drawerEnableOpenDragGesture' + }, + { + '1': 'end_drawer_enable_open_drag_gesture', + '3': 30, + '4': 1, + '5': 8, + '10': 'endDrawerEnableOpenDragGesture' + }, + { + '1': 'main_axis_alignment', + '3': 31, + '4': 1, + '5': 14, + '6': '.flutter_sdui.MainAxisAlignmentProto', + '10': 'mainAxisAlignment' + }, + { + '1': 'cross_axis_alignment', + '3': 32, + '4': 1, + '5': 14, + '6': '.flutter_sdui.CrossAxisAlignmentProto', + '10': 'crossAxisAlignment' + }, + { + '1': 'main_axis_size', + '3': 33, + '4': 1, + '5': 14, + '6': '.flutter_sdui.MainAxisSizeProto', + '10': 'mainAxisSize' + }, + { + '1': 'text_direction', + '3': 34, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TextDirectionProto', + '10': 'textDirection' + }, + { + '1': 'vertical_direction', + '3': 35, + '4': 1, + '5': 14, + '6': '.flutter_sdui.VerticalDirectionProto', + '10': 'verticalDirection' + }, + { + '1': 'text_baseline', + '3': 36, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TextBaselineProto', + '10': 'textBaseline' + }, + { + '1': 'alignment', + '3': 37, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '10': 'alignment' + }, + { + '1': 'constraints', + '3': 38, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BoxConstraintsData', + '10': 'constraints' + }, + { + '1': 'transform', + '3': 39, + '4': 1, + '5': 11, + '6': '.flutter_sdui.TransformData', + '10': 'transform' + }, + { + '1': 'transform_alignment', + '3': 40, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '10': 'transformAlignment' + }, + { + '1': 'clip_behavior', + '3': 41, + '4': 1, + '5': 14, + '6': '.flutter_sdui.ClipProto', + '10': 'clipBehavior' + }, + { + '1': 'text_align', + '3': 42, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TextAlignProto', + '10': 'textAlign' + }, + { + '1': 'overflow', + '3': 43, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TextOverflowProto', + '10': 'overflow' + }, + {'1': 'max_lines', '3': 44, '4': 1, '5': 5, '10': 'maxLines'}, + {'1': 'soft_wrap', '3': 45, '4': 1, '5': 8, '10': 'softWrap'}, + {'1': 'letter_spacing', '3': 46, '4': 1, '5': 1, '10': 'letterSpacing'}, + {'1': 'word_spacing', '3': 47, '4': 1, '5': 1, '10': 'wordSpacing'}, + {'1': 'height', '3': 48, '4': 1, '5': 1, '10': 'height'}, + {'1': 'font_family', '3': 49, '4': 1, '5': 9, '10': 'fontFamily'}, + { + '1': 'repeat', + '3': 50, + '4': 1, + '5': 14, + '6': '.flutter_sdui.ImageRepeatProto', + '10': 'repeat' + }, + { + '1': 'color_blend_mode', + '3': 51, + '4': 1, + '5': 14, + '6': '.flutter_sdui.BlendModeProto', + '10': 'colorBlendMode' + }, + { + '1': 'center_slice', + '3': 52, + '4': 1, + '5': 11, + '6': '.flutter_sdui.RectData', + '10': 'centerSlice' + }, + { + '1': 'match_text_direction', + '3': 53, + '4': 1, + '5': 8, + '10': 'matchTextDirection' + }, + {'1': 'gapless_playback', '3': 54, '4': 1, '5': 8, '10': 'gaplessPlayback'}, + { + '1': 'filter_quality', + '3': 55, + '4': 1, + '5': 14, + '6': '.flutter_sdui.FilterQualityProto', + '10': 'filterQuality' + }, + {'1': 'cache_width', '3': 56, '4': 1, '5': 5, '10': 'cacheWidth'}, + {'1': 'cache_height', '3': 57, '4': 1, '5': 5, '10': 'cacheHeight'}, + {'1': 'scale', '3': 58, '4': 1, '5': 1, '10': 'scale'}, + {'1': 'semantic_label', '3': 59, '4': 1, '5': 9, '10': 'semanticLabel'}, + { + '1': 'error_widget', + '3': 60, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'errorWidget' + }, + { + '1': 'loading_widget', + '3': 61, + '4': 1, + '5': 11, + '6': '.flutter_sdui.SduiWidgetData', + '10': 'loadingWidget' + }, + {'1': 'opacity', '3': 62, '4': 1, '5': 1, '10': 'opacity'}, + { + '1': 'apply_text_scaling', + '3': 63, + '4': 1, + '5': 8, + '10': 'applyTextScaling' + }, + { + '1': 'shadows', + '3': 64, + '4': 3, + '5': 11, + '6': '.flutter_sdui.ShadowData', + '10': 'shadows' + }, + ], + '3': [ + SduiWidgetData_StringAttributesEntry$json, + SduiWidgetData_DoubleAttributesEntry$json, + SduiWidgetData_BoolAttributesEntry$json, + SduiWidgetData_IntAttributesEntry$json + ], }; @$core.Deprecated('Use sduiWidgetDataDescriptor instead') @@ -208,12 +872,60 @@ final $typed_data.Uint8List sduiWidgetDataDescriptor = $convert.base64Decode( 'Rib2R5GA8gASgLMhwuZmx1dHRlcl9zZHVpLlNkdWlXaWRnZXREYXRhUgRib2R5ElIKFmZsb2F0' 'aW5nX2FjdGlvbl9idXR0b24YECABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGFSFG' 'Zsb2F0aW5nQWN0aW9uQnV0dG9uEkIKEGJhY2tncm91bmRfY29sb3IYESABKAsyFy5mbHV0dGVy' - 'X3NkdWkuQ29sb3JEYXRhUg9iYWNrZ3JvdW5kQ29sb3IaQwoVU3RyaW5nQXR0cmlidXRlc0VudH' - 'J5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgJUgV2YWx1ZToCOAEaQwoVRG91Ymxl' - 'QXR0cmlidXRlc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgBUgV2YWx1ZT' - 'oCOAEaQQoTQm9vbEF0dHJpYnV0ZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgC' - 'IAEoCFIFdmFsdWU6AjgBGkAKEkludEF0dHJpYnV0ZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleR' - 'IUCgV2YWx1ZRgCIAEoBVIFdmFsdWU6AjgB'); + 'X3NkdWkuQ29sb3JEYXRhUg9iYWNrZ3JvdW5kQ29sb3ISUAoVYm90dG9tX25hdmlnYXRpb25fYm' + 'FyGBIgASgLMhwuZmx1dHRlcl9zZHVpLlNkdWlXaWRnZXREYXRhUhNib3R0b21OYXZpZ2F0aW9u' + 'QmFyEjQKBmRyYXdlchgTIAEoCzIcLmZsdXR0ZXJfc2R1aS5TZHVpV2lkZ2V0RGF0YVIGZHJhd2' + 'VyEjsKCmVuZF9kcmF3ZXIYFCABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldERhdGFSCWVu' + 'ZERyYXdlchI/Cgxib3R0b21fc2hlZXQYFSABKAsyHC5mbHV0dGVyX3NkdWkuU2R1aVdpZGdldE' + 'RhdGFSC2JvdHRvbVNoZWV0Ej4KHHJlc2l6ZV90b19hdm9pZF9ib3R0b21faW5zZXQYFiABKAhS' + 'GHJlc2l6ZVRvQXZvaWRCb3R0b21JbnNldBIYCgdwcmltYXJ5GBcgASgIUgdwcmltYXJ5EnYKH2' + 'Zsb2F0aW5nX2FjdGlvbl9idXR0b25fbG9jYXRpb24YGCABKA4yLy5mbHV0dGVyX3NkdWkuRmxv' + 'YXRpbmdBY3Rpb25CdXR0b25Mb2NhdGlvblByb3RvUhxmbG9hdGluZ0FjdGlvbkJ1dHRvbkxvY2' + 'F0aW9uEh8KC2V4dGVuZF9ib2R5GBkgASgIUgpleHRlbmRCb2R5EjoKGmV4dGVuZF9ib2R5X2Jl' + 'aGluZF9hcHBfYmFyGBogASgIUhZleHRlbmRCb2R5QmVoaW5kQXBwQmFyEkUKEmRyYXdlcl9zY3' + 'JpbV9jb2xvchgbIAEoCzIXLmZsdXR0ZXJfc2R1aS5Db2xvckRhdGFSEGRyYXdlclNjcmltQ29s' + 'b3ISMwoWZHJhd2VyX2VkZ2VfZHJhZ193aWR0aBgcIAEoAVITZHJhd2VyRWRnZURyYWdXaWR0aB' + 'JECh9kcmF3ZXJfZW5hYmxlX29wZW5fZHJhZ19nZXN0dXJlGB0gASgIUhtkcmF3ZXJFbmFibGVP' + 'cGVuRHJhZ0dlc3R1cmUSSwojZW5kX2RyYXdlcl9lbmFibGVfb3Blbl9kcmFnX2dlc3R1cmUYHi' + 'ABKAhSHmVuZERyYXdlckVuYWJsZU9wZW5EcmFnR2VzdHVyZRJUChNtYWluX2F4aXNfYWxpZ25t' + 'ZW50GB8gASgOMiQuZmx1dHRlcl9zZHVpLk1haW5BeGlzQWxpZ25tZW50UHJvdG9SEW1haW5BeG' + 'lzQWxpZ25tZW50ElcKFGNyb3NzX2F4aXNfYWxpZ25tZW50GCAgASgOMiUuZmx1dHRlcl9zZHVp' + 'LkNyb3NzQXhpc0FsaWdubWVudFByb3RvUhJjcm9zc0F4aXNBbGlnbm1lbnQSRQoObWFpbl9heG' + 'lzX3NpemUYISABKA4yHy5mbHV0dGVyX3NkdWkuTWFpbkF4aXNTaXplUHJvdG9SDG1haW5BeGlz' + 'U2l6ZRJHCg50ZXh0X2RpcmVjdGlvbhgiIAEoDjIgLmZsdXR0ZXJfc2R1aS5UZXh0RGlyZWN0aW' + '9uUHJvdG9SDXRleHREaXJlY3Rpb24SUwoSdmVydGljYWxfZGlyZWN0aW9uGCMgASgOMiQuZmx1' + 'dHRlcl9zZHVpLlZlcnRpY2FsRGlyZWN0aW9uUHJvdG9SEXZlcnRpY2FsRGlyZWN0aW9uEkQKDX' + 'RleHRfYmFzZWxpbmUYJCABKA4yHy5mbHV0dGVyX3NkdWkuVGV4dEJhc2VsaW5lUHJvdG9SDHRl' + 'eHRCYXNlbGluZRI5CglhbGlnbm1lbnQYJSABKAsyGy5mbHV0dGVyX3NkdWkuQWxpZ25tZW50RG' + 'F0YVIJYWxpZ25tZW50EkIKC2NvbnN0cmFpbnRzGCYgASgLMiAuZmx1dHRlcl9zZHVpLkJveENv' + 'bnN0cmFpbnRzRGF0YVILY29uc3RyYWludHMSOQoJdHJhbnNmb3JtGCcgASgLMhsuZmx1dHRlcl' + '9zZHVpLlRyYW5zZm9ybURhdGFSCXRyYW5zZm9ybRJMChN0cmFuc2Zvcm1fYWxpZ25tZW50GCgg' + 'ASgLMhsuZmx1dHRlcl9zZHVpLkFsaWdubWVudERhdGFSEnRyYW5zZm9ybUFsaWdubWVudBI8Cg' + '1jbGlwX2JlaGF2aW9yGCkgASgOMhcuZmx1dHRlcl9zZHVpLkNsaXBQcm90b1IMY2xpcEJlaGF2' + 'aW9yEjsKCnRleHRfYWxpZ24YKiABKA4yHC5mbHV0dGVyX3NkdWkuVGV4dEFsaWduUHJvdG9SCX' + 'RleHRBbGlnbhI7CghvdmVyZmxvdxgrIAEoDjIfLmZsdXR0ZXJfc2R1aS5UZXh0T3ZlcmZsb3dQ' + 'cm90b1IIb3ZlcmZsb3cSGwoJbWF4X2xpbmVzGCwgASgFUghtYXhMaW5lcxIbCglzb2Z0X3dyYX' + 'AYLSABKAhSCHNvZnRXcmFwEiUKDmxldHRlcl9zcGFjaW5nGC4gASgBUg1sZXR0ZXJTcGFjaW5n' + 'EiEKDHdvcmRfc3BhY2luZxgvIAEoAVILd29yZFNwYWNpbmcSFgoGaGVpZ2h0GDAgASgBUgZoZW' + 'lnaHQSHwoLZm9udF9mYW1pbHkYMSABKAlSCmZvbnRGYW1pbHkSNgoGcmVwZWF0GDIgASgOMh4u' + 'Zmx1dHRlcl9zZHVpLkltYWdlUmVwZWF0UHJvdG9SBnJlcGVhdBJGChBjb2xvcl9ibGVuZF9tb2' + 'RlGDMgASgOMhwuZmx1dHRlcl9zZHVpLkJsZW5kTW9kZVByb3RvUg5jb2xvckJsZW5kTW9kZRI5' + 'CgxjZW50ZXJfc2xpY2UYNCABKAsyFi5mbHV0dGVyX3NkdWkuUmVjdERhdGFSC2NlbnRlclNsaW' + 'NlEjAKFG1hdGNoX3RleHRfZGlyZWN0aW9uGDUgASgIUhJtYXRjaFRleHREaXJlY3Rpb24SKQoQ' + 'Z2FwbGVzc19wbGF5YmFjaxg2IAEoCFIPZ2FwbGVzc1BsYXliYWNrEkcKDmZpbHRlcl9xdWFsaX' + 'R5GDcgASgOMiAuZmx1dHRlcl9zZHVpLkZpbHRlclF1YWxpdHlQcm90b1INZmlsdGVyUXVhbGl0' + 'eRIfCgtjYWNoZV93aWR0aBg4IAEoBVIKY2FjaGVXaWR0aBIhCgxjYWNoZV9oZWlnaHQYOSABKA' + 'VSC2NhY2hlSGVpZ2h0EhQKBXNjYWxlGDogASgBUgVzY2FsZRIlCg5zZW1hbnRpY19sYWJlbBg7' + 'IAEoCVINc2VtYW50aWNMYWJlbBI/CgxlcnJvcl93aWRnZXQYPCABKAsyHC5mbHV0dGVyX3NkdW' + 'kuU2R1aVdpZGdldERhdGFSC2Vycm9yV2lkZ2V0EkMKDmxvYWRpbmdfd2lkZ2V0GD0gASgLMhwu' + 'Zmx1dHRlcl9zZHVpLlNkdWlXaWRnZXREYXRhUg1sb2FkaW5nV2lkZ2V0EhgKB29wYWNpdHkYPi' + 'ABKAFSB29wYWNpdHkSLAoSYXBwbHlfdGV4dF9zY2FsaW5nGD8gASgIUhBhcHBseVRleHRTY2Fs' + 'aW5nEjIKB3NoYWRvd3MYQCADKAsyGC5mbHV0dGVyX3NkdWkuU2hhZG93RGF0YVIHc2hhZG93cx' + 'pDChVTdHJpbmdBdHRyaWJ1dGVzRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiAB' + 'KAlSBXZhbHVlOgI4ARpDChVEb3VibGVBdHRyaWJ1dGVzRW50cnkSEAoDa2V5GAEgASgJUgNrZX' + 'kSFAoFdmFsdWUYAiABKAFSBXZhbHVlOgI4ARpBChNCb29sQXR0cmlidXRlc0VudHJ5EhAKA2tl' + 'eRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgIUgV2YWx1ZToCOAEaQAoSSW50QXR0cmlidXRlc0' + 'VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgFUgV2YWx1ZToCOAE='); @$core.Deprecated('Use colorDataDescriptor instead') const ColorData$json = { @@ -261,14 +973,93 @@ final $typed_data.Uint8List edgeInsetsDataDescriptor = $convert.base64Decode( const TextStyleData$json = { '1': 'TextStyleData', '2': [ - {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, - {'1': 'font_size', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'fontSize', '17': true}, - {'1': 'font_weight', '3': 3, '4': 1, '5': 9, '9': 2, '10': 'fontWeight', '17': true}, + { + '1': 'color', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '9': 0, + '10': 'color', + '17': true + }, + { + '1': 'font_size', + '3': 2, + '4': 1, + '5': 1, + '9': 1, + '10': 'fontSize', + '17': true + }, + { + '1': 'font_weight', + '3': 3, + '4': 1, + '5': 9, + '9': 2, + '10': 'fontWeight', + '17': true + }, + { + '1': 'decoration', + '3': 4, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TextDecorationProto', + '9': 3, + '10': 'decoration', + '17': true + }, + { + '1': 'letter_spacing', + '3': 5, + '4': 1, + '5': 1, + '9': 4, + '10': 'letterSpacing', + '17': true + }, + { + '1': 'word_spacing', + '3': 6, + '4': 1, + '5': 1, + '9': 5, + '10': 'wordSpacing', + '17': true + }, + {'1': 'height', '3': 7, '4': 1, '5': 1, '9': 6, '10': 'height', '17': true}, + { + '1': 'font_family', + '3': 8, + '4': 1, + '5': 9, + '9': 7, + '10': 'fontFamily', + '17': true + }, + { + '1': 'font_style', + '3': 9, + '4': 1, + '5': 14, + '6': '.flutter_sdui.FontStyleProto', + '9': 8, + '10': 'fontStyle', + '17': true + }, ], '8': [ {'1': '_color'}, {'1': '_font_size'}, {'1': '_font_weight'}, + {'1': '_decoration'}, + {'1': '_letter_spacing'}, + {'1': '_word_spacing'}, + {'1': '_height'}, + {'1': '_font_family'}, + {'1': '_font_style'}, ], }; @@ -276,17 +1067,49 @@ const TextStyleData$json = { final $typed_data.Uint8List textStyleDataDescriptor = $convert.base64Decode( 'Cg1UZXh0U3R5bGVEYXRhEjIKBWNvbG9yGAEgASgLMhcuZmx1dHRlcl9zZHVpLkNvbG9yRGF0YU' 'gAUgVjb2xvcogBARIgCglmb250X3NpemUYAiABKAFIAVIIZm9udFNpemWIAQESJAoLZm9udF93' - 'ZWlnaHQYAyABKAlIAlIKZm9udFdlaWdodIgBAUIICgZfY29sb3JCDAoKX2ZvbnRfc2l6ZUIOCg' - 'xfZm9udF93ZWlnaHQ='); + 'ZWlnaHQYAyABKAlIAlIKZm9udFdlaWdodIgBARJGCgpkZWNvcmF0aW9uGAQgASgOMiEuZmx1dH' + 'Rlcl9zZHVpLlRleHREZWNvcmF0aW9uUHJvdG9IA1IKZGVjb3JhdGlvbogBARIqCg5sZXR0ZXJf' + 'c3BhY2luZxgFIAEoAUgEUg1sZXR0ZXJTcGFjaW5niAEBEiYKDHdvcmRfc3BhY2luZxgGIAEoAU' + 'gFUgt3b3JkU3BhY2luZ4gBARIbCgZoZWlnaHQYByABKAFIBlIGaGVpZ2h0iAEBEiQKC2ZvbnRf' + 'ZmFtaWx5GAggASgJSAdSCmZvbnRGYW1pbHmIAQESQAoKZm9udF9zdHlsZRgJIAEoDjIcLmZsdX' + 'R0ZXJfc2R1aS5Gb250U3R5bGVQcm90b0gIUglmb250U3R5bGWIAQFCCAoGX2NvbG9yQgwKCl9m' + 'b250X3NpemVCDgoMX2ZvbnRfd2VpZ2h0Qg0KC19kZWNvcmF0aW9uQhEKD19sZXR0ZXJfc3BhY2' + 'luZ0IPCg1fd29yZF9zcGFjaW5nQgkKB19oZWlnaHRCDgoMX2ZvbnRfZmFtaWx5Qg0KC19mb250' + 'X3N0eWxl'); @$core.Deprecated('Use iconDataMessageDescriptor instead') const IconDataMessage$json = { '1': 'IconDataMessage', '2': [ {'1': 'name', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'name', '17': true}, - {'1': 'code_point', '3': 2, '4': 1, '5': 5, '9': 1, '10': 'codePoint', '17': true}, - {'1': 'font_family', '3': 3, '4': 1, '5': 9, '9': 2, '10': 'fontFamily', '17': true}, - {'1': 'color', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 3, '10': 'color', '17': true}, + { + '1': 'code_point', + '3': 2, + '4': 1, + '5': 5, + '9': 1, + '10': 'codePoint', + '17': true + }, + { + '1': 'font_family', + '3': 3, + '4': 1, + '5': 9, + '9': 2, + '10': 'fontFamily', + '17': true + }, + { + '1': 'color', + '3': 4, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '9': 3, + '10': 'color', + '17': true + }, {'1': 'size', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'size', '17': true}, ], '8': [ @@ -310,13 +1133,74 @@ final $typed_data.Uint8List iconDataMessageDescriptor = $convert.base64Decode( const BoxDecorationData$json = { '1': 'BoxDecorationData', '2': [ - {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, - {'1': 'border_radius', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.BorderRadiusData', '9': 1, '10': 'borderRadius', '17': true}, - {'1': 'border', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.BorderData', '9': 2, '10': 'border', '17': true}, - {'1': 'box_shadow', '3': 4, '4': 3, '5': 11, '6': '.flutter_sdui.BoxShadowData', '10': 'boxShadow'}, - {'1': 'gradient', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.GradientData', '9': 3, '10': 'gradient', '17': true}, - {'1': 'shape', '3': 6, '4': 1, '5': 14, '6': '.flutter_sdui.BoxShapeProto', '9': 4, '10': 'shape', '17': true}, - {'1': 'image', '3': 7, '4': 1, '5': 11, '6': '.flutter_sdui.DecorationImageData', '9': 5, '10': 'image', '17': true}, + { + '1': 'color', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '9': 0, + '10': 'color', + '17': true + }, + { + '1': 'border_radius', + '3': 2, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderRadiusData', + '9': 1, + '10': 'borderRadius', + '17': true + }, + { + '1': 'border', + '3': 3, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderData', + '9': 2, + '10': 'border', + '17': true + }, + { + '1': 'box_shadow', + '3': 4, + '4': 3, + '5': 11, + '6': '.flutter_sdui.BoxShadowData', + '10': 'boxShadow' + }, + { + '1': 'gradient', + '3': 5, + '4': 1, + '5': 11, + '6': '.flutter_sdui.GradientData', + '9': 3, + '10': 'gradient', + '17': true + }, + { + '1': 'shape', + '3': 6, + '4': 1, + '5': 14, + '6': '.flutter_sdui.BoxShapeProto', + '9': 4, + '10': 'shape', + '17': true + }, + { + '1': 'image', + '3': 7, + '4': 1, + '5': 11, + '6': '.flutter_sdui.DecorationImageData', + '9': 5, + '10': 'image', + '17': true + }, ], '8': [ {'1': '_color'}, @@ -346,10 +1230,42 @@ const BorderRadiusData$json = { '1': 'BorderRadiusData', '2': [ {'1': 'all', '3': 1, '4': 1, '5': 1, '9': 0, '10': 'all', '17': true}, - {'1': 'top_left', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'topLeft', '17': true}, - {'1': 'top_right', '3': 3, '4': 1, '5': 1, '9': 2, '10': 'topRight', '17': true}, - {'1': 'bottom_left', '3': 4, '4': 1, '5': 1, '9': 3, '10': 'bottomLeft', '17': true}, - {'1': 'bottom_right', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'bottomRight', '17': true}, + { + '1': 'top_left', + '3': 2, + '4': 1, + '5': 1, + '9': 1, + '10': 'topLeft', + '17': true + }, + { + '1': 'top_right', + '3': 3, + '4': 1, + '5': 1, + '9': 2, + '10': 'topRight', + '17': true + }, + { + '1': 'bottom_left', + '3': 4, + '4': 1, + '5': 1, + '9': 3, + '10': 'bottomLeft', + '17': true + }, + { + '1': 'bottom_right', + '3': 5, + '4': 1, + '5': 1, + '9': 4, + '10': 'bottomRight', + '17': true + }, ], '8': [ {'1': '_all'}, @@ -372,9 +1288,27 @@ final $typed_data.Uint8List borderRadiusDataDescriptor = $convert.base64Decode( const BorderSideData$json = { '1': 'BorderSideData', '2': [ - {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, + { + '1': 'color', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '9': 0, + '10': 'color', + '17': true + }, {'1': 'width', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'width', '17': true}, - {'1': 'style', '3': 3, '4': 1, '5': 14, '6': '.flutter_sdui.BorderStyleProto', '9': 2, '10': 'style', '17': true}, + { + '1': 'style', + '3': 3, + '4': 1, + '5': 14, + '6': '.flutter_sdui.BorderStyleProto', + '9': 2, + '10': 'style', + '17': true + }, ], '8': [ {'1': '_color'}, @@ -394,11 +1328,56 @@ final $typed_data.Uint8List borderSideDataDescriptor = $convert.base64Decode( const BorderData$json = { '1': 'BorderData', '2': [ - {'1': 'top', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 0, '10': 'top', '17': true}, - {'1': 'right', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 1, '10': 'right', '17': true}, - {'1': 'bottom', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 2, '10': 'bottom', '17': true}, - {'1': 'left', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 3, '10': 'left', '17': true}, - {'1': 'all', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.BorderSideData', '9': 4, '10': 'all', '17': true}, + { + '1': 'top', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderSideData', + '9': 0, + '10': 'top', + '17': true + }, + { + '1': 'right', + '3': 2, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderSideData', + '9': 1, + '10': 'right', + '17': true + }, + { + '1': 'bottom', + '3': 3, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderSideData', + '9': 2, + '10': 'bottom', + '17': true + }, + { + '1': 'left', + '3': 4, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderSideData', + '9': 3, + '10': 'left', + '17': true + }, + { + '1': 'all', + '3': 5, + '4': 1, + '5': 11, + '6': '.flutter_sdui.BorderSideData', + '9': 4, + '10': 'all', + '17': true + }, ], '8': [ {'1': '_top'}, @@ -423,11 +1402,52 @@ final $typed_data.Uint8List borderDataDescriptor = $convert.base64Decode( const BoxShadowData$json = { '1': 'BoxShadowData', '2': [ - {'1': 'color', '3': 1, '4': 1, '5': 11, '6': '.flutter_sdui.ColorData', '9': 0, '10': 'color', '17': true}, - {'1': 'offset_x', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'offsetX', '17': true}, - {'1': 'offset_y', '3': 3, '4': 1, '5': 1, '9': 2, '10': 'offsetY', '17': true}, - {'1': 'blur_radius', '3': 4, '4': 1, '5': 1, '9': 3, '10': 'blurRadius', '17': true}, - {'1': 'spread_radius', '3': 5, '4': 1, '5': 1, '9': 4, '10': 'spreadRadius', '17': true}, + { + '1': 'color', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '9': 0, + '10': 'color', + '17': true + }, + { + '1': 'offset_x', + '3': 2, + '4': 1, + '5': 1, + '9': 1, + '10': 'offsetX', + '17': true + }, + { + '1': 'offset_y', + '3': 3, + '4': 1, + '5': 1, + '9': 2, + '10': 'offsetY', + '17': true + }, + { + '1': 'blur_radius', + '3': 4, + '4': 1, + '5': 1, + '9': 3, + '10': 'blurRadius', + '17': true + }, + { + '1': 'spread_radius', + '3': 5, + '4': 1, + '5': 1, + '9': 4, + '10': 'spreadRadius', + '17': true + }, ], '8': [ {'1': '_color'}, @@ -451,15 +1471,72 @@ final $typed_data.Uint8List boxShadowDataDescriptor = $convert.base64Decode( const GradientData$json = { '1': 'GradientData', '2': [ - {'1': 'type', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.GradientData.GradientType', '10': 'type'}, - {'1': 'colors', '3': 2, '4': 3, '5': 11, '6': '.flutter_sdui.ColorData', '10': 'colors'}, + { + '1': 'type', + '3': 1, + '4': 1, + '5': 14, + '6': '.flutter_sdui.GradientData.GradientType', + '10': 'type' + }, + { + '1': 'colors', + '3': 2, + '4': 3, + '5': 11, + '6': '.flutter_sdui.ColorData', + '10': 'colors' + }, {'1': 'stops', '3': 3, '4': 3, '5': 1, '10': 'stops'}, - {'1': 'begin', '3': 4, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 0, '10': 'begin', '17': true}, - {'1': 'end', '3': 5, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 1, '10': 'end', '17': true}, - {'1': 'center', '3': 6, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 2, '10': 'center', '17': true}, + { + '1': 'begin', + '3': 4, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '9': 0, + '10': 'begin', + '17': true + }, + { + '1': 'end', + '3': 5, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '9': 1, + '10': 'end', + '17': true + }, + { + '1': 'center', + '3': 6, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '9': 2, + '10': 'center', + '17': true + }, {'1': 'radius', '3': 7, '4': 1, '5': 1, '9': 3, '10': 'radius', '17': true}, - {'1': 'start_angle', '3': 8, '4': 1, '5': 1, '9': 4, '10': 'startAngle', '17': true}, - {'1': 'end_angle', '3': 9, '4': 1, '5': 1, '9': 5, '10': 'endAngle', '17': true}, + { + '1': 'start_angle', + '3': 8, + '4': 1, + '5': 1, + '9': 4, + '10': 'startAngle', + '17': true + }, + { + '1': 'end_angle', + '3': 9, + '4': 1, + '5': 1, + '9': 5, + '10': 'endAngle', + '17': true + }, ], '4': [GradientData_GradientType$json], '8': [ @@ -501,8 +1578,24 @@ final $typed_data.Uint8List gradientDataDescriptor = $convert.base64Decode( const AlignmentData$json = { '1': 'AlignmentData', '2': [ - {'1': 'predefined', '3': 1, '4': 1, '5': 14, '6': '.flutter_sdui.AlignmentData.PredefinedAlignment', '9': 0, '10': 'predefined'}, - {'1': 'xy', '3': 2, '4': 1, '5': 11, '6': '.flutter_sdui.XYAlignment', '9': 0, '10': 'xy'}, + { + '1': 'predefined', + '3': 1, + '4': 1, + '5': 14, + '6': '.flutter_sdui.AlignmentData.PredefinedAlignment', + '9': 0, + '10': 'predefined' + }, + { + '1': 'xy', + '3': 2, + '4': 1, + '5': 11, + '6': '.flutter_sdui.XYAlignment', + '9': 0, + '10': 'xy' + }, ], '4': [AlignmentData_PredefinedAlignment$json], '8': [ @@ -518,7 +1611,7 @@ const AlignmentData_PredefinedAlignment$json = { {'1': 'BOTTOM_CENTER', '2': 1}, {'1': 'BOTTOM_LEFT', '2': 2}, {'1': 'BOTTOM_RIGHT', '2': 3}, - {'1': 'CENTER', '2': 4}, + {'1': 'CENTER_ALIGN', '2': 4}, {'1': 'CENTER_LEFT', '2': 5}, {'1': 'CENTER_RIGHT', '2': 6}, {'1': 'TOP_CENTER', '2': 7}, @@ -531,11 +1624,11 @@ const AlignmentData_PredefinedAlignment$json = { final $typed_data.Uint8List alignmentDataDescriptor = $convert.base64Decode( 'Cg1BbGlnbm1lbnREYXRhElEKCnByZWRlZmluZWQYASABKA4yLy5mbHV0dGVyX3NkdWkuQWxpZ2' '5tZW50RGF0YS5QcmVkZWZpbmVkQWxpZ25tZW50SABSCnByZWRlZmluZWQSKwoCeHkYAiABKAsy' - 'GS5mbHV0dGVyX3NkdWkuWFlBbGlnbm1lbnRIAFICeHkizQEKE1ByZWRlZmluZWRBbGlnbm1lbn' + 'GS5mbHV0dGVyX3NkdWkuWFlBbGlnbm1lbnRIAFICeHki0wEKE1ByZWRlZmluZWRBbGlnbm1lbn' 'QSJAogUFJFREVGSU5FRF9BTElHTk1FTlRfVU5TUEVDSUZJRUQQABIRCg1CT1RUT01fQ0VOVEVS' - 'EAESDwoLQk9UVE9NX0xFRlQQAhIQCgxCT1RUT01fUklHSFQQAxIKCgZDRU5URVIQBBIPCgtDRU' - '5URVJfTEVGVBAFEhAKDENFTlRFUl9SSUdIVBAGEg4KClRPUF9DRU5URVIQBxIMCghUT1BfTEVG' - 'VBAIEg0KCVRPUF9SSUdIVBAJQhAKDmFsaWdubWVudF90eXBl'); + 'EAESDwoLQk9UVE9NX0xFRlQQAhIQCgxCT1RUT01fUklHSFQQAxIQCgxDRU5URVJfQUxJR04QBB' + 'IPCgtDRU5URVJfTEVGVBAFEhAKDENFTlRFUl9SSUdIVBAGEg4KClRPUF9DRU5URVIQBxIMCghU' + 'T1BfTEVGVBAIEg0KCVRPUF9SSUdIVBAJQhAKDmFsaWdubWVudF90eXBl'); @$core.Deprecated('Use xYAlignmentDescriptor instead') const XYAlignment$json = { @@ -547,23 +1640,91 @@ const XYAlignment$json = { }; /// Descriptor for `XYAlignment`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List xYAlignmentDescriptor = $convert.base64Decode( - 'CgtYWUFsaWdubWVudBIMCgF4GAEgASgBUgF4EgwKAXkYAiABKAFSAXk='); +final $typed_data.Uint8List xYAlignmentDescriptor = $convert + .base64Decode('CgtYWUFsaWdubWVudBIMCgF4GAEgASgBUgF4EgwKAXkYAiABKAFSAXk='); @$core.Deprecated('Use decorationImageDataDescriptor instead') const DecorationImageData$json = { '1': 'DecorationImageData', '2': [ {'1': 'src', '3': 1, '4': 1, '5': 9, '10': 'src'}, - {'1': 'fit', '3': 2, '4': 1, '5': 14, '6': '.flutter_sdui.BoxFitProto', '9': 0, '10': 'fit', '17': true}, - {'1': 'alignment', '3': 3, '4': 1, '5': 11, '6': '.flutter_sdui.AlignmentData', '9': 1, '10': 'alignment', '17': true}, - {'1': 'repeat', '3': 4, '4': 1, '5': 14, '6': '.flutter_sdui.ImageRepeatProto', '9': 2, '10': 'repeat', '17': true}, - {'1': 'match_text_direction', '3': 5, '4': 1, '5': 8, '9': 3, '10': 'matchTextDirection', '17': true}, + { + '1': 'fit', + '3': 2, + '4': 1, + '5': 14, + '6': '.flutter_sdui.BoxFitProto', + '9': 0, + '10': 'fit', + '17': true + }, + { + '1': 'alignment', + '3': 3, + '4': 1, + '5': 11, + '6': '.flutter_sdui.AlignmentData', + '9': 1, + '10': 'alignment', + '17': true + }, + { + '1': 'repeat', + '3': 4, + '4': 1, + '5': 14, + '6': '.flutter_sdui.ImageRepeatProto', + '9': 2, + '10': 'repeat', + '17': true + }, + { + '1': 'match_text_direction', + '3': 5, + '4': 1, + '5': 8, + '9': 3, + '10': 'matchTextDirection', + '17': true + }, {'1': 'scale', '3': 6, '4': 1, '5': 1, '9': 4, '10': 'scale', '17': true}, - {'1': 'opacity', '3': 7, '4': 1, '5': 1, '9': 5, '10': 'opacity', '17': true}, - {'1': 'filter_quality', '3': 8, '4': 1, '5': 14, '6': '.flutter_sdui.FilterQualityProto', '9': 6, '10': 'filterQuality', '17': true}, - {'1': 'invert_colors', '3': 9, '4': 1, '5': 8, '9': 7, '10': 'invertColors', '17': true}, - {'1': 'is_anti_alias', '3': 10, '4': 1, '5': 8, '9': 8, '10': 'isAntiAlias', '17': true}, + { + '1': 'opacity', + '3': 7, + '4': 1, + '5': 1, + '9': 5, + '10': 'opacity', + '17': true + }, + { + '1': 'filter_quality', + '3': 8, + '4': 1, + '5': 14, + '6': '.flutter_sdui.FilterQualityProto', + '9': 6, + '10': 'filterQuality', + '17': true + }, + { + '1': 'invert_colors', + '3': 9, + '4': 1, + '5': 8, + '9': 7, + '10': 'invertColors', + '17': true + }, + { + '1': 'is_anti_alias', + '3': 10, + '4': 1, + '5': 8, + '9': 8, + '10': 'isAntiAlias', + '17': true + }, ], '8': [ {'1': '_fit'}, @@ -593,6 +1754,250 @@ final $typed_data.Uint8List decorationImageDataDescriptor = $convert.base64Decod 'ZUIKCghfb3BhY2l0eUIRCg9fZmlsdGVyX3F1YWxpdHlCEAoOX2ludmVydF9jb2xvcnNCEAoOX2' 'lzX2FudGlfYWxpYXM='); +@$core.Deprecated('Use boxConstraintsDataDescriptor instead') +const BoxConstraintsData$json = { + '1': 'BoxConstraintsData', + '2': [ + { + '1': 'min_width', + '3': 1, + '4': 1, + '5': 1, + '9': 0, + '10': 'minWidth', + '17': true + }, + { + '1': 'max_width', + '3': 2, + '4': 1, + '5': 1, + '9': 1, + '10': 'maxWidth', + '17': true + }, + { + '1': 'min_height', + '3': 3, + '4': 1, + '5': 1, + '9': 2, + '10': 'minHeight', + '17': true + }, + { + '1': 'max_height', + '3': 4, + '4': 1, + '5': 1, + '9': 3, + '10': 'maxHeight', + '17': true + }, + ], + '8': [ + {'1': '_min_width'}, + {'1': '_max_width'}, + {'1': '_min_height'}, + {'1': '_max_height'}, + ], +}; + +/// Descriptor for `BoxConstraintsData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List boxConstraintsDataDescriptor = $convert.base64Decode( + 'ChJCb3hDb25zdHJhaW50c0RhdGESIAoJbWluX3dpZHRoGAEgASgBSABSCG1pbldpZHRoiAEBEi' + 'AKCW1heF93aWR0aBgCIAEoAUgBUghtYXhXaWR0aIgBARIiCgptaW5faGVpZ2h0GAMgASgBSAJS' + 'CW1pbkhlaWdodIgBARIiCgptYXhfaGVpZ2h0GAQgASgBSANSCW1heEhlaWdodIgBAUIMCgpfbW' + 'luX3dpZHRoQgwKCl9tYXhfd2lkdGhCDQoLX21pbl9oZWlnaHRCDQoLX21heF9oZWlnaHQ='); + +@$core.Deprecated('Use transformDataDescriptor instead') +const TransformData$json = { + '1': 'TransformData', + '2': [ + { + '1': 'type', + '3': 1, + '4': 1, + '5': 14, + '6': '.flutter_sdui.TransformData.TransformType', + '10': 'type' + }, + {'1': 'matrix_values', '3': 2, '4': 3, '5': 1, '10': 'matrixValues'}, + { + '1': 'translate_x', + '3': 3, + '4': 1, + '5': 1, + '9': 0, + '10': 'translateX', + '17': true + }, + { + '1': 'translate_y', + '3': 4, + '4': 1, + '5': 1, + '9': 1, + '10': 'translateY', + '17': true + }, + { + '1': 'translate_z', + '3': 5, + '4': 1, + '5': 1, + '9': 2, + '10': 'translateZ', + '17': true + }, + { + '1': 'rotation_angle', + '3': 6, + '4': 1, + '5': 1, + '9': 3, + '10': 'rotationAngle', + '17': true + }, + { + '1': 'rotation_x', + '3': 7, + '4': 1, + '5': 1, + '9': 4, + '10': 'rotationX', + '17': true + }, + { + '1': 'rotation_y', + '3': 8, + '4': 1, + '5': 1, + '9': 5, + '10': 'rotationY', + '17': true + }, + { + '1': 'rotation_z', + '3': 9, + '4': 1, + '5': 1, + '9': 6, + '10': 'rotationZ', + '17': true + }, + { + '1': 'scale_x', + '3': 10, + '4': 1, + '5': 1, + '9': 7, + '10': 'scaleX', + '17': true + }, + { + '1': 'scale_y', + '3': 11, + '4': 1, + '5': 1, + '9': 8, + '10': 'scaleY', + '17': true + }, + { + '1': 'scale_z', + '3': 12, + '4': 1, + '5': 1, + '9': 9, + '10': 'scaleZ', + '17': true + }, + ], + '4': [TransformData_TransformType$json], + '8': [ + {'1': '_translate_x'}, + {'1': '_translate_y'}, + {'1': '_translate_z'}, + {'1': '_rotation_angle'}, + {'1': '_rotation_x'}, + {'1': '_rotation_y'}, + {'1': '_rotation_z'}, + {'1': '_scale_x'}, + {'1': '_scale_y'}, + {'1': '_scale_z'}, + ], +}; + +@$core.Deprecated('Use transformDataDescriptor instead') +const TransformData_TransformType$json = { + '1': 'TransformType', + '2': [ + {'1': 'TRANSFORM_TYPE_UNSPECIFIED', '2': 0}, + {'1': 'MATRIX_4X4', '2': 1}, + {'1': 'TRANSLATE', '2': 2}, + {'1': 'ROTATE', '2': 3}, + {'1': 'SCALE', '2': 4}, + ], +}; + +/// Descriptor for `TransformData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List transformDataDescriptor = $convert.base64Decode( + 'Cg1UcmFuc2Zvcm1EYXRhEj0KBHR5cGUYASABKA4yKS5mbHV0dGVyX3NkdWkuVHJhbnNmb3JtRG' + 'F0YS5UcmFuc2Zvcm1UeXBlUgR0eXBlEiMKDW1hdHJpeF92YWx1ZXMYAiADKAFSDG1hdHJpeFZh' + 'bHVlcxIkCgt0cmFuc2xhdGVfeBgDIAEoAUgAUgp0cmFuc2xhdGVYiAEBEiQKC3RyYW5zbGF0ZV' + '95GAQgASgBSAFSCnRyYW5zbGF0ZVmIAQESJAoLdHJhbnNsYXRlX3oYBSABKAFIAlIKdHJhbnNs' + 'YXRlWogBARIqCg5yb3RhdGlvbl9hbmdsZRgGIAEoAUgDUg1yb3RhdGlvbkFuZ2xliAEBEiIKCn' + 'JvdGF0aW9uX3gYByABKAFIBFIJcm90YXRpb25YiAEBEiIKCnJvdGF0aW9uX3kYCCABKAFIBVIJ' + 'cm90YXRpb25ZiAEBEiIKCnJvdGF0aW9uX3oYCSABKAFIBlIJcm90YXRpb25aiAEBEhwKB3NjYW' + 'xlX3gYCiABKAFIB1IGc2NhbGVYiAEBEhwKB3NjYWxlX3kYCyABKAFICFIGc2NhbGVZiAEBEhwK' + 'B3NjYWxlX3oYDCABKAFICVIGc2NhbGVaiAEBImUKDVRyYW5zZm9ybVR5cGUSHgoaVFJBTlNGT1' + 'JNX1RZUEVfVU5TUEVDSUZJRUQQABIOCgpNQVRSSVhfNFg0EAESDQoJVFJBTlNMQVRFEAISCgoG' + 'Uk9UQVRFEAMSCQoFU0NBTEUQBEIOCgxfdHJhbnNsYXRlX3hCDgoMX3RyYW5zbGF0ZV95Qg4KDF' + '90cmFuc2xhdGVfekIRCg9fcm90YXRpb25fYW5nbGVCDQoLX3JvdGF0aW9uX3hCDQoLX3JvdGF0' + 'aW9uX3lCDQoLX3JvdGF0aW9uX3pCCgoIX3NjYWxlX3hCCgoIX3NjYWxlX3lCCgoIX3NjYWxlX3' + 'o='); + +@$core.Deprecated('Use rectDataDescriptor instead') +const RectData$json = { + '1': 'RectData', + '2': [ + {'1': 'left', '3': 1, '4': 1, '5': 1, '10': 'left'}, + {'1': 'top', '3': 2, '4': 1, '5': 1, '10': 'top'}, + {'1': 'right', '3': 3, '4': 1, '5': 1, '10': 'right'}, + {'1': 'bottom', '3': 4, '4': 1, '5': 1, '10': 'bottom'}, + ], +}; + +/// Descriptor for `RectData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List rectDataDescriptor = $convert.base64Decode( + 'CghSZWN0RGF0YRISCgRsZWZ0GAEgASgBUgRsZWZ0EhAKA3RvcBgCIAEoAVIDdG9wEhQKBXJpZ2' + 'h0GAMgASgBUgVyaWdodBIWCgZib3R0b20YBCABKAFSBmJvdHRvbQ=='); + +@$core.Deprecated('Use shadowDataDescriptor instead') +const ShadowData$json = { + '1': 'ShadowData', + '2': [ + { + '1': 'color', + '3': 1, + '4': 1, + '5': 11, + '6': '.flutter_sdui.ColorData', + '10': 'color' + }, + {'1': 'offset_x', '3': 2, '4': 1, '5': 1, '10': 'offsetX'}, + {'1': 'offset_y', '3': 3, '4': 1, '5': 1, '10': 'offsetY'}, + {'1': 'blur_radius', '3': 4, '4': 1, '5': 1, '10': 'blurRadius'}, + ], +}; + +/// Descriptor for `ShadowData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List shadowDataDescriptor = $convert.base64Decode( + 'CgpTaGFkb3dEYXRhEi0KBWNvbG9yGAEgASgLMhcuZmx1dHRlcl9zZHVpLkNvbG9yRGF0YVIFY2' + '9sb3ISGQoIb2Zmc2V0X3gYAiABKAFSB29mZnNldFgSGQoIb2Zmc2V0X3kYAyABKAFSB29mZnNl' + 'dFkSHwoLYmx1cl9yYWRpdXMYBCABKAFSCmJsdXJSYWRpdXM='); + @$core.Deprecated('Use sduiRequestDescriptor instead') const SduiRequest$json = { '1': 'SduiRequest', @@ -602,6 +2007,5 @@ const SduiRequest$json = { }; /// Descriptor for `SduiRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List sduiRequestDescriptor = $convert.base64Decode( - 'CgtTZHVpUmVxdWVzdBIbCglzY3JlZW5faWQYASABKAlSCHNjcmVlbklk'); - +final $typed_data.Uint8List sduiRequestDescriptor = $convert + .base64Decode('CgtTZHVpUmVxdWVzdBIbCglzY3JlZW5faWQYASABKAlSCHNjcmVlbklk'); diff --git a/lib/src/parser/sdui_proto_parser.dart b/lib/src/parser/sdui_proto_parser.dart index 9040329..9411281 100644 --- a/lib/src/parser/sdui_proto_parser.dart +++ b/lib/src/parser/sdui_proto_parser.dart @@ -1,3 +1,4 @@ +// ignore_for_file: dead_null_aware_expression import 'dart:developer'; import 'package:flutter/material.dart'; @@ -14,7 +15,7 @@ import 'package:flutter_sdui/src/widgets/sdui_text.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; // Parser for Protobuf definitions for SDUI -class SduiProtoParser { +class SduiParser { // Parse method for JSON data static SduiWidget parseJSON(Map data) { // TODO: Implement JSON parsing logic @@ -50,24 +51,66 @@ class SduiProtoParser { // Helper methods to parse specific widget types from protobuf static SduiColumn _parseProtoColumn(SduiWidgetData data) { - List children = data.children - .map((child) => SduiProtoParser.parseProto(child)) - .toList(); - return SduiColumn(children: children); + List children = + data.children.map((child) => SduiParser.parseProto(child)).toList(); + + return SduiColumn( + children: children, + mainAxisAlignment: _parseProtoMainAxisAlignment(data.mainAxisAlignment), + crossAxisAlignment: + _parseProtoCrossAxisAlignment(data.crossAxisAlignment), + mainAxisSize: _parseProtoMainAxisSize(data.mainAxisSize), + textDirection: _parseProtoTextDirection(data.textDirection), + verticalDirection: _parseProtoVerticalDirection(data.verticalDirection), + textBaseline: _parseProtoTextBaseline(data.textBaseline), + ); } static SduiRow _parseProtoRow(SduiWidgetData data) { - List children = data.children - .map((child) => SduiProtoParser.parseProto(child)) - .toList(); - return SduiRow(children: children); + List children = + data.children.map((child) => SduiParser.parseProto(child)).toList(); + + return SduiRow( + children: children, + mainAxisAlignment: _parseProtoMainAxisAlignment(data.mainAxisAlignment), + crossAxisAlignment: + _parseProtoCrossAxisAlignment(data.crossAxisAlignment), + mainAxisSize: _parseProtoMainAxisSize(data.mainAxisSize), + textDirection: _parseProtoTextDirection(data.textDirection), + verticalDirection: _parseProtoVerticalDirection(data.verticalDirection), + textBaseline: _parseProtoTextBaseline(data.textBaseline), + ); } static SduiText _parseProtoText(SduiWidgetData data) { String text = data.stringAttributes['text'] ?? ''; TextStyle? style = data.hasTextStyle() ? _parseProtoTextStyle(data.textStyle) : null; - return SduiText(text, style: style); + + // Parse additional text properties + TextAlign? textAlign = _parseProtoTextAlign(data.textAlign); + TextOverflow? overflow = _parseProtoTextOverflow(data.overflow); + int? maxLines = data.hasMaxLines() ? data.maxLines : null; + bool? softWrap = data.hasSoftWrap() ? data.softWrap : null; + double? letterSpacing = data.hasLetterSpacing() ? data.letterSpacing : null; + double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; + double? height = data.hasHeight() ? data.height : null; + String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; + TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); + + return SduiText( + text, + style: style, + textAlign: textAlign, + overflow: overflow, + maxLines: maxLines, + softWrap: softWrap, + letterSpacing: letterSpacing, + wordSpacing: wordSpacing, + height: height, + fontFamily: fontFamily, + textDirection: textDirection, + ); } static SduiImage _parseProtoImage(SduiWidgetData data) { @@ -75,54 +118,167 @@ class SduiProtoParser { double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; BoxFit? fit = _parseProtoBoxFit(data.stringAttributes['fit']); - return SduiImage(src, width: width, height: height, fit: fit); + + // Parse additional image properties + Alignment? alignment = _parseProtoAlignment(data.alignment); + ImageRepeat? repeat = _parseProtoImageRepeat(data.repeat); + Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; + BlendMode? colorBlendMode = _parseProtoBlendMode(data.colorBlendMode); + Rect? centerSlice = + data.hasCenterSlice() ? _parseProtoRect(data.centerSlice) : null; + bool? matchTextDirection = + data.hasMatchTextDirection() ? data.matchTextDirection : null; + bool? gaplessPlayback = + data.hasGaplessPlayback() ? data.gaplessPlayback : null; + FilterQuality? filterQuality = _parseProtoFilterQuality(data.filterQuality); + int? cacheWidth = data.hasCacheWidth() ? data.cacheWidth : null; + int? cacheHeight = data.hasCacheHeight() ? data.cacheHeight : null; + double? scale = data.hasScale() ? data.scale : null; + String? semanticLabel = data.hasSemanticLabel() ? data.semanticLabel : null; + + // Parse error and loading widgets + Widget? errorWidget = data.hasErrorWidget() + ? SduiParser.parseProto(data.errorWidget).toFlutterWidget() + : null; + Widget? loadingWidget = data.hasLoadingWidget() + ? SduiParser.parseProto(data.loadingWidget).toFlutterWidget() + : null; + + return SduiImage( + src, + width: width, + height: height, + fit: fit, + alignment: alignment, + repeat: repeat, + color: color, + colorBlendMode: colorBlendMode, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + scale: scale, + semanticLabel: semanticLabel, + errorWidget: errorWidget, + loadingWidget: loadingWidget, + ); } static SduiSizedBox _parseProtoSizedBox(SduiWidgetData data) { double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; SduiWidget? child = - data.hasChild() ? SduiProtoParser.parseProto(data.child) : null; + data.hasChild() ? SduiParser.parseProto(data.child) : null; return SduiSizedBox(width: width, height: height, child: child); } static SduiContainer _parseProtoContainer(SduiWidgetData data) { SduiWidget? child = - data.hasChild() ? SduiProtoParser.parseProto(data.child) : null; + data.hasChild() ? SduiParser.parseProto(data.child) : null; EdgeInsets? padding = data.hasPadding() ? _parseProtoEdgeInsets(data.padding) : null; + EdgeInsets? margin = + data.hasMargin() ? _parseProtoEdgeInsets(data.margin) : null; BoxDecoration? decoration = data.hasBoxDecoration() ? _parseProtoBoxDecoration(data.boxDecoration) : null; double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; + Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; + + // Parse additional container properties + Alignment? alignment = _parseProtoAlignment(data.alignment); + BoxConstraints? constraints = data.hasConstraints() + ? _parseProtoBoxConstraints(data.constraints) + : null; + Matrix4? transform = + data.hasTransform() ? _parseProtoTransform(data.transform) : null; + AlignmentGeometry? transformAlignment = data.hasTransformAlignment() + ? _parseProtoAlignmentGeometry(data.transformAlignment) + : null; + Clip? clipBehavior = _parseProtoClip(data.clipBehavior); return SduiContainer( child: child, padding: padding, + margin: margin, decoration: decoration, width: width, height: height, + color: color, + alignment: alignment, + constraints: constraints, + transform: transform, + transformAlignment: transformAlignment, + clipBehavior: clipBehavior, ); } static SduiScaffold _parseProtoScaffold(SduiWidgetData data) { SduiWidget? appBar = - data.hasAppBar() ? SduiProtoParser.parseProto(data.appBar) : null; - SduiWidget? body = - data.hasBody() ? SduiProtoParser.parseProto(data.body) : null; + data.hasAppBar() ? SduiParser.parseProto(data.appBar) : null; + SduiWidget? body = data.hasBody() ? SduiParser.parseProto(data.body) : null; SduiWidget? floatingActionButton = data.hasFloatingActionButton() - ? SduiProtoParser.parseProto(data.floatingActionButton) + ? SduiParser.parseProto(data.floatingActionButton) : null; Color? backgroundColor = data.hasBackgroundColor() ? _parseProtoColor(data.backgroundColor) : null; + // Parse additional scaffold properties + SduiWidget? bottomNavigationBar = data.hasBottomNavigationBar() + ? SduiParser.parseProto(data.bottomNavigationBar) + : null; + SduiWidget? drawer = + data.hasDrawer() ? SduiParser.parseProto(data.drawer) : null; + SduiWidget? endDrawer = + data.hasEndDrawer() ? SduiParser.parseProto(data.endDrawer) : null; + SduiWidget? bottomSheet = + data.hasBottomSheet() ? SduiParser.parseProto(data.bottomSheet) : null; + bool? resizeToAvoidBottomInset = data.hasResizeToAvoidBottomInset() + ? data.resizeToAvoidBottomInset + : null; + bool? primary = data.hasPrimary() ? data.primary : null; + FloatingActionButtonLocation? fabLocation = + data.hasFloatingActionButtonLocation() + ? _parseProtoFabLocation(data.floatingActionButtonLocation) + : null; + bool? extendBody = data.hasExtendBody() ? data.extendBody : null; + bool? extendBodyBehindAppBar = + data.hasExtendBodyBehindAppBar() ? data.extendBodyBehindAppBar : null; + Color? drawerScrimColor = data.hasDrawerScrimColor() + ? _parseProtoColor(data.drawerScrimColor) + : null; + double? drawerEdgeDragWidth = + data.hasDrawerEdgeDragWidth() ? data.drawerEdgeDragWidth : null; + bool? drawerEnableOpenDragGesture = data.hasDrawerEnableOpenDragGesture() + ? data.drawerEnableOpenDragGesture + : null; + bool? endDrawerEnableOpenDragGesture = + data.hasEndDrawerEnableOpenDragGesture() + ? data.endDrawerEnableOpenDragGesture + : null; + return SduiScaffold( appBar: appBar, body: body, floatingActionButton: floatingActionButton, backgroundColor: backgroundColor, + bottomNavigationBar: bottomNavigationBar, + drawer: drawer, + endDrawer: endDrawer, + bottomSheet: bottomSheet, + resizeToAvoidBottomInset: resizeToAvoidBottomInset, + primary: primary, + floatingActionButtonLocation: fabLocation, + extendBody: extendBody, + extendBodyBehindAppBar: extendBodyBehindAppBar, + drawerScrimColor: drawerScrimColor, + drawerEdgeDragWidth: drawerEdgeDragWidth, + drawerEnableOpenDragGesture: drawerEnableOpenDragGesture, + endDrawerEnableOpenDragGesture: endDrawerEnableOpenDragGesture, ); } @@ -137,10 +293,25 @@ class SduiProtoParser { Color? color = data.icon.hasColor() ? _parseProtoColor(data.icon.color) : null; + // Parse additional icon properties + String? semanticLabel = data.hasSemanticLabel() ? data.semanticLabel : null; + TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); + double? opacity = data.hasOpacity() ? data.opacity : null; + bool? applyTextScaling = + data.hasApplyTextScaling() ? data.applyTextScaling : null; + List? shadows = data.shadows.isNotEmpty + ? data.shadows.map((s) => _parseProtoShadow(s)).toList() + : null; + return SduiIcon( icon: iconData, size: size, color: color, + semanticLabel: semanticLabel, + textDirection: textDirection, + opacity: opacity, + applyTextScaling: applyTextScaling, + shadows: shadows, ); } @@ -172,11 +343,23 @@ class SduiProtoParser { Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; double? fontSize = data.fontSize; FontWeight? fontWeight = _parseProtoFontWeight(data.fontWeight); + TextDecoration? decoration = _parseProtoTextDecoration(data.decoration); + double? letterSpacing = data.hasLetterSpacing() ? data.letterSpacing : null; + double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; + double? height = data.hasHeight() ? data.height : null; + String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; + FontStyle? fontStyle = _parseProtoFontStyle(data.fontStyle); return TextStyle( color: color, fontSize: fontSize, fontWeight: fontWeight, + decoration: decoration, + letterSpacing: letterSpacing, + wordSpacing: wordSpacing, + height: height, + fontFamily: fontFamily, + fontStyle: fontStyle, ); } @@ -305,4 +488,405 @@ class SduiProtoParser { return BorderRadius.circular(8.0); // Example default value } + + // New helper methods for parsing new property types + + static MainAxisAlignment? _parseProtoMainAxisAlignment( + MainAxisAlignmentProto proto) { + switch (proto) { + case MainAxisAlignmentProto.MAIN_AXIS_START: + return MainAxisAlignment.start; + case MainAxisAlignmentProto.MAIN_AXIS_END: + return MainAxisAlignment.end; + case MainAxisAlignmentProto.MAIN_AXIS_CENTER: + return MainAxisAlignment.center; + case MainAxisAlignmentProto.SPACE_BETWEEN: + return MainAxisAlignment.spaceBetween; + case MainAxisAlignmentProto.SPACE_AROUND: + return MainAxisAlignment.spaceAround; + case MainAxisAlignmentProto.SPACE_EVENLY: + return MainAxisAlignment.spaceEvenly; + default: + return null; + } + } + + static CrossAxisAlignment? _parseProtoCrossAxisAlignment( + CrossAxisAlignmentProto proto) { + switch (proto) { + case CrossAxisAlignmentProto.CROSS_AXIS_START: + return CrossAxisAlignment.start; + case CrossAxisAlignmentProto.CROSS_AXIS_END: + return CrossAxisAlignment.end; + case CrossAxisAlignmentProto.CROSS_AXIS_CENTER: + return CrossAxisAlignment.center; + case CrossAxisAlignmentProto.STRETCH: + return CrossAxisAlignment.stretch; + case CrossAxisAlignmentProto.BASELINE: + return CrossAxisAlignment.baseline; + default: + return null; + } + } + + static MainAxisSize? _parseProtoMainAxisSize(MainAxisSizeProto proto) { + switch (proto) { + case MainAxisSizeProto.MIN: + return MainAxisSize.min; + case MainAxisSizeProto.MAX: + return MainAxisSize.max; + default: + return null; + } + } + + static TextDirection? _parseProtoTextDirection(TextDirectionProto proto) { + switch (proto) { + case TextDirectionProto.LTR: + return TextDirection.ltr; + case TextDirectionProto.RTL: + return TextDirection.rtl; + default: + return null; + } + } + + static VerticalDirection? _parseProtoVerticalDirection( + VerticalDirectionProto proto) { + switch (proto) { + case VerticalDirectionProto.UP: + return VerticalDirection.up; + case VerticalDirectionProto.DOWN: + return VerticalDirection.down; + default: + return null; + } + } + + static TextBaseline? _parseProtoTextBaseline(TextBaselineProto proto) { + switch (proto) { + case TextBaselineProto.ALPHABETIC: + return TextBaseline.alphabetic; + case TextBaselineProto.IDEOGRAPHIC: + return TextBaseline.ideographic; + default: + return null; + } + } + + static Alignment? _parseProtoAlignment(AlignmentData? data) { + if (data == null) return null; + + if (data.hasXy()) { + return Alignment(data.xy.x, data.xy.y); + } + + switch (data.predefined) { + case AlignmentData_PredefinedAlignment.BOTTOM_CENTER: + return Alignment.bottomCenter; + case AlignmentData_PredefinedAlignment.BOTTOM_LEFT: + return Alignment.bottomLeft; + case AlignmentData_PredefinedAlignment.BOTTOM_RIGHT: + return Alignment.bottomRight; + case AlignmentData_PredefinedAlignment.CENTER_ALIGN: + return Alignment.center; + case AlignmentData_PredefinedAlignment.CENTER_LEFT: + return Alignment.centerLeft; + case AlignmentData_PredefinedAlignment.CENTER_RIGHT: + return Alignment.centerRight; + case AlignmentData_PredefinedAlignment.TOP_CENTER: + return Alignment.topCenter; + case AlignmentData_PredefinedAlignment.TOP_LEFT: + return Alignment.topLeft; + case AlignmentData_PredefinedAlignment.TOP_RIGHT: + return Alignment.topRight; + default: + return Alignment.center; + } + } + + static AlignmentGeometry? _parseProtoAlignmentGeometry(AlignmentData? data) { + // For now, just use the same alignment parsing + return _parseProtoAlignment(data); + } + + static BoxConstraints? _parseProtoBoxConstraints(BoxConstraintsData data) { + return BoxConstraints( + minWidth: data.hasMinWidth() ? data.minWidth : 0.0, + maxWidth: data.hasMaxWidth() ? data.maxWidth : double.infinity, + minHeight: data.hasMinHeight() ? data.minHeight : 0.0, + maxHeight: data.hasMaxHeight() ? data.maxHeight : double.infinity, + ); + } + + static Matrix4? _parseProtoTransform(TransformData data) { + switch (data.type) { + case TransformData_TransformType.MATRIX_4X4: + if (data.matrixValues.length == 16) { + return Matrix4( + data.matrixValues[0], + data.matrixValues[1], + data.matrixValues[2], + data.matrixValues[3], + data.matrixValues[4], + data.matrixValues[5], + data.matrixValues[6], + data.matrixValues[7], + data.matrixValues[8], + data.matrixValues[9], + data.matrixValues[10], + data.matrixValues[11], + data.matrixValues[12], + data.matrixValues[13], + data.matrixValues[14], + data.matrixValues[15], + ); + } + return null; + case TransformData_TransformType.TRANSLATE: + return Matrix4.translationValues( + data.translateX ?? 0.0, + data.translateY ?? 0.0, + data.translateZ ?? 0.0, + ); + case TransformData_TransformType.ROTATE: + if (data.hasRotationAngle()) { + return Matrix4.rotationZ(data.rotationAngle); + } + return Matrix4.identity(); + case TransformData_TransformType.SCALE: + return Matrix4.diagonal3Values( + data.scaleX ?? 1.0, + data.scaleY ?? 1.0, + data.scaleZ ?? 1.0, + ); + default: + return null; + } + } + + static Clip? _parseProtoClip(ClipProto proto) { + switch (proto) { + case ClipProto.CLIP_NONE: + return Clip.none; + case ClipProto.HARD_EDGE: + return Clip.hardEdge; + case ClipProto.ANTI_ALIAS: + return Clip.antiAlias; + case ClipProto.ANTI_ALIAS_WITH_SAVE_LAYER: + return Clip.antiAliasWithSaveLayer; + default: + return null; + } + } + + static TextAlign? _parseProtoTextAlign(TextAlignProto proto) { + switch (proto) { + case TextAlignProto.LEFT: + return TextAlign.left; + case TextAlignProto.RIGHT: + return TextAlign.right; + case TextAlignProto.TEXT_ALIGN_CENTER: + return TextAlign.center; + case TextAlignProto.JUSTIFY: + return TextAlign.justify; + case TextAlignProto.TEXT_ALIGN_START: + return TextAlign.start; + case TextAlignProto.TEXT_ALIGN_END: + return TextAlign.end; + default: + return null; + } + } + + static TextOverflow? _parseProtoTextOverflow(TextOverflowProto proto) { + switch (proto) { + case TextOverflowProto.CLIP: + return TextOverflow.clip; + case TextOverflowProto.ELLIPSIS: + return TextOverflow.ellipsis; + case TextOverflowProto.FADE: + return TextOverflow.fade; + case TextOverflowProto.VISIBLE: + return TextOverflow.visible; + default: + return null; + } + } + + static TextDecoration? _parseProtoTextDecoration(TextDecorationProto proto) { + switch (proto) { + case TextDecorationProto.TEXT_DECORATION_NONE: + return TextDecoration.none; + case TextDecorationProto.UNDERLINE: + return TextDecoration.underline; + case TextDecorationProto.OVERLINE: + return TextDecoration.overline; + case TextDecorationProto.LINE_THROUGH: + return TextDecoration.lineThrough; + default: + return null; + } + } + + static FontStyle? _parseProtoFontStyle(FontStyleProto proto) { + switch (proto) { + case FontStyleProto.NORMAL: + return FontStyle.normal; + case FontStyleProto.ITALIC: + return FontStyle.italic; + default: + return null; + } + } + + static Rect? _parseProtoRect(RectData data) { + return Rect.fromLTRB( + data.left, + data.top, + data.right, + data.bottom, + ); + } + + static ImageRepeat? _parseProtoImageRepeat(ImageRepeatProto proto) { + switch (proto) { + case ImageRepeatProto.REPEAT: + return ImageRepeat.repeat; + case ImageRepeatProto.REPEAT_X: + return ImageRepeat.repeatX; + case ImageRepeatProto.REPEAT_Y: + return ImageRepeat.repeatY; + case ImageRepeatProto.NO_REPEAT: + return ImageRepeat.noRepeat; + default: + return null; + } + } + + static BlendMode? _parseProtoBlendMode(BlendModeProto proto) { + switch (proto) { + case BlendModeProto.CLEAR: + return BlendMode.clear; + case BlendModeProto.SRC: + return BlendMode.src; + case BlendModeProto.DST: + return BlendMode.dst; + case BlendModeProto.SRC_OVER: + return BlendMode.srcOver; + case BlendModeProto.DST_OVER: + return BlendMode.dstOver; + case BlendModeProto.SRC_IN: + return BlendMode.srcIn; + case BlendModeProto.DST_IN: + return BlendMode.dstIn; + case BlendModeProto.SRC_OUT: + return BlendMode.srcOut; + case BlendModeProto.DST_OUT: + return BlendMode.dstOut; + case BlendModeProto.SRC_ATOP: + return BlendMode.srcATop; + case BlendModeProto.DST_ATOP: + return BlendMode.dstATop; + case BlendModeProto.XOR: + return BlendMode.xor; + case BlendModeProto.PLUS: + return BlendMode.plus; + case BlendModeProto.MODULATE: + return BlendMode.modulate; + case BlendModeProto.SCREEN: + return BlendMode.screen; + case BlendModeProto.OVERLAY: + return BlendMode.overlay; + case BlendModeProto.DARKEN: + return BlendMode.darken; + case BlendModeProto.LIGHTEN: + return BlendMode.lighten; + case BlendModeProto.COLOR_DODGE: + return BlendMode.colorDodge; + case BlendModeProto.COLOR_BURN: + return BlendMode.colorBurn; + case BlendModeProto.HARD_LIGHT: + return BlendMode.hardLight; + case BlendModeProto.SOFT_LIGHT: + return BlendMode.softLight; + case BlendModeProto.DIFFERENCE: + return BlendMode.difference; + case BlendModeProto.EXCLUSION: + return BlendMode.exclusion; + case BlendModeProto.MULTIPLY: + return BlendMode.multiply; + case BlendModeProto.HUE: + return BlendMode.hue; + case BlendModeProto.SATURATION: + return BlendMode.saturation; + case BlendModeProto.COLOR: + return BlendMode.color; + case BlendModeProto.LUMINOSITY: + return BlendMode.luminosity; + default: + return null; + } + } + + static FilterQuality? _parseProtoFilterQuality(FilterQualityProto proto) { + switch (proto) { + case FilterQualityProto.NONE_FQ: + return FilterQuality.none; + case FilterQualityProto.LOW: + return FilterQuality.low; + case FilterQualityProto.MEDIUM: + return FilterQuality.medium; + case FilterQualityProto.HIGH: + return FilterQuality.high; + default: + return null; + } + } + + static Shadow _parseProtoShadow(ShadowData data) { + return Shadow( + color: _parseProtoColor(data.color) ?? Colors.black, + offset: Offset(data.offsetX, data.offsetY), + blurRadius: data.blurRadius, + ); + } + + static FloatingActionButtonLocation? _parseProtoFabLocation( + FloatingActionButtonLocationProto proto) { + switch (proto) { + case FloatingActionButtonLocationProto.FAB_START_TOP: + return FloatingActionButtonLocation.startTop; + case FloatingActionButtonLocationProto.FAB_START: + return FloatingActionButtonLocation.startFloat; + case FloatingActionButtonLocationProto.FAB_START_FLOAT: + return FloatingActionButtonLocation.startFloat; + case FloatingActionButtonLocationProto.FAB_CENTER_TOP: + return FloatingActionButtonLocation.centerTop; + case FloatingActionButtonLocationProto.FAB_CENTER: + return FloatingActionButtonLocation.centerFloat; + case FloatingActionButtonLocationProto.FAB_CENTER_FLOAT: + return FloatingActionButtonLocation.centerFloat; + case FloatingActionButtonLocationProto.FAB_END_TOP: + return FloatingActionButtonLocation.endTop; + case FloatingActionButtonLocationProto.FAB_END: + return FloatingActionButtonLocation.endFloat; + case FloatingActionButtonLocationProto.FAB_END_FLOAT: + return FloatingActionButtonLocation.endFloat; + case FloatingActionButtonLocationProto.FAB_MINI_CENTER_TOP: + return FloatingActionButtonLocation.miniCenterTop; + case FloatingActionButtonLocationProto.FAB_MINI_CENTER_FLOAT: + return FloatingActionButtonLocation.miniCenterFloat; + case FloatingActionButtonLocationProto.FAB_MINI_START_TOP: + return FloatingActionButtonLocation.miniStartTop; + case FloatingActionButtonLocationProto.FAB_MINI_START_FLOAT: + return FloatingActionButtonLocation.miniStartFloat; + case FloatingActionButtonLocationProto.FAB_MINI_END_TOP: + return FloatingActionButtonLocation.miniEndTop; + case FloatingActionButtonLocationProto.FAB_MINI_END_FLOAT: + return FloatingActionButtonLocation.miniEndFloat; + default: + return null; + } + } } diff --git a/lib/src/protos/sdui.proto b/lib/src/protos/sdui.proto index ff36755..5158e71 100644 --- a/lib/src/protos/sdui.proto +++ b/lib/src/protos/sdui.proto @@ -28,7 +28,7 @@ message SduiWidgetData { // Complex nested attributes TextStyleData text_style = 6; EdgeInsetsData padding = 7; - EdgeInsetsData margin = 8; // Example, if we add margin later + EdgeInsetsData margin = 8; ColorData color = 9; // General purpose color IconDataMessage icon = 10; BoxDecorationData box_decoration = 11; @@ -42,6 +42,65 @@ message SduiWidgetData { SduiWidgetData body = 15; // Body can also be a single child SduiWidgetData floating_action_button = 16; ColorData background_color = 17; // For Scaffold background + + // New Scaffold attributes + SduiWidgetData bottom_navigation_bar = 18; + SduiWidgetData drawer = 19; + SduiWidgetData end_drawer = 20; + SduiWidgetData bottom_sheet = 21; + bool resize_to_avoid_bottom_inset = 22; + bool primary = 23; + FloatingActionButtonLocationProto floating_action_button_location = 24; + bool extend_body = 25; + bool extend_body_behind_app_bar = 26; + ColorData drawer_scrim_color = 27; + double drawer_edge_drag_width = 28; + bool drawer_enable_open_drag_gesture = 29; + bool end_drawer_enable_open_drag_gesture = 30; + + // Layout attributes for Row and Column + MainAxisAlignmentProto main_axis_alignment = 31; + CrossAxisAlignmentProto cross_axis_alignment = 32; + MainAxisSizeProto main_axis_size = 33; + TextDirectionProto text_direction = 34; + VerticalDirectionProto vertical_direction = 35; + TextBaselineProto text_baseline = 36; + + // Container specific attributes + AlignmentData alignment = 37; + BoxConstraintsData constraints = 38; + TransformData transform = 39; + AlignmentData transform_alignment = 40; + ClipProto clip_behavior = 41; + + // Text specific attributes + TextAlignProto text_align = 42; + TextOverflowProto overflow = 43; + int32 max_lines = 44; + bool soft_wrap = 45; + double letter_spacing = 46; + double word_spacing = 47; + double height = 48; + string font_family = 49; + + // Image specific attributes + ImageRepeatProto repeat = 50; + BlendModeProto color_blend_mode = 51; + RectData center_slice = 52; + bool match_text_direction = 53; + bool gapless_playback = 54; + FilterQualityProto filter_quality = 55; + int32 cache_width = 56; + int32 cache_height = 57; + double scale = 58; + string semantic_label = 59; + SduiWidgetData error_widget = 60; + SduiWidgetData loading_widget = 61; + + // Icon specific attributes + double opacity = 62; + bool apply_text_scaling = 63; + repeated ShadowData shadows = 64; } // Message for Color @@ -68,6 +127,12 @@ message TextStyleData { optional ColorData color = 1; optional double font_size = 2; optional string font_weight = 3; // e.g., "bold", "w500" + optional TextDecorationProto decoration = 4; + optional double letter_spacing = 5; + optional double word_spacing = 6; + optional double height = 7; + optional string font_family = 8; + optional FontStyleProto font_style = 9; // Add other TextStyle properties: fontFamily, fontStyle, letterSpacing, etc. } @@ -88,7 +153,7 @@ enum BoxFitProto { COVER = 3; FIT_WIDTH = 4; FIT_HEIGHT = 5; - NONE = 6; + NONE_BOX_FIT = 6; // Renamed from NONE SCALE_DOWN = 7; } @@ -173,7 +238,7 @@ message AlignmentData { BOTTOM_CENTER = 1; BOTTOM_LEFT = 2; BOTTOM_RIGHT = 3; - CENTER = 4; + CENTER_ALIGN = 4; // Renamed from CENTER CENTER_LEFT = 5; CENTER_RIGHT = 6; TOP_CENTER = 7; @@ -191,7 +256,6 @@ message XYAlignment { double y = 2; } - // Enum for BoxShape enum BoxShapeProto { BOX_SHAPE_UNSPECIFIED = 0; @@ -231,7 +295,203 @@ enum FilterQualityProto { HIGH = 4; } -// Service definition (optional for now, but good for future gRPC) +// New enums for Row and Column properties +enum MainAxisAlignmentProto { + MAIN_AXIS_ALIGNMENT_UNSPECIFIED = 0; + MAIN_AXIS_START = 1; // Renamed from START + MAIN_AXIS_END = 2; // Renamed from END + MAIN_AXIS_CENTER = 3; // Renamed from CENTER + SPACE_BETWEEN = 4; + SPACE_AROUND = 5; + SPACE_EVENLY = 6; +} + +enum CrossAxisAlignmentProto { + CROSS_AXIS_ALIGNMENT_UNSPECIFIED = 0; + CROSS_AXIS_START = 1; // Renamed from START + CROSS_AXIS_END = 2; // Renamed from END + CROSS_AXIS_CENTER = 3; // Renamed from CENTER + STRETCH = 4; + BASELINE = 5; +} + +enum MainAxisSizeProto { + MAIN_AXIS_SIZE_UNSPECIFIED = 0; + MIN = 1; + MAX = 2; +} + +enum TextDirectionProto { + TEXT_DIRECTION_UNSPECIFIED = 0; + LTR = 1; // Left to right + RTL = 2; // Right to left +} + +enum VerticalDirectionProto { + VERTICAL_DIRECTION_UNSPECIFIED = 0; + UP = 1; + DOWN = 2; +} + +enum TextBaselineProto { + TEXT_BASELINE_UNSPECIFIED = 0; + ALPHABETIC = 1; + IDEOGRAPHIC = 2; +} + +// New message for Box Constraints +message BoxConstraintsData { + optional double min_width = 1; + optional double max_width = 2; + optional double min_height = 3; + optional double max_height = 4; +} + +// New message for Transform +message TransformData { + enum TransformType { + TRANSFORM_TYPE_UNSPECIFIED = 0; + MATRIX_4X4 = 1; + TRANSLATE = 2; + ROTATE = 3; + SCALE = 4; + } + + TransformType type = 1; + + // Matrix 4x4 (row-major order) + repeated double matrix_values = 2; // 16 values if using matrix type + + // Translation + optional double translate_x = 3; + optional double translate_y = 4; + optional double translate_z = 5; + + // Rotation + optional double rotation_angle = 6; // In radians + optional double rotation_x = 7; + optional double rotation_y = 8; + optional double rotation_z = 9; + + // Scale + optional double scale_x = 10; + optional double scale_y = 11; + optional double scale_z = 12; +} + +// New enum for Clip behavior +enum ClipProto { + CLIP_UNSPECIFIED = 0; + CLIP_NONE = 1; // Renamed from NONE + HARD_EDGE = 2; + ANTI_ALIAS = 3; + ANTI_ALIAS_WITH_SAVE_LAYER = 4; +} + +// New enums for Text properties +enum TextAlignProto { + TEXT_ALIGN_UNSPECIFIED = 0; + LEFT = 1; + RIGHT = 2; + TEXT_ALIGN_CENTER = 3; // Renamed from CENTER + JUSTIFY = 4; + TEXT_ALIGN_START = 5; // Renamed from START + TEXT_ALIGN_END = 6; // Renamed from END +} + +enum TextOverflowProto { + TEXT_OVERFLOW_UNSPECIFIED = 0; + CLIP = 1; + ELLIPSIS = 2; + FADE = 3; + VISIBLE = 4; +} + +enum TextDecorationProto { + TEXT_DECORATION_UNSPECIFIED = 0; + TEXT_DECORATION_NONE = 1; // Renamed from NONE + UNDERLINE = 2; + OVERLINE = 3; + LINE_THROUGH = 4; +} + +enum FontStyleProto { + FONT_STYLE_UNSPECIFIED = 0; + NORMAL = 1; + ITALIC = 2; +} + +// New message for Rectangle data +message RectData { + double left = 1; + double top = 2; + double right = 3; + double bottom = 4; +} + +// New enum for Blend modes +enum BlendModeProto { + BLEND_MODE_UNSPECIFIED = 0; + CLEAR = 1; + SRC = 2; + DST = 3; + SRC_OVER = 4; + DST_OVER = 5; + SRC_IN = 6; + DST_IN = 7; + SRC_OUT = 8; + DST_OUT = 9; + SRC_ATOP = 10; + DST_ATOP = 11; + XOR = 12; + PLUS = 13; + MODULATE = 14; + SCREEN = 15; + OVERLAY = 16; + DARKEN = 17; + LIGHTEN = 18; + COLOR_DODGE = 19; + COLOR_BURN = 20; + HARD_LIGHT = 21; + SOFT_LIGHT = 22; + DIFFERENCE = 23; + EXCLUSION = 24; + MULTIPLY = 25; + HUE = 26; + SATURATION = 27; + COLOR = 28; + LUMINOSITY = 29; +} + +// New message for Shadow +message ShadowData { + ColorData color = 1; + double offset_x = 2; + double offset_y = 3; + double blur_radius = 4; +} + +// New enum for FloatingActionButtonLocation +enum FloatingActionButtonLocationProto { + FAB_LOCATION_UNSPECIFIED = 0; + FAB_START_TOP = 1; // Renamed from START_TOP + FAB_START = 2; // Renamed from START + FAB_START_FLOAT = 3; // Renamed from START_FLOAT + FAB_CENTER_TOP = 4; // Renamed from CENTER_TOP + FAB_CENTER = 5; // Renamed from CENTER + FAB_CENTER_FLOAT = 6; // Renamed from CENTER_FLOAT + FAB_END_TOP = 7; // Renamed from END_TOP + FAB_END = 8; // Renamed from END + FAB_END_FLOAT = 9; // Renamed from END_FLOAT + FAB_MINI_CENTER_TOP = 10; // Renamed from MINI_CENTER_TOP + FAB_MINI_CENTER_FLOAT = 11; // Renamed from MINI_CENTER_FLOAT + FAB_MINI_START_TOP = 12; // Renamed from MINI_START_TOP + FAB_MINI_START_FLOAT = 13; // Renamed from MINI_START_FLOAT + FAB_MINI_END_TOP = 14; // Renamed from MINI_END_TOP + FAB_MINI_END_FLOAT = 15; // Renamed from MINI_END_FLOAT +} + +// Service definition service SduiService { rpc GetSduiWidget (SduiRequest) returns (SduiWidgetData); } diff --git a/lib/src/renderer/sdui_grpc_renderer.dart b/lib/src/renderer/sdui_grpc_renderer.dart index 0e24f2a..385a59a 100644 --- a/lib/src/renderer/sdui_grpc_renderer.dart +++ b/lib/src/renderer/sdui_grpc_renderer.dart @@ -69,8 +69,7 @@ class _SduiGrpcRendererState extends State { } else if (snapshot.hasData) { // Convert the protobuf data to a Flutter widget // This will use our SduiProtoParser to create the widget tree - final SduiWidget sduiWidget = - SduiProtoParser.parseProto(snapshot.data!); + final SduiWidget sduiWidget = SduiParser.parseProto(snapshot.data!); return sduiWidget.toFlutterWidget(); } else { return const SizedBox.shrink(); diff --git a/lib/src/widgets/sdui_column.dart b/lib/src/widgets/sdui_column.dart index 11769e2..f47b38f 100644 --- a/lib/src/widgets/sdui_column.dart +++ b/lib/src/widgets/sdui_column.dart @@ -4,13 +4,32 @@ import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; /// Represents a Column widget in SDUI. class SduiColumn extends SduiWidget { final List children; - // Add other properties like mainAxisAlignment, crossAxisAlignment etc. as needed + final MainAxisAlignment? mainAxisAlignment; + final MainAxisSize? mainAxisSize; + final CrossAxisAlignment? crossAxisAlignment; + final TextDirection? textDirection; + final VerticalDirection? verticalDirection; + final TextBaseline? textBaseline; - SduiColumn({required this.children}); + SduiColumn({ + required this.children, + this.mainAxisAlignment, + this.mainAxisSize, + this.crossAxisAlignment, + this.textDirection, + this.verticalDirection, + this.textBaseline, + }); @override Widget toFlutterWidget() { return Column( + mainAxisAlignment: mainAxisAlignment ?? MainAxisAlignment.start, + mainAxisSize: mainAxisSize ?? MainAxisSize.max, + crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.center, + textDirection: textDirection, + verticalDirection: verticalDirection ?? VerticalDirection.down, + textBaseline: textBaseline, children: children.map((child) => child.toFlutterWidget()).toList(), ); } diff --git a/lib/src/widgets/sdui_container.dart b/lib/src/widgets/sdui_container.dart index 167f21e..ad2739e 100644 --- a/lib/src/widgets/sdui_container.dart +++ b/lib/src/widgets/sdui_container.dart @@ -5,26 +5,48 @@ import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; class SduiContainer extends SduiWidget { final SduiWidget? child; final EdgeInsets? padding; + final EdgeInsets? margin; final BoxDecoration? decoration; // Handles color, borderRadius, border, etc. final double? width; final double? height; - // Add other properties like margin, alignment etc. + final Color? color; + final Alignment? alignment; + final BoxConstraints? constraints; + final Matrix4? transform; + final AlignmentGeometry? transformAlignment; + final Clip? clipBehavior; SduiContainer({ this.child, this.padding, + this.margin, this.decoration, this.width, this.height, + this.color, + this.alignment, + this.constraints, + this.transform, + this.transformAlignment, + this.clipBehavior, }); @override Widget toFlutterWidget() { return Container( padding: padding, + margin: margin, decoration: decoration, width: width, height: height, + color: decoration == null + ? color + : null, // Only use color if decoration is null + alignment: alignment, + constraints: constraints, + transform: transform, + transformAlignment: transformAlignment, + clipBehavior: clipBehavior ?? Clip.none, child: child?.toFlutterWidget(), ); } diff --git a/lib/src/widgets/sdui_icon.dart b/lib/src/widgets/sdui_icon.dart index 8fc0626..8ba1d53 100644 --- a/lib/src/widgets/sdui_icon.dart +++ b/lib/src/widgets/sdui_icon.dart @@ -6,13 +6,22 @@ class SduiIcon extends SduiWidget { final IconData? icon; final double? size; final Color? color; - // final String? semanticLabel; // Future enhancement + final String? semanticLabel; + final TextDirection? textDirection; + final double? + opacity; // Custom property for opacity - will use Opacity widget + final bool? applyTextScaling; + final List? shadows; SduiIcon({ - required this.icon, + this.icon, this.size, this.color, - // this.semanticLabel, + this.semanticLabel, + this.textDirection, + this.opacity, + this.applyTextScaling, + this.shadows, }); @override @@ -21,11 +30,25 @@ class SduiIcon extends SduiWidget { // Return a placeholder or an empty widget if icon data is missing return const SizedBox.shrink(); } - return Icon( + + Widget iconWidget = Icon( icon, size: size, color: color, - // semanticLabel: semanticLabel, + semanticLabel: semanticLabel, + textDirection: textDirection, + shadows: shadows, + applyTextScaling: applyTextScaling, ); + + // Apply opacity if provided + if (opacity != null && opacity! < 1.0) { + iconWidget = Opacity( + opacity: opacity!, + child: iconWidget, + ); + } + + return iconWidget; } } diff --git a/lib/src/widgets/sdui_image.dart b/lib/src/widgets/sdui_image.dart index 83dfd3e..ee7c22d 100644 --- a/lib/src/widgets/sdui_image.dart +++ b/lib/src/widgets/sdui_image.dart @@ -7,14 +7,71 @@ class SduiImage extends SduiWidget { final double? width; final double? height; final BoxFit? fit; + final Alignment? alignment; + final ImageRepeat? repeat; + final Color? color; + final BlendMode? colorBlendMode; + final Rect? centerSlice; + final bool? matchTextDirection; + final bool? gaplessPlayback; + final FilterQuality? filterQuality; + final int? cacheWidth; + final int? cacheHeight; + final double? scale; + final String? semanticLabel; + final Widget? errorWidget; + final Widget? loadingWidget; - SduiImage(this.src, {this.width, this.height, this.fit}); + SduiImage( + this.src, { + this.width, + this.height, + this.fit, + this.alignment, + this.repeat, + this.color, + this.colorBlendMode, + this.centerSlice, + this.matchTextDirection, + this.gaplessPlayback, + this.filterQuality, + this.cacheWidth, + this.cacheHeight, + this.scale, + this.semanticLabel, + this.errorWidget, + this.loadingWidget, + }); @override Widget toFlutterWidget() { // Only network images are supported as per the new requirement. if (src.startsWith('http')) { - return Image.network(src, width: width, height: height, fit: fit); + return Image.network( + src, + width: width, + height: height, + fit: fit, + alignment: alignment ?? Alignment.center, + repeat: repeat ?? ImageRepeat.noRepeat, + color: color, + colorBlendMode: colorBlendMode, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection ?? false, + gaplessPlayback: gaplessPlayback ?? false, + filterQuality: filterQuality ?? FilterQuality.low, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + scale: scale ?? 1.0, + semanticLabel: semanticLabel, + errorBuilder: errorWidget != null + ? (context, error, stackTrace) => errorWidget! + : null, + loadingBuilder: loadingWidget != null + ? (context, child, loadingProgress) => + loadingProgress == null ? child : loadingWidget! + : null, + ); } else { // Optionally, return a placeholder or throw an error for non-network images. // For now, returning an empty SizedBox. diff --git a/lib/src/widgets/sdui_row.dart b/lib/src/widgets/sdui_row.dart index 43f4799..7962e88 100644 --- a/lib/src/widgets/sdui_row.dart +++ b/lib/src/widgets/sdui_row.dart @@ -4,13 +4,32 @@ import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; /// Represents a Row widget in SDUI. class SduiRow extends SduiWidget { final List children; - // Add other properties like mainAxisAlignment, crossAxisAlignment etc. as needed + final MainAxisAlignment? mainAxisAlignment; + final MainAxisSize? mainAxisSize; + final CrossAxisAlignment? crossAxisAlignment; + final TextDirection? textDirection; + final VerticalDirection? verticalDirection; + final TextBaseline? textBaseline; - SduiRow({required this.children}); + SduiRow({ + required this.children, + this.mainAxisAlignment, + this.mainAxisSize, + this.crossAxisAlignment, + this.textDirection, + this.verticalDirection, + this.textBaseline, + }); @override Widget toFlutterWidget() { return Row( + mainAxisAlignment: mainAxisAlignment ?? MainAxisAlignment.start, + mainAxisSize: mainAxisSize ?? MainAxisSize.max, + crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.center, + textDirection: textDirection, + verticalDirection: verticalDirection ?? VerticalDirection.down, + textBaseline: textBaseline, children: children.map((child) => child.toFlutterWidget()).toList(), ); } diff --git a/lib/src/widgets/sdui_scaffold.dart b/lib/src/widgets/sdui_scaffold.dart index c3e7b6f..8dfdf1c 100644 --- a/lib/src/widgets/sdui_scaffold.dart +++ b/lib/src/widgets/sdui_scaffold.dart @@ -6,14 +6,39 @@ class SduiScaffold extends SduiWidget { final SduiWidget? appBar; final SduiWidget? body; final SduiWidget? floatingActionButton; + final SduiWidget? bottomNavigationBar; + final SduiWidget? drawer; + final SduiWidget? endDrawer; + final SduiWidget? bottomSheet; final Color? backgroundColor; - // Add other Scaffold properties as needed (e.g., bottomNavigationBar, drawer) + final bool? resizeToAvoidBottomInset; + final bool? primary; + final FloatingActionButtonLocation? floatingActionButtonLocation; + final bool? extendBody; + final bool? extendBodyBehindAppBar; + final Color? drawerScrimColor; + final double? drawerEdgeDragWidth; + final bool? drawerEnableOpenDragGesture; + final bool? endDrawerEnableOpenDragGesture; SduiScaffold({ this.appBar, this.body, this.floatingActionButton, + this.bottomNavigationBar, + this.drawer, + this.endDrawer, + this.bottomSheet, this.backgroundColor, + this.resizeToAvoidBottomInset, + this.primary, + this.floatingActionButtonLocation, + this.extendBody, + this.extendBodyBehindAppBar, + this.drawerScrimColor, + this.drawerEdgeDragWidth, + this.drawerEnableOpenDragGesture, + this.endDrawerEnableOpenDragGesture, }); @override @@ -41,7 +66,20 @@ class SduiScaffold extends SduiWidget { appBar: flutterAppBar as PreferredSizeWidget?, body: body?.toFlutterWidget(), floatingActionButton: floatingActionButton?.toFlutterWidget(), + bottomNavigationBar: bottomNavigationBar?.toFlutterWidget(), + drawer: drawer?.toFlutterWidget(), + endDrawer: endDrawer?.toFlutterWidget(), + bottomSheet: bottomSheet?.toFlutterWidget(), backgroundColor: backgroundColor, + resizeToAvoidBottomInset: resizeToAvoidBottomInset, + primary: primary ?? true, + floatingActionButtonLocation: floatingActionButtonLocation, + extendBody: extendBody ?? false, + extendBodyBehindAppBar: extendBodyBehindAppBar ?? false, + drawerScrimColor: drawerScrimColor, + drawerEdgeDragWidth: drawerEdgeDragWidth, + drawerEnableOpenDragGesture: drawerEnableOpenDragGesture ?? true, + endDrawerEnableOpenDragGesture: endDrawerEnableOpenDragGesture ?? true, ); } } diff --git a/lib/src/widgets/sdui_text.dart b/lib/src/widgets/sdui_text.dart index 4838814..331869f 100644 --- a/lib/src/widgets/sdui_text.dart +++ b/lib/src/widgets/sdui_text.dart @@ -5,11 +5,60 @@ import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; class SduiText extends SduiWidget { final String text; final TextStyle? style; + final TextAlign? textAlign; + final TextOverflow? overflow; + final int? maxLines; + final TextDecoration? decoration; + final double? fontSize; + final FontWeight? fontWeight; + final Color? color; + final bool? softWrap; + final double? letterSpacing; + final double? wordSpacing; + final double? height; + final String? fontFamily; + final TextDirection? textDirection; - SduiText(this.text, {this.style}); + SduiText( + this.text, { + this.style, + this.textAlign, + this.overflow, + this.maxLines, + this.decoration, + this.fontSize, + this.fontWeight, + this.color, + this.softWrap, + this.letterSpacing, + this.wordSpacing, + this.height, + this.fontFamily, + this.textDirection, + }); @override Widget toFlutterWidget() { - return Text(text, style: style); + // Create a merged TextStyle that combines the individual properties with the style + TextStyle mergedStyle = (style ?? const TextStyle()).copyWith( + decoration: decoration, + fontSize: fontSize, + fontWeight: fontWeight, + color: color, + letterSpacing: letterSpacing, + wordSpacing: wordSpacing, + height: height, + fontFamily: fontFamily, + ); + + return Text( + text, + style: mergedStyle, + textAlign: textAlign, + overflow: overflow, + maxLines: maxLines, + softWrap: softWrap, + textDirection: textDirection, + ); } } From cafd7f592d7e147f703d1504c1ff40d289ee173b Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Fri, 26 Sep 2025 20:20:03 +0530 Subject: [PATCH 06/12] chore: updated inline docs --- example/grpc_example.dart | 27 +++- example/grpc_server_example_dart.dart | 36 ++++- lib/flutter_sdui.dart | 35 +++- lib/src/parser/sdui_proto_parser.dart | 198 ++++++++++++++--------- lib/src/renderer/sdui_grpc_renderer.dart | 42 ++++- lib/src/service/sdui_grpc_client.dart | 41 ++++- lib/src/widgets/sdui_column.dart | 26 ++- lib/src/widgets/sdui_container.dart | 45 +++++- lib/src/widgets/sdui_icon.dart | 34 +++- lib/src/widgets/sdui_image.dart | 56 ++++++- lib/src/widgets/sdui_row.dart | 26 ++- lib/src/widgets/sdui_scaffold.dart | 61 +++++-- lib/src/widgets/sdui_sized_box.dart | 19 ++- lib/src/widgets/sdui_spacer.dart | 16 +- lib/src/widgets/sdui_text.dart | 46 +++++- lib/src/widgets/sdui_widget.dart | 16 +- test/flutter_sdui_test.dart | 45 +++--- 17 files changed, 604 insertions(+), 165 deletions(-) diff --git a/example/grpc_example.dart b/example/grpc_example.dart index f0b699d..740f2eb 100644 --- a/example/grpc_example.dart +++ b/example/grpc_example.dart @@ -1,10 +1,18 @@ import 'package:flutter/material.dart'; import 'package:flutter_sdui/flutter_sdui.dart'; +/// Example application demonstrating Flutter SDUI with gRPC. +/// +/// This example shows how to: +/// * Connect to a gRPC server +/// * Fetch server-driven UI definitions +/// * Render dynamic UI content +/// * Handle different screen types void main() { runApp(const MyApp()); } +/// Root application widget that sets up the Material theme and routing. class MyApp extends StatelessWidget { const MyApp({super.key}); @@ -21,6 +29,13 @@ class MyApp extends StatelessWidget { } } +/// Demo widget that showcases the gRPC renderer functionality. +/// +/// This widget demonstrates how to: +/// * Initialize a gRPC client connection +/// * Switch between different screen definitions +/// * Handle loading and error states +/// * Properly dispose of resources class GrpcRendererDemo extends StatefulWidget { const GrpcRendererDemo({super.key}); @@ -35,16 +50,16 @@ class _GrpcRendererDemoState extends State { @override void initState() { super.initState(); - // Connect to your gRPC server + // Initialize gRPC client with server connection details _grpcClient = SduiGrpcClient( - host: 'localhost', // Replace with your server address - port: 50051, // Replace with your server port + host: 'localhost', + port: 50051, ); } @override void dispose() { - // Close the gRPC connection when done + // Clean up gRPC connection _grpcClient.dispose(); super.dispose(); } @@ -57,7 +72,7 @@ class _GrpcRendererDemoState extends State { ), body: Column( children: [ - // Screen selector + // Screen selection controls Padding( padding: const EdgeInsets.all(8.0), child: Row( @@ -84,7 +99,7 @@ class _GrpcRendererDemoState extends State { ), ), - // SDUI Renderer that fetches UI from gRPC server + // Server-driven UI renderer Expanded( child: SduiGrpcRenderer( client: _grpcClient, diff --git a/example/grpc_server_example_dart.dart b/example/grpc_server_example_dart.dart index 4cec6f4..4c5840b 100644 --- a/example/grpc_server_example_dart.dart +++ b/example/grpc_server_example_dart.dart @@ -1,9 +1,25 @@ -// Server implementation example (Dart) -// Note: This is a standalone Dart server, not a Flutter application -// Run with: dart run example/grpc_server_example.dart +/// Example gRPC server implementation for Flutter SDUI. +/// +/// This is a standalone Dart server that provides server-driven UI definitions +/// through gRPC. It demonstrates how to: +/// * Set up a gRPC server with SDUI service +/// * Handle different screen requests +/// * Create widget definitions using protobuf +/// * Return complex UI structures +/// +/// To run this server: +/// ```bash +/// dart run example/grpc_server_example_dart.dart +/// ``` +/// +/// The server listens on port 50051 by default. import 'package:grpc/grpc.dart'; import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; +/// Entry point for the gRPC server. +/// +/// Initializes the server with the SDUI service implementation +/// and starts listening for client connections. Future main() async { final server = Server.create( services: [ @@ -11,19 +27,22 @@ Future main() async { ], ); - final port = 50051; + const port = 50051; await server.serve(port: port); print('Server listening on port $port...'); print('Press Ctrl+C to stop'); } -// Implementation of the SDUI service +/// Implementation of the SDUI gRPC service. +/// +/// This class handles incoming requests for UI definitions and returns +/// appropriate widget data based on the requested screen ID. class SduiServiceImpl extends SduiServiceBase { @override Future getSduiWidget( ServiceCall call, SduiRequest request) async { - // Based on the requested screen, return different UI definitions print('Received request for screen: ${request.screenId}'); + switch (request.screenId) { case 'home': return _createHomeScreen(); @@ -32,13 +51,14 @@ class SduiServiceImpl extends SduiServiceBase { case 'settings': return _createSettingsScreen(); default: - // Default or error screen print('Warning: Unknown screen ID requested: ${request.screenId}'); return _createErrorScreen(); } } - // Sample screen definitions + /// Creates the home screen UI definition. + /// + /// Returns a scaffold with an app bar and a column of welcome content. SduiWidgetData _createHomeScreen() { final homeScreen = SduiWidgetData() ..type = WidgetType.SCAFFOLD diff --git a/lib/flutter_sdui.dart b/lib/flutter_sdui.dart index a7e5442..5376a46 100644 --- a/lib/flutter_sdui.dart +++ b/lib/flutter_sdui.dart @@ -1,13 +1,34 @@ -/// Flutter SDUI Package +/// Flutter Server-Driven UI Package /// -/// A Flutter package to render server driven UI. +/// A Flutter package that enables server-driven UI development by parsing +/// protobuf-based widget definitions from a gRPC server and rendering them +/// as native Flutter widgets. +/// +/// This package provides: +/// * Protobuf-based widget parsing and rendering +/// * gRPC client for server communication +/// * A comprehensive set of SDUI widgets that mirror Flutter's core widgets +/// * Type-safe widget definitions through generated protobuf models +/// +/// ## Usage +/// +/// ```dart +/// // Create a gRPC client +/// final client = SduiGrpcClient(host: 'localhost', port: 50051); +/// +/// // Render server-driven UI +/// SduiGrpcRenderer( +/// client: client, +/// screenId: 'home', +/// ) +/// ``` library; -// Export the core parser and widget base -export 'src/parser/sdui_proto_parser.dart'; // New proto parser +// Core parsing and widget foundation +export 'src/parser/sdui_proto_parser.dart'; export 'src/widgets/sdui_widget.dart'; -// Export individual widget models +// SDUI widget implementations export 'src/widgets/sdui_column.dart'; export 'src/widgets/sdui_row.dart'; export 'src/widgets/sdui_text.dart'; @@ -18,11 +39,11 @@ export 'src/widgets/sdui_scaffold.dart'; export 'src/widgets/sdui_spacer.dart'; export 'src/widgets/sdui_icon.dart'; -// Export gRPC client and renderer +// Network communication export 'src/service/sdui_grpc_client.dart'; export 'src/renderer/sdui_grpc_renderer.dart'; -// Export generated Protobuf models for public use +// Generated protobuf models export 'src/generated/sdui.pb.dart'; export 'src/generated/sdui.pbgrpc.dart'; export 'src/generated/sdui.pbenum.dart'; diff --git a/lib/src/parser/sdui_proto_parser.dart b/lib/src/parser/sdui_proto_parser.dart index 64bbd10..91133fc 100644 --- a/lib/src/parser/sdui_proto_parser.dart +++ b/lib/src/parser/sdui_proto_parser.dart @@ -14,9 +14,26 @@ import 'package:flutter_sdui/src/widgets/sdui_spacer.dart'; import 'package:flutter_sdui/src/widgets/sdui_text.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -// Parser for Protobuf definitions for SDUI +/// Parser for converting server-side widget definitions to SDUI widgets. +/// +/// This class handles the conversion of protobuf-based widget definitions +/// received from the server into corresponding SDUI widget instances that +/// can be rendered in the Flutter application. +/// +/// The parser supports various widget types and their properties, maintaining +/// type safety through protobuf definitions while providing flexibility +/// for server-driven UI updates. class SduiParser { - // Parse method for JSON data + /// Parses JSON data into SDUI widgets. + /// + /// This method is currently not implemented and will throw an + /// [UnimplementedError]. Future versions may support JSON-based + /// widget definitions as an alternative to protobuf. + /// + /// [data] - The JSON map containing widget definition + /// + /// Returns a parsed [SduiWidget] instance. + /// Throws [UnimplementedError] - JSON parsing is not yet supported. static SduiWidget parseJSON(Map data) { final String? type = data['type']?.toString().toLowerCase(); switch (type) { @@ -43,7 +60,17 @@ class SduiParser { } } - // Parse from Protobuf data model + /// Parses protobuf widget data into SDUI widgets. + /// + /// This is the main parsing method that converts server-provided protobuf + /// widget definitions into their corresponding SDUI widget instances. + /// The method uses a switch statement to determine the widget type and + /// delegates to specific parsing methods for each widget type. + /// + /// [data] - The protobuf widget data received from the server + /// + /// Returns a parsed [SduiWidget] instance, or [SduiContainer] if the + /// widget type is unsupported. static SduiWidget parseProto(SduiWidgetData data) { switch (data.type) { case WidgetType.COLUMN: @@ -70,9 +97,12 @@ class SduiParser { } } - // Helper methods to parse specific widget types from protobuf + /// Parses protobuf data into a [SduiColumn] widget. + /// + /// Extracts all column-specific properties from the protobuf data + /// and recursively parses child widgets. static SduiColumn _parseProtoColumn(SduiWidgetData data) { - List children = + final List children = data.children.map((child) => SduiParser.parseProto(child)).toList(); return SduiColumn( @@ -87,8 +117,12 @@ class SduiParser { ); } + /// Parses protobuf data into a [SduiRow] widget. + /// + /// Extracts all row-specific properties from the protobuf data + /// and recursively parses child widgets. static SduiRow _parseProtoRow(SduiWidgetData data) { - List children = + final List children = data.children.map((child) => SduiParser.parseProto(child)).toList(); return SduiRow( @@ -103,23 +137,26 @@ class SduiParser { ); } + /// Parses protobuf data into a [SduiText] widget. + /// + /// Extracts text content and all styling properties from the protobuf data. + /// Text content is retrieved from the stringAttributes map, while styling + /// properties are parsed from individual fields. static SduiText _parseProtoText(SduiWidgetData data) { - String text = data.stringAttributes['text'] ?? ''; - TextStyle? style = + final String text = data.stringAttributes['text'] ?? ''; + final TextStyle? style = data.hasTextStyle() ? _parseProtoTextStyle(data.textStyle) : null; - // Parse additional text properties - TextAlign? textAlign = _parseProtoTextAlign(data.textAlign); - TextOverflow? overflow = _parseProtoTextOverflow(data.overflow); - int? maxLines = data.hasMaxLines() ? data.maxLines : null; - bool? softWrap = data.hasSoftWrap() ? data.softWrap : null; + final TextAlign? textAlign = _parseProtoTextAlign(data.textAlign); + final TextOverflow? overflow = _parseProtoTextOverflow(data.overflow); + final int? maxLines = data.hasMaxLines() ? data.maxLines : null; + final bool? softWrap = data.hasSoftWrap() ? data.softWrap : null; double? letterSpacing = data.hasLetterSpacing() ? data.letterSpacing : null; double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; double? height = data.hasHeight() ? data.height : null; String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; - TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); + final TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); - // Extract from style if present double? fontSize = style?.fontSize; FontWeight? fontWeight = style?.fontWeight; Color? color = style?.color; @@ -154,34 +191,38 @@ class SduiParser { ); } + /// Parses protobuf data into a [SduiImage] widget. + /// + /// Extracts image source URL and all display properties including sizing, + /// alignment, color blending, and caching options. static SduiImage _parseProtoImage(SduiWidgetData data) { - String src = data.stringAttributes['src'] ?? ''; - double? width = data.doubleAttributes['width']; - double? height = data.doubleAttributes['height']; - BoxFit? fit = _parseProtoBoxFit(data.stringAttributes['fit']); - - // Parse additional image properties - Alignment? alignment = _parseProtoAlignment(data.alignment); - ImageRepeat? repeat = _parseProtoImageRepeat(data.repeat); - Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; - BlendMode? colorBlendMode = _parseProtoBlendMode(data.colorBlendMode); - Rect? centerSlice = + final String src = data.stringAttributes['src'] ?? ''; + final double? width = data.doubleAttributes['width']; + final double? height = data.doubleAttributes['height']; + final BoxFit? fit = _parseProtoBoxFit(data.stringAttributes['fit']); + + final Alignment? alignment = _parseProtoAlignment(data.alignment); + final ImageRepeat? repeat = _parseProtoImageRepeat(data.repeat); + final Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; + final BlendMode? colorBlendMode = _parseProtoBlendMode(data.colorBlendMode); + final Rect? centerSlice = data.hasCenterSlice() ? _parseProtoRect(data.centerSlice) : null; - bool? matchTextDirection = + final bool? matchTextDirection = data.hasMatchTextDirection() ? data.matchTextDirection : null; - bool? gaplessPlayback = + final bool? gaplessPlayback = data.hasGaplessPlayback() ? data.gaplessPlayback : null; - FilterQuality? filterQuality = _parseProtoFilterQuality(data.filterQuality); - int? cacheWidth = data.hasCacheWidth() ? data.cacheWidth : null; - int? cacheHeight = data.hasCacheHeight() ? data.cacheHeight : null; - double? scale = data.hasScale() ? data.scale : null; - String? semanticLabel = data.hasSemanticLabel() ? data.semanticLabel : null; - - // Parse error and loading widgets - Widget? errorWidget = data.hasErrorWidget() + final FilterQuality? filterQuality = + _parseProtoFilterQuality(data.filterQuality); + final int? cacheWidth = data.hasCacheWidth() ? data.cacheWidth : null; + final int? cacheHeight = data.hasCacheHeight() ? data.cacheHeight : null; + final double? scale = data.hasScale() ? data.scale : null; + final String? semanticLabel = + data.hasSemanticLabel() ? data.semanticLabel : null; + + final Widget? errorWidget = data.hasErrorWidget() ? SduiParser.parseProto(data.errorWidget).toFlutterWidget() : null; - Widget? loadingWidget = data.hasLoadingWidget() + final Widget? loadingWidget = data.hasLoadingWidget() ? SduiParser.parseProto(data.loadingWidget).toFlutterWidget() : null; @@ -229,7 +270,6 @@ class SduiParser { double? height = data.doubleAttributes['height']; Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; - // Parse additional container properties Alignment? alignment = _parseProtoAlignment(data.alignment); BoxConstraints? constraints = data.hasConstraints() ? _parseProtoBoxConstraints(data.constraints) @@ -268,7 +308,6 @@ class SduiParser { ? _parseProtoColor(data.backgroundColor) : null; - // Parse additional scaffold properties SduiWidget? bottomNavigationBar = data.hasBottomNavigationBar() ? SduiParser.parseProto(data.bottomNavigationBar) : null; @@ -334,7 +373,6 @@ class SduiParser { Color? color = data.icon.hasColor() ? _parseProtoColor(data.icon.color) : null; - // Parse additional icon properties String? semanticLabel = data.hasSemanticLabel() ? data.semanticLabel : null; TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); double? opacity = data.hasOpacity() ? data.opacity : null; @@ -356,8 +394,12 @@ class SduiParser { ); } - // Helper methods for parsing protobuf attribute types + /// Helper methods for parsing protobuf attribute types into Flutter types. + /// Parses a string value into a [BoxFit] enum. + /// + /// Supports common box fit values like 'fill', 'contain', 'cover', etc. + /// Returns null if the value is null or unrecognized. static BoxFit? _parseProtoBoxFit(String? value) { if (value == null) return null; switch (value.toLowerCase()) { @@ -380,16 +422,22 @@ class SduiParser { } } + /// Parses protobuf text style data into a Flutter [TextStyle]. + /// + /// Converts all text styling properties from protobuf format + /// to their corresponding Flutter TextStyle properties. static TextStyle? _parseProtoTextStyle(TextStyleData data) { - Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; - double? fontSize = data.fontSize; - FontWeight? fontWeight = _parseProtoFontWeight(data.fontWeight); - TextDecoration? decoration = _parseProtoTextDecoration(data.decoration); - double? letterSpacing = data.hasLetterSpacing() ? data.letterSpacing : null; - double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; - double? height = data.hasHeight() ? data.height : null; - String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; - FontStyle? fontStyle = _parseProtoFontStyle(data.fontStyle); + final Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; + final double fontSize = data.fontSize; + final FontWeight? fontWeight = _parseProtoFontWeight(data.fontWeight); + final TextDecoration? decoration = + _parseProtoTextDecoration(data.decoration); + final double? letterSpacing = + data.hasLetterSpacing() ? data.letterSpacing : null; + final double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; + final double? height = data.hasHeight() ? data.height : null; + final String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; + final FontStyle? fontStyle = _parseProtoFontStyle(data.fontStyle); return TextStyle( color: color, @@ -404,6 +452,10 @@ class SduiParser { ); } + /// Parses a string value into a [FontWeight] enum. + /// + /// Supports both named weights ('bold', 'normal') and numeric weights + /// ('w100' through 'w900'). Returns null for unrecognized values. static FontWeight? _parseProtoFontWeight(String? value) { if (value == null) return null; switch (value.toLowerCase()) { @@ -434,6 +486,10 @@ class SduiParser { } } + /// Parses protobuf edge insets data into Flutter [EdgeInsets]. + /// + /// Supports both uniform insets (all sides equal) and individual + /// side specifications (left, top, right, bottom). static EdgeInsets? _parseProtoEdgeInsets(EdgeInsetsData data) { if (data.hasAll()) { return EdgeInsets.all(data.all); @@ -447,6 +503,10 @@ class SduiParser { ); } + /// Parses protobuf color data into a Flutter [Color]. + /// + /// Creates a Color from ARGB values provided in the protobuf data. + /// Alpha, red, green, and blue values should be in the range 0-255. static Color? _parseProtoColor(ColorData data) { return Color.fromARGB( data.alpha, @@ -527,7 +587,7 @@ class SduiParser { ); } - return BorderRadius.circular(8.0); // Example default value + return BorderRadius.circular(8.0); } // New helper methods for parsing new property types @@ -1021,8 +1081,8 @@ class SduiParser { cacheHeight: data['cacheHeight'] is int ? data['cacheHeight'] : int.tryParse(data['cacheHeight']?.toString() ?? ''), scale: (data['scale'] is num) ? (data['scale'] as num).toDouble() : null, semanticLabel: data['semanticLabel']?.toString(), - errorWidget: errorSduiWidget != null ? errorSduiWidget.toFlutterWidget() : null, - loadingWidget: loadingSduiWidget != null ? loadingSduiWidget.toFlutterWidget() : null, + errorWidget: errorSduiWidget?.toFlutterWidget(), + loadingWidget: loadingSduiWidget?.toFlutterWidget(), ); } @@ -1783,9 +1843,7 @@ class SduiParser { return MainAxisAlignmentProto.SPACE_AROUND; case MainAxisAlignment.spaceEvenly: return MainAxisAlignmentProto.SPACE_EVENLY; - default: - return MainAxisAlignmentProto.MAIN_AXIS_START; - } + } } static CrossAxisAlignmentProto _crossAxisAlignmentToProto(CrossAxisAlignment value) { @@ -1800,8 +1858,6 @@ class SduiParser { return CrossAxisAlignmentProto.STRETCH; case CrossAxisAlignment.baseline: return CrossAxisAlignmentProto.BASELINE; - default: - return CrossAxisAlignmentProto.CROSS_AXIS_CENTER; } } @@ -1811,9 +1867,7 @@ class SduiParser { return MainAxisSizeProto.MIN; case MainAxisSize.max: return MainAxisSizeProto.MAX; - default: - return MainAxisSizeProto.MAX; - } + } } static TextDirectionProto _textDirectionToProto(TextDirection value) { @@ -1822,8 +1876,6 @@ class SduiParser { return TextDirectionProto.LTR; case TextDirection.rtl: return TextDirectionProto.RTL; - default: - return TextDirectionProto.LTR; } } @@ -1833,8 +1885,6 @@ class SduiParser { return VerticalDirectionProto.UP; case VerticalDirection.down: return VerticalDirectionProto.DOWN; - default: - return VerticalDirectionProto.DOWN; } } @@ -1844,8 +1894,6 @@ class SduiParser { return TextBaselineProto.ALPHABETIC; case TextBaseline.ideographic: return TextBaselineProto.IDEOGRAPHIC; - default: - return TextBaselineProto.ALPHABETIC; } } @@ -2562,8 +2610,7 @@ class SduiParser { return TextAlignProto.TEXT_ALIGN_START; case TextAlign.end: return TextAlignProto.TEXT_ALIGN_END; - default: - return TextAlignProto.LEFT; + } } @@ -2577,17 +2624,16 @@ class SduiParser { return TextOverflowProto.FADE; case TextOverflow.visible: return TextOverflowProto.VISIBLE; - default: - return TextOverflowProto.CLIP; + } } static ColorData _colorToProto(Color color) { return ColorData() - ..alpha = color.alpha - ..red = color.red - ..green = color.green - ..blue = color.blue; + ..alpha = ((color.a * 255.0).round() & 0xff) + ..red = ((color.r * 255.0).round() & 0xff) + ..green = ((color.g * 255.0).round() & 0xff) + ..blue = ((color.b * 255.0).round() & 0xff); } static TextDecorationProto _textDecorationToProto(TextDecoration decoration) { @@ -2604,8 +2650,6 @@ class SduiParser { return FontStyleProto.NORMAL; case FontStyle.italic: return FontStyleProto.ITALIC; - default: - return FontStyleProto.NORMAL; } } } diff --git a/lib/src/renderer/sdui_grpc_renderer.dart b/lib/src/renderer/sdui_grpc_renderer.dart index 385a59a..a088c57 100644 --- a/lib/src/renderer/sdui_grpc_renderer.dart +++ b/lib/src/renderer/sdui_grpc_renderer.dart @@ -4,21 +4,47 @@ import 'package:flutter_sdui/src/parser/sdui_proto_parser.dart'; import 'package:flutter_sdui/src/service/sdui_grpc_client.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// A widget that renders a UI from a gRPC server. +/// A Flutter widget that renders server-driven UI from a gRPC server. +/// +/// This widget acts as the main entry point for rendering server-driven UI. +/// It fetches widget definitions from a gRPC server, parses them, and renders +/// the resulting widget tree in the Flutter app. +/// +/// The renderer handles loading states, error states, and automatic re-fetching +/// when the screen ID or client changes. +/// +/// Example usage: +/// ```dart +/// SduiGrpcRenderer( +/// client: sduiClient, +/// screenId: 'home', +/// loadingWidget: CustomLoadingSpinner(), +/// errorBuilder: (context, error) => ErrorWidget(error), +/// ) +/// ``` class SduiGrpcRenderer extends StatefulWidget { - /// The gRPC client to use for fetching UI widgets. + /// The gRPC client used to fetch widget data from the server. final SduiGrpcClient client; - /// The screen ID to fetch from the server. + /// The identifier for the screen/UI to fetch from the server. + /// This should correspond to a valid screen ID on the server. final String screenId; - /// Optional loading widget to display while fetching the UI. + /// Optional widget to display while the UI is being fetched. + /// If not provided, a default [CircularProgressIndicator] is shown. final Widget? loadingWidget; - /// Optional error widget builder to display if an error occurs. + /// Optional builder function to create a custom error widget. + /// + /// The function receives the [BuildContext] and the error [Object]. + /// If not provided, a default error text widget is displayed. final Widget Function(BuildContext, Object)? errorBuilder; - /// Creates a new SduiGrpcRenderer. + /// Creates a new [SduiGrpcRenderer]. + /// + /// The [client] and [screenId] parameters are required. + /// The [loadingWidget] and [errorBuilder] parameters are optional + /// and provide customization for loading and error states. const SduiGrpcRenderer({ super.key, required this.client, @@ -49,6 +75,7 @@ class _SduiGrpcRendererState extends State { } } + /// Initiates a request to fetch widget data from the server. void _fetchWidget() { _widgetFuture = widget.client.getWidget(widget.screenId); } @@ -67,8 +94,7 @@ class _SduiGrpcRendererState extends State { } return Center(child: Text('Error: ${snapshot.error}')); } else if (snapshot.hasData) { - // Convert the protobuf data to a Flutter widget - // This will use our SduiProtoParser to create the widget tree + // Parse the protobuf data and convert to Flutter widget final SduiWidget sduiWidget = SduiParser.parseProto(snapshot.data!); return sduiWidget.toFlutterWidget(); } else { diff --git a/lib/src/service/sdui_grpc_client.dart b/lib/src/service/sdui_grpc_client.dart index f5e1200..5c0c19d 100644 --- a/lib/src/service/sdui_grpc_client.dart +++ b/lib/src/service/sdui_grpc_client.dart @@ -1,12 +1,36 @@ import 'package:grpc/grpc.dart'; import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; -/// A client for the SDUI gRPC service. +/// A gRPC client for communicating with SDUI servers. +/// +/// This client handles the network communication between the Flutter app +/// and the server that provides the UI definitions. It manages the gRPC +/// connection lifecycle and provides methods to fetch widget data. +/// +/// Example usage: +/// ```dart +/// final client = SduiGrpcClient( +/// host: 'your-server.com', +/// port: 50051, +/// secure: true, +/// ); +/// +/// final widgetData = await client.getWidget('home_screen'); +/// ``` class SduiGrpcClient { late final SduiServiceClient _client; late final ClientChannel _channel; /// Creates a new SDUI gRPC client. + /// + /// Parameters: + /// * [host] - The hostname or IP address of the gRPC server + /// * [port] - The port number the gRPC server is listening on + /// * [secure] - Whether to use secure (TLS) connection. Defaults to false + /// + /// The client will establish a connection to the server immediately upon + /// construction. Call [dispose] when the client is no longer needed to + /// properly close the connection. SduiGrpcClient({ required String host, required int port, @@ -25,13 +49,24 @@ class SduiGrpcClient { _client = SduiServiceClient(_channel); } - /// Fetches a UI widget from the server. + /// Fetches widget data from the server for the specified screen. + /// + /// [screenId] is a server-defined identifier that specifies which + /// UI definition to retrieve. The server should return a complete + /// widget tree definition for the requested screen. + /// + /// Returns a [Future] that completes with the widget data, or throws + /// a [GrpcError] if the request fails. Future getWidget(String screenId) async { final request = SduiRequest()..screenId = screenId; return _client.getSduiWidget(request); } - /// Closes the connection to the server. + /// Closes the connection to the server and releases all resources. + /// + /// This method should be called when the client is no longer needed + /// to properly clean up the gRPC connection. After calling this method, + /// the client should not be used for any further operations. Future dispose() async { await _channel.shutdown(); } diff --git a/lib/src/widgets/sdui_column.dart b/lib/src/widgets/sdui_column.dart index f47b38f..d05bfdc 100644 --- a/lib/src/widgets/sdui_column.dart +++ b/lib/src/widgets/sdui_column.dart @@ -1,16 +1,40 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Column widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Column] widget. +/// +/// This widget displays its children in a vertical array, allowing for +/// flexible layout configuration through server-defined properties. +/// +/// The column's layout behavior can be controlled through alignment, +/// sizing, and direction properties that mirror Flutter's Column widget. class SduiColumn extends SduiWidget { + /// The widgets below this widget in the tree. final List children; + + /// How the children should be placed along the main axis (vertically). final MainAxisAlignment? mainAxisAlignment; + + /// How much space should be occupied in the main axis. final MainAxisSize? mainAxisSize; + + /// How the children should be placed along the cross axis (horizontally). final CrossAxisAlignment? crossAxisAlignment; + + /// Determines the order to lay children out horizontally. final TextDirection? textDirection; + + /// Determines the order to lay children out vertically. final VerticalDirection? verticalDirection; + + /// The baseline to use when aligning text within the column. final TextBaseline? textBaseline; + /// Creates a new [SduiColumn] widget. + /// + /// The [children] parameter is required and defines the widgets to be + /// laid out vertically. All other parameters are optional and control + /// the layout behavior. SduiColumn({ required this.children, this.mainAxisAlignment, diff --git a/lib/src/widgets/sdui_container.dart b/lib/src/widgets/sdui_container.dart index ad2739e..2ed26d0 100644 --- a/lib/src/widgets/sdui_container.dart +++ b/lib/src/widgets/sdui_container.dart @@ -1,21 +1,57 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Container widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Container] widget. +/// +/// This widget combines common painting, positioning, and sizing widgets +/// into a single convenient widget. It's one of the most versatile widgets +/// in the SDUI toolkit, supporting decoration, padding, margins, constraints, +/// and transformations. +/// +/// Note: The [color] parameter is only applied when [decoration] is null. +/// If both are specified, [decoration] takes precedence. class SduiContainer extends SduiWidget { + /// The widget below this widget in the tree. final SduiWidget? child; + + /// Empty space to inscribe inside the decoration. The child is placed inside this padding. final EdgeInsets? padding; + + /// Empty space to surround the decoration and child. final EdgeInsets? margin; - final BoxDecoration? decoration; // Handles color, borderRadius, border, etc. + + /// The decoration to paint behind the child. + /// Handles background color, border radius, borders, shadows, and gradients. + final BoxDecoration? decoration; + + /// If non-null, requires the child to have exactly this width. final double? width; + + /// If non-null, requires the child to have exactly this height. final double? height; + + /// The color to paint behind the child. Only used when [decoration] is null. final Color? color; + + /// Aligns the child within the container. final Alignment? alignment; + + /// Additional constraints to apply to the child. final BoxConstraints? constraints; + + /// The transformation matrix to apply before painting the container. final Matrix4? transform; + + /// The alignment of the origin for the transformation. final AlignmentGeometry? transformAlignment; + + /// The clip behavior for the container's contents. final Clip? clipBehavior; + /// Creates a new [SduiContainer] widget. + /// + /// All parameters are optional. The container's appearance and behavior + /// are determined by the combination of properties provided. SduiContainer({ this.child, this.padding, @@ -39,9 +75,8 @@ class SduiContainer extends SduiWidget { decoration: decoration, width: width, height: height, - color: decoration == null - ? color - : null, // Only use color if decoration is null + // Only use color if decoration is null to avoid conflicts + color: decoration == null ? color : null, alignment: alignment, constraints: constraints, transform: transform, diff --git a/lib/src/widgets/sdui_icon.dart b/lib/src/widgets/sdui_icon.dart index a428418..fb67e0d 100644 --- a/lib/src/widgets/sdui_icon.dart +++ b/lib/src/widgets/sdui_icon.dart @@ -1,18 +1,44 @@ import 'package:flutter/material.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents an Icon widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Icon] widget. +/// +/// This widget displays a graphical icon from Flutter's built-in icon sets +/// or custom icon fonts. It supports comprehensive styling options including +/// size, color, shadows, and opacity. +/// +/// The widget can handle missing icon data gracefully by rendering an empty +/// widget instead of throwing an error. class SduiIcon extends SduiWidget { + /// The icon to display. If null, an empty widget will be rendered. final IconData? icon; + + /// The size of the icon in logical pixels. final double? size; + + /// The color to use when drawing the icon. final Color? color; + + /// Semantic description of the icon for accessibility. final String? semanticLabel; + + /// The text direction to use for resolving the icon. final TextDirection? textDirection; - final double? - opacity; // Custom property for opacity - will use Opacity widget + + /// The opacity to apply to the icon. Values should be between 0.0 and 1.0. + final double? opacity; + + /// Whether to scale the icon based on the text scale factor. final bool? applyTextScaling; + + /// A list of shadows to cast behind the icon. final List? shadows; + /// Creates a new [SduiIcon] widget. + /// + /// All parameters are optional. If [icon] is null, an empty widget + /// will be rendered. The [opacity] will be applied using an [Opacity] + /// widget if the value is less than 1.0. SduiIcon({ this.icon, this.size, @@ -56,7 +82,7 @@ class SduiIcon extends SduiWidget { applyTextScaling: applyTextScaling, ); - // Apply opacity if provided + // Apply opacity wrapper if needed if (opacity != null && opacity! < 1.0) { iconWidget = Opacity( opacity: opacity!, diff --git a/lib/src/widgets/sdui_image.dart b/lib/src/widgets/sdui_image.dart index ee7c22d..a3383d9 100644 --- a/lib/src/widgets/sdui_image.dart +++ b/lib/src/widgets/sdui_image.dart @@ -1,27 +1,76 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents an Image widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Image] widget. +/// +/// This widget supports displaying images from network URLs with comprehensive +/// customization options for sizing, alignment, color blending, and caching. +/// +/// Currently, only network images (URLs starting with 'http') are supported. +/// Local assets and file system images are not yet implemented. +/// +/// The widget provides loading and error handling capabilities through +/// optional custom widgets. class SduiImage extends SduiWidget { - final String src; // Network URL + /// The network URL of the image to display. + final String src; + + /// If non-null, requires the image to have exactly this width. final double? width; + + /// If non-null, requires the image to have exactly this height. final double? height; + + /// How the image should be inscribed into the space allocated during layout. final BoxFit? fit; + + /// How to align the image within its bounds. final Alignment? alignment; + + /// How the image should be repeated if it doesn't fill its layout bounds. final ImageRepeat? repeat; + + /// A color to blend with the image. final Color? color; + + /// The blend mode to use when applying the color. final BlendMode? colorBlendMode; + + /// The center slice for a nine-patch image. final Rect? centerSlice; + + /// Whether to paint the image in the direction of the text. final bool? matchTextDirection; + + /// Whether to continue showing the old image when the new image fails to load. final bool? gaplessPlayback; + + /// The quality level to use when scaling the image. final FilterQuality? filterQuality; + + /// The target width for image caching. final int? cacheWidth; + + /// The target height for image caching. final int? cacheHeight; + + /// The scale to place in the ImageInfo object of the image. final double? scale; + + /// A semantic description of the image for accessibility. final String? semanticLabel; + + /// Widget to display when an error occurs while loading the image. final Widget? errorWidget; + + /// Widget to display while the image is loading. final Widget? loadingWidget; + /// Creates a new [SduiImage] widget. + /// + /// The [src] parameter is required and must be a valid network URL. + /// All other parameters are optional and provide customization for + /// image display and behavior. SduiImage( this.src, { this.width, @@ -73,8 +122,7 @@ class SduiImage extends SduiWidget { : null, ); } else { - // Optionally, return a placeholder or throw an error for non-network images. - // For now, returning an empty SizedBox. + // Return empty widget for non-network URLs with warning print( "Warning: SduiImage currently only supports network images. Provided src: $src"); return const SizedBox.shrink(); diff --git a/lib/src/widgets/sdui_row.dart b/lib/src/widgets/sdui_row.dart index 7962e88..5c13cf2 100644 --- a/lib/src/widgets/sdui_row.dart +++ b/lib/src/widgets/sdui_row.dart @@ -1,16 +1,40 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Row widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Row] widget. +/// +/// This widget displays its children in a horizontal array, allowing for +/// flexible layout configuration through server-defined properties. +/// +/// The row's layout behavior can be controlled through alignment, +/// sizing, and direction properties that mirror Flutter's Row widget. class SduiRow extends SduiWidget { + /// The widgets below this widget in the tree. final List children; + + /// How the children should be placed along the main axis (horizontally). final MainAxisAlignment? mainAxisAlignment; + + /// How much space should be occupied in the main axis. final MainAxisSize? mainAxisSize; + + /// How the children should be placed along the cross axis (vertically). final CrossAxisAlignment? crossAxisAlignment; + + /// Determines the order to lay children out horizontally. final TextDirection? textDirection; + + /// Determines the order to lay children out vertically. final VerticalDirection? verticalDirection; + + /// The baseline to use when aligning text within the row. final TextBaseline? textBaseline; + /// Creates a new [SduiRow] widget. + /// + /// The [children] parameter is required and defines the widgets to be + /// laid out horizontally. All other parameters are optional and control + /// the layout behavior. SduiRow({ required this.children, this.mainAxisAlignment, diff --git a/lib/src/widgets/sdui_scaffold.dart b/lib/src/widgets/sdui_scaffold.dart index 8dfdf1c..d318564 100644 --- a/lib/src/widgets/sdui_scaffold.dart +++ b/lib/src/widgets/sdui_scaffold.dart @@ -1,26 +1,73 @@ -import 'package:flutter/material.dart'; // Scaffold is in material.dart +import 'package:flutter/material.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Scaffold widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Scaffold] widget. +/// +/// This widget implements the basic material design visual layout structure. +/// It provides slots for the most common components of a screen, such as +/// app bars, bodies, floating action buttons, and drawers. +/// +/// The scaffold ensures proper Material Design layout behavior and manages +/// component positioning and sizing automatically. +/// +/// Note: The [appBar] widget must resolve to a [PreferredSizeWidget] +/// (such as an AppBar) to be properly displayed. class SduiScaffold extends SduiWidget { + /// An app bar to display at the top of the scaffold. final SduiWidget? appBar; + + /// The primary content of the scaffold. final SduiWidget? body; + + /// A floating action button displayed over the body. final SduiWidget? floatingActionButton; + + /// A bottom navigation bar to display at the bottom of the scaffold. final SduiWidget? bottomNavigationBar; + + /// A navigation drawer that slides in from the left side. final SduiWidget? drawer; + + /// A navigation drawer that slides in from the right side. final SduiWidget? endDrawer; + + /// A bottom sheet displayed above the scaffold body. final SduiWidget? bottomSheet; + + /// The color of the scaffold's background. final Color? backgroundColor; + + /// Whether the body should resize when the keyboard appears. final bool? resizeToAvoidBottomInset; + + /// Whether this scaffold is being displayed at the top of the screen. final bool? primary; + + /// The position of the floating action button. final FloatingActionButtonLocation? floatingActionButtonLocation; + + /// Whether the body should extend behind the app bar. final bool? extendBody; + + /// Whether the body should extend behind the app bar when fully expanded. final bool? extendBodyBehindAppBar; + + /// The color to use for the scrim that obscures primary content while a drawer is open. final Color? drawerScrimColor; + + /// The width of the area within which a horizontal swipe will open the drawer. final double? drawerEdgeDragWidth; + + /// Whether the drawer can be opened with a drag gesture. final bool? drawerEnableOpenDragGesture; + + /// Whether the end drawer can be opened with a drag gesture. final bool? endDrawerEnableOpenDragGesture; + /// Creates a new [SduiScaffold] widget. + /// + /// All parameters are optional. The scaffold will display only the + /// components that are provided. SduiScaffold({ this.appBar, this.body, @@ -45,20 +92,12 @@ class SduiScaffold extends SduiWidget { Widget toFlutterWidget() { Widget? flutterAppBar; if (appBar != null) { - // Attempt to cast to PreferredSizeWidget. This assumes the SDUI appBar resolves to something like AppBar. - // More robust handling might be needed if it can be any widget. - // For now, we expect it to be a widget that can be an AppBar (e.g. SduiContainer styled as an AppBar) - // or a custom SduiAppBar widget if we introduce one. - var potentialAppBar = appBar!.toFlutterWidget(); + final potentialAppBar = appBar!.toFlutterWidget(); if (potentialAppBar is PreferredSizeWidget) { flutterAppBar = potentialAppBar; } else { - // If it's not a PreferredSizeWidget, wrap it in one if possible or log a warning. - // For simplicity, we are strict for now. Consider a SduiAppBar sdui widget for proper typing. print( "Warning: appBar widget for SduiScaffold is not a PreferredSizeWidget. It might not render correctly."); - // As a fallback, one might wrap it in a simple PreferredSize if it has a defined height. - // flutterAppBar = PreferredSize(child: potentialAppBar, preferredSize: Size.fromHeight(kToolbarHeight)); } } diff --git a/lib/src/widgets/sdui_sized_box.dart b/lib/src/widgets/sdui_sized_box.dart index 3feb28e..1eb7de5 100644 --- a/lib/src/widgets/sdui_sized_box.dart +++ b/lib/src/widgets/sdui_sized_box.dart @@ -1,12 +1,29 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a SizedBox widget in SDUI. +/// A server-driven UI widget that represents a Flutter [SizedBox] widget. +/// +/// This widget forces its child to have a specific width and/or height. +/// It's useful for creating fixed-size layouts or adding spacing between widgets. +/// +/// If no dimensions are specified, the widget will try to be as big as possible. +/// If only one dimension is specified, the widget will try to be as big as +/// possible in the other dimension. class SduiSizedBox extends SduiWidget { + /// The width to constrain the child to. final double? width; + + /// The height to constrain the child to. final double? height; + + /// The widget below this widget in the tree. final SduiWidget? child; + /// Creates a new [SduiSizedBox] widget. + /// + /// All parameters are optional. If neither [width] nor [height] are + /// specified, the child will be unconstrained. If only one dimension + /// is specified, the child will be constrained in that dimension only. SduiSizedBox({this.width, this.height, this.child}); @override diff --git a/lib/src/widgets/sdui_spacer.dart b/lib/src/widgets/sdui_spacer.dart index 4095f41..5d33740 100644 --- a/lib/src/widgets/sdui_spacer.dart +++ b/lib/src/widgets/sdui_spacer.dart @@ -1,10 +1,24 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Spacer widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Spacer] widget. +/// +/// This widget creates an adjustable, empty spacer that can be used to tune +/// the spacing between widgets in a [Flex] container, like [Row] or [Column]. +/// +/// The spacer takes up space proportional to its [flex] value relative to +/// other flexible widgets in the same container. class SduiSpacer extends SduiWidget { + /// The flex factor to use for determining how much space to take up. + /// + /// The amount of space this widget takes up is proportional to its [flex] + /// value divided by the total flex values of all widgets in the container. final int flex; + /// Creates a new [SduiSpacer] widget. + /// + /// The [flex] parameter defaults to 1, which means the spacer will take + /// up an equal amount of space as other spacers with the same flex value. SduiSpacer({this.flex = 1}); @override diff --git a/lib/src/widgets/sdui_text.dart b/lib/src/widgets/sdui_text.dart index 331869f..9a9a1d0 100644 --- a/lib/src/widgets/sdui_text.dart +++ b/lib/src/widgets/sdui_text.dart @@ -1,24 +1,64 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; -/// Represents a Text widget in SDUI. +/// A server-driven UI widget that represents a Flutter [Text] widget. +/// +/// This widget allows displaying text with customizable styling properties +/// that can be defined on the server side and rendered on the client. +/// +/// The widget supports all common text properties including font styling, +/// alignment, overflow handling, and text direction. class SduiText extends SduiWidget { + /// The text content to display. final String text; + + /// The text style to apply. This can be merged with individual style properties. final TextStyle? style; + + /// How the text should be aligned horizontally. final TextAlign? textAlign; + + /// How visual overflow should be handled. final TextOverflow? overflow; + + /// An optional maximum number of lines for the text to span. final int? maxLines; + + /// The decoration to paint near the text (e.g., underline). final TextDecoration? decoration; + + /// The size of glyphs (in logical pixels) to use when painting the text. final double? fontSize; + + /// The typeface thickness to use when painting the text. final FontWeight? fontWeight; + + /// The color to use when painting the text. final Color? color; + + /// Whether the text should break at soft line breaks. final bool? softWrap; + + /// The amount of space (in logical pixels) to add between each letter. final double? letterSpacing; + + /// The amount of space (in logical pixels) to add at each sequence of white-space. final double? wordSpacing; + + /// The height of this text span, as a multiple of the font size. final double? height; + + /// The name of the font to use when painting the text. final String? fontFamily; + + /// The directionality of the text. final TextDirection? textDirection; + /// Creates a new [SduiText] widget. + /// + /// The [text] parameter is required and specifies the content to display. + /// All other parameters are optional and can be used to customize the + /// appearance and behavior of the text. SduiText( this.text, { this.style, @@ -39,8 +79,8 @@ class SduiText extends SduiWidget { @override Widget toFlutterWidget() { - // Create a merged TextStyle that combines the individual properties with the style - TextStyle mergedStyle = (style ?? const TextStyle()).copyWith( + // Merge individual style properties with the base style + final TextStyle mergedStyle = (style ?? const TextStyle()).copyWith( decoration: decoration, fontSize: fontSize, fontWeight: fontWeight, diff --git a/lib/src/widgets/sdui_widget.dart b/lib/src/widgets/sdui_widget.dart index 2b01502..d50a7b4 100644 --- a/lib/src/widgets/sdui_widget.dart +++ b/lib/src/widgets/sdui_widget.dart @@ -1,6 +1,20 @@ import 'package:flutter/widgets.dart'; -/// Abstract class for all SDUI widgets. +/// Abstract base class for all Server-Driven UI widgets. +/// +/// This class defines the contract that all SDUI widgets must implement. +/// Each SDUI widget can be converted to its corresponding Flutter widget +/// through the [toFlutterWidget] method. +/// +/// All concrete SDUI widget implementations should extend this class and +/// provide their own implementation of [toFlutterWidget]. abstract class SduiWidget { + /// Converts this SDUI widget to its corresponding Flutter widget. + /// + /// This method is responsible for mapping the SDUI widget's properties + /// to the equivalent Flutter widget properties and returning a fully + /// configured Flutter widget instance. + /// + /// Returns a [Widget] that can be rendered in the Flutter widget tree. Widget toFlutterWidget(); } diff --git a/test/flutter_sdui_test.dart b/test/flutter_sdui_test.dart index 120d6ec..d810967 100644 --- a/test/flutter_sdui_test.dart +++ b/test/flutter_sdui_test.dart @@ -1,37 +1,34 @@ -// import 'package:flutter_test/flutter_test.dart'; - -// import 'package:flutter_sdui/flutter_sdui.dart'; - -// void main() { -// test('adds one to input values', () { -// final calculator = Calculator(); -// expect(calculator.addOne(2), 3); -// expect(calculator.addOne(-7), -6); -// expect(calculator.addOne(0), 1); -// }); -// } +import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:io'; import 'package:flutter_sdui/src/parser/sdui_proto_parser.dart'; +/// Main test entry point for Flutter SDUI package. +/// +/// This test demonstrates JSON parsing functionality by loading an example +/// JSON file, parsing it into SDUI widgets, and rendering as Flutter widgets. void main() async { WidgetsFlutterBinding.ensureInitialized(); - // Load the example JSON file - final file = File('example/example.json'); - final jsonString = await file.readAsString(); - final Map jsonData = json.decode(jsonString); + group('Flutter SDUI Tests', () { + test('JSON parsing and widget conversion', () async { + final file = File('example/example.json'); + final jsonString = await file.readAsString(); + final Map jsonData = json.decode(jsonString); - // Parse the JSON into an SDUI widget - final sduiWidget = SduiParser.parseJSON(jsonData); + final sduiWidget = SduiParser.parseJSON(jsonData); + final widget = sduiWidget.toFlutterWidget(); - // Convert to Flutter widget - final widget = sduiWidget.toFlutterWidget(); + expect(widget, isA()); + expect(sduiWidget, isNotNull); + }); - runApp(MaterialApp( - home: widget, - )); -} + test('SDUI parser handles empty JSON', () { + final emptyJson = {}; + expect(() => SduiParser.parseJSON(emptyJson), throwsA(isA())); + }); + }); +} From 58c2d226ebf7b96eda73cc279c1e4a146f61726a Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Fri, 26 Sep 2025 20:27:13 +0530 Subject: [PATCH 07/12] chore: remove outdated integration guide and documentation files --- SDUI_Flutter_Integration_Guide.txt | 1 - {docs => doc}/doc.md | 0 pubspec.yaml | 5 +++-- 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 SDUI_Flutter_Integration_Guide.txt rename {docs => doc}/doc.md (100%) diff --git a/SDUI_Flutter_Integration_Guide.txt b/SDUI_Flutter_Integration_Guide.txt deleted file mode 100644 index 0519ecb..0000000 --- a/SDUI_Flutter_Integration_Guide.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/doc.md b/doc/doc.md similarity index 100% rename from docs/doc.md rename to doc/doc.md diff --git a/pubspec.yaml b/pubspec.yaml index fe72900..0f4dfd4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,8 @@ name: flutter_sdui -description: "A Flutter package to render server driven UI." +description: "A Flutter package for implementing Server-Driven UI with both JSON and gRPC support. Build dynamic UIs that can be updated from the server without app store releases." version: 0.0.1 -# homepage: +homepage: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal +repository: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal environment: sdk: ">=3.0.0 <4.0.0" From 16cfb5e80685e649b9c0343eca05a2e671d46601 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Fri, 26 Sep 2025 20:31:55 +0530 Subject: [PATCH 08/12] chore: update changelog and package description; add .pubignore file --- .pubignore | 11 +++++++++++ CHANGELOG.md | 15 +++++++++------ pubspec.yaml | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .pubignore diff --git a/.pubignore b/.pubignore new file mode 100644 index 0000000..ac8824e --- /dev/null +++ b/.pubignore @@ -0,0 +1,11 @@ +# Files to exclude from pub.dev publishing + +SDUI_Flutter_Integration_Guide.txt +docs/ +.github/ +.hooks/ +.idea/ +\*.iml +build/ +.dart_tool/ +bin/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a813e..db72851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,12 @@ ### Added -- Basic framework for Server-Driven UI implementation -- Support for rendering UI from server-provided definitions -- gRPC integration with Protocol Buffers -- Core widget support (Text, Column, Row, Container, etc.) -- Example application demonstrating gRPC usage -- Setup scripts for Protocol Buffer compilation +- Server-Driven UI framework for Flutter +- JSON and gRPC support for dynamic UI rendering +- Protocol Buffers integration for type-safe communication +- Core widget support: Text, Column, Row, Container, Scaffold, Image, Icon, SizedBox, Spacer +- SduiGrpcClient for server communication +- SduiGrpcRenderer widget for rendering server-driven UI +- Comprehensive documentation and examples +- Flutter-to-SDUI conversion utilities +- Error handling and loading states diff --git a/pubspec.yaml b/pubspec.yaml index 0f4dfd4..176c7aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: flutter_sdui -description: "A Flutter package for implementing Server-Driven UI with both JSON and gRPC support. Build dynamic UIs that can be updated from the server without app store releases." +description: "A Flutter package for Server-Driven UI with JSON and gRPC support. Build dynamic UIs updated from the server without app releases." version: 0.0.1 homepage: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal repository: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal From 4e67ff323360597f58cdbb7c18ffb5ca9dda1359 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Fri, 26 Sep 2025 20:33:46 +0530 Subject: [PATCH 09/12] chore: update homepage and repository URLs in pubspec.yaml --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 176c7aa..522644f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,8 @@ name: flutter_sdui description: "A Flutter package for Server-Driven UI with JSON and gRPC support. Build dynamic UIs updated from the server without app releases." version: 0.0.1 -homepage: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal -repository: https://github.com/JothishKamal/flutter-sdui-package-JothishKamal +homepage: https://github.com/GDGVIT/flutter-sdui-package +repository: https://github.com/GDGVIT/flutter-sdui-package environment: sdk: ">=3.0.0 <4.0.0" From 253f18bd6d49fdcf7433d289bfcc5ce13f53785b Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Fri, 26 Sep 2025 20:52:04 +0530 Subject: [PATCH 10/12] chore: update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index c0381c4..ed67ed6 100644 --- a/README.md +++ b/README.md @@ -354,6 +354,34 @@ This project is licensed under the [LICENSE](LICENSE) file in the repository.

+ Rujin Devkota +

+ Rujin Devkota +

+

+ + GitHub + + + LinkedIn + +

+
+ Adhavan K +

+ Adhavan K +

+

+ + GitHub + + + LinkedIn + +

+
From bf4e652d4f75cb36fe440c8563be6ecaa9ca4265 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Tue, 30 Sep 2025 18:02:57 +0530 Subject: [PATCH 11/12] fix: lint warnings and update LICENSE --- LICENSE | 154 +--- example/grpc_server_example_dart.dart | 11 +- lib/src/parser/flutter_to_sdui.dart | 38 +- lib/src/parser/sdui_proto_parser.dart | 1020 ++++++++++++++++++------- lib/src/widgets/sdui_icon.dart | 6 +- lib/src/widgets/sdui_image.dart | 4 +- lib/src/widgets/sdui_scaffold.dart | 4 +- 7 files changed, 793 insertions(+), 444 deletions(-) diff --git a/LICENSE b/LICENSE index f288702..0d72230 100644 --- a/LICENSE +++ b/LICENSE @@ -1,135 +1,25 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. +MIT License + +Copyright (c) 2025 GDSC-VIT and Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable diff --git a/example/grpc_server_example_dart.dart b/example/grpc_server_example_dart.dart index 4c5840b..2cf54a3 100644 --- a/example/grpc_server_example_dart.dart +++ b/example/grpc_server_example_dart.dart @@ -13,6 +13,9 @@ /// ``` /// /// The server listens on port 50051 by default. +library; +import 'dart:developer'; + import 'package:grpc/grpc.dart'; import 'package:flutter_sdui/src/generated/sdui.pbgrpc.dart'; @@ -29,8 +32,8 @@ Future main() async { const port = 50051; await server.serve(port: port); - print('Server listening on port $port...'); - print('Press Ctrl+C to stop'); + log('Server listening on port $port...'); + log('Press Ctrl+C to stop'); } /// Implementation of the SDUI gRPC service. @@ -41,7 +44,7 @@ class SduiServiceImpl extends SduiServiceBase { @override Future getSduiWidget( ServiceCall call, SduiRequest request) async { - print('Received request for screen: ${request.screenId}'); + log('Received request for screen: ${request.screenId}'); switch (request.screenId) { case 'home': @@ -51,7 +54,7 @@ class SduiServiceImpl extends SduiServiceBase { case 'settings': return _createSettingsScreen(); default: - print('Warning: Unknown screen ID requested: ${request.screenId}'); + log('Warning: Unknown screen ID requested: ${request.screenId}'); return _createErrorScreen(); } } diff --git a/lib/src/parser/flutter_to_sdui.dart b/lib/src/parser/flutter_to_sdui.dart index b3c23d2..8ed0903 100644 --- a/lib/src/parser/flutter_to_sdui.dart +++ b/lib/src/parser/flutter_to_sdui.dart @@ -50,7 +50,9 @@ SduiWidget flutterToSdui(Widget widget) { width: widget.width, height: widget.height, fit: widget.fit, - alignment: widget.alignment is Alignment ? widget.alignment as Alignment : null, + alignment: widget.alignment is Alignment + ? widget.alignment as Alignment + : null, repeat: widget.repeat, color: widget.color, colorBlendMode: widget.colorBlendMode, @@ -75,27 +77,40 @@ SduiWidget flutterToSdui(Widget widget) { } else if (widget is Container) { return SduiContainer( child: widget.child != null ? flutterToSdui(widget.child!) : null, - padding: widget.padding is EdgeInsets ? widget.padding as EdgeInsets : null, + padding: + widget.padding is EdgeInsets ? widget.padding as EdgeInsets : null, margin: widget.margin is EdgeInsets ? widget.margin as EdgeInsets : null, - decoration: widget.decoration is BoxDecoration ? widget.decoration as BoxDecoration : null, + decoration: widget.decoration is BoxDecoration + ? widget.decoration as BoxDecoration + : null, width: null, // Container does not expose width directly height: null, // Container does not expose height directly color: widget.color, - alignment: widget.alignment is Alignment ? widget.alignment as Alignment : null, + alignment: + widget.alignment is Alignment ? widget.alignment as Alignment : null, constraints: widget.constraints, transform: widget.transform, - transformAlignment: widget.transformAlignment is AlignmentGeometry ? widget.transformAlignment as AlignmentGeometry : null, + transformAlignment: widget.transformAlignment is AlignmentGeometry + ? widget.transformAlignment as AlignmentGeometry + : null, clipBehavior: widget.clipBehavior, ); } else if (widget is Scaffold) { return SduiScaffold( appBar: widget.appBar != null ? flutterToSdui(widget.appBar!) : null, body: widget.body != null ? flutterToSdui(widget.body!) : null, - floatingActionButton: widget.floatingActionButton != null ? flutterToSdui(widget.floatingActionButton!) : null, - bottomNavigationBar: widget.bottomNavigationBar != null ? flutterToSdui(widget.bottomNavigationBar!) : null, + floatingActionButton: widget.floatingActionButton != null + ? flutterToSdui(widget.floatingActionButton!) + : null, + bottomNavigationBar: widget.bottomNavigationBar != null + ? flutterToSdui(widget.bottomNavigationBar!) + : null, drawer: widget.drawer != null ? flutterToSdui(widget.drawer!) : null, - endDrawer: widget.endDrawer != null ? flutterToSdui(widget.endDrawer!) : null, - bottomSheet: widget.bottomSheet != null ? flutterToSdui(widget.bottomSheet!) : null, + endDrawer: + widget.endDrawer != null ? flutterToSdui(widget.endDrawer!) : null, + bottomSheet: widget.bottomSheet != null + ? flutterToSdui(widget.bottomSheet!) + : null, backgroundColor: widget.backgroundColor, resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset, primary: widget.primary, @@ -121,5 +136,6 @@ SduiWidget flutterToSdui(Widget widget) { shadows: widget.shadows, ); } - throw UnimplementedError('Conversion for ${widget.runtimeType} is not implemented'); -} \ No newline at end of file + throw UnimplementedError( + 'Conversion for ${widget.runtimeType} is not implemented'); +} diff --git a/lib/src/parser/sdui_proto_parser.dart b/lib/src/parser/sdui_proto_parser.dart index 91133fc..ed34f5b 100644 --- a/lib/src/parser/sdui_proto_parser.dart +++ b/lib/src/parser/sdui_proto_parser.dart @@ -155,7 +155,8 @@ class SduiParser { double? wordSpacing = data.hasWordSpacing() ? data.wordSpacing : null; double? height = data.hasHeight() ? data.height : null; String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; - final TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); + final TextDirection? textDirection = + _parseProtoTextDirection(data.textDirection); double? fontSize = style?.fontSize; FontWeight? fontWeight = style?.fontWeight; @@ -163,13 +164,25 @@ class SduiParser { TextDecoration? decoration = style?.decoration; if (data.hasTextStyle()) { if (data.textStyle.hasFontSize()) fontSize = data.textStyle.fontSize; - if (data.textStyle.hasFontWeight()) fontWeight = _parseProtoFontWeight(data.textStyle.fontWeight); - if (data.textStyle.hasColor()) color = _parseProtoColor(data.textStyle.color); - if (data.textStyle.hasDecoration()) decoration = _parseProtoTextDecoration(data.textStyle.decoration); - if (data.textStyle.hasLetterSpacing()) letterSpacing = data.textStyle.letterSpacing; - if (data.textStyle.hasWordSpacing()) wordSpacing = data.textStyle.wordSpacing; + if (data.textStyle.hasFontWeight()) { + fontWeight = _parseProtoFontWeight(data.textStyle.fontWeight); + } + if (data.textStyle.hasColor()) { + color = _parseProtoColor(data.textStyle.color); + } + if (data.textStyle.hasDecoration()) { + decoration = _parseProtoTextDecoration(data.textStyle.decoration); + } + if (data.textStyle.hasLetterSpacing()) { + letterSpacing = data.textStyle.letterSpacing; + } + if (data.textStyle.hasWordSpacing()) { + wordSpacing = data.textStyle.wordSpacing; + } if (data.textStyle.hasHeight()) height = data.textStyle.height; - if (data.textStyle.hasFontFamily()) fontFamily = data.textStyle.fontFamily; + if (data.textStyle.hasFontFamily()) { + fontFamily = data.textStyle.fontFamily; + } } return SduiText( @@ -587,7 +600,7 @@ class SduiParser { ); } - return BorderRadius.circular(8.0); + return BorderRadius.circular(8.0); } // New helper methods for parsing new property types @@ -933,7 +946,8 @@ class SduiParser { return SduiColumn( children: children, mainAxisAlignment: _parseJsonMainAxisAlignment(data['mainAxisAlignment']), - crossAxisAlignment: _parseJsonCrossAxisAlignment(data['crossAxisAlignment']), + crossAxisAlignment: + _parseJsonCrossAxisAlignment(data['crossAxisAlignment']), mainAxisSize: _parseJsonMainAxisSize(data['mainAxisSize']), textDirection: _parseJsonTextDirection(data['textDirection']), verticalDirection: _parseJsonVerticalDirection(data['verticalDirection']), @@ -1037,7 +1051,8 @@ class SduiParser { return SduiRow( children: children, mainAxisAlignment: _parseJsonMainAxisAlignment(data['mainAxisAlignment']), - crossAxisAlignment: _parseJsonCrossAxisAlignment(data['crossAxisAlignment']), + crossAxisAlignment: + _parseJsonCrossAxisAlignment(data['crossAxisAlignment']), mainAxisSize: _parseJsonMainAxisSize(data['mainAxisSize']), textDirection: _parseJsonTextDirection(data['textDirection']), verticalDirection: _parseJsonVerticalDirection(data['verticalDirection']), @@ -1051,34 +1066,54 @@ class SduiParser { style: _parseJsonTextStyle(data['style']), textAlign: _parseJsonTextAlign(data['textAlign']), overflow: _parseJsonTextOverflow(data['overflow']), - maxLines: data['maxLines'] is int ? data['maxLines'] : int.tryParse(data['maxLines']?.toString() ?? ''), + maxLines: data['maxLines'] is int + ? data['maxLines'] + : int.tryParse(data['maxLines']?.toString() ?? ''), softWrap: data['softWrap'] is bool ? data['softWrap'] : null, - letterSpacing: (data['letterSpacing'] is num) ? (data['letterSpacing'] as num).toDouble() : null, - wordSpacing: (data['wordSpacing'] is num) ? (data['wordSpacing'] as num).toDouble() : null, - height: (data['height'] is num) ? (data['height'] as num).toDouble() : null, + letterSpacing: (data['letterSpacing'] is num) + ? (data['letterSpacing'] as num).toDouble() + : null, + wordSpacing: (data['wordSpacing'] is num) + ? (data['wordSpacing'] as num).toDouble() + : null, + height: + (data['height'] is num) ? (data['height'] as num).toDouble() : null, fontFamily: data['fontFamily']?.toString(), textDirection: _parseJsonTextDirection(data['textDirection']), ); } static SduiImage _parseJsonImage(Map data) { - SduiWidget? errorSduiWidget = data['errorWidget'] is Map ? parseJSON(data['errorWidget']) : null; - SduiWidget? loadingSduiWidget = data['loadingWidget'] is Map ? parseJSON(data['loadingWidget']) : null; + SduiWidget? errorSduiWidget = data['errorWidget'] is Map + ? parseJSON(data['errorWidget']) + : null; + SduiWidget? loadingSduiWidget = + data['loadingWidget'] is Map + ? parseJSON(data['loadingWidget']) + : null; return SduiImage( data['src']?.toString() ?? '', width: (data['width'] is num) ? (data['width'] as num).toDouble() : null, - height: (data['height'] is num) ? (data['height'] as num).toDouble() : null, + height: + (data['height'] is num) ? (data['height'] as num).toDouble() : null, fit: _parseJsonBoxFit(data['fit']), alignment: _parseJsonAlignment(data['alignment']), repeat: _parseJsonImageRepeat(data['repeat']), color: _parseJsonColor(data['color']), colorBlendMode: _parseJsonBlendMode(data['colorBlendMode']), centerSlice: _parseJsonRect(data['centerSlice']), - matchTextDirection: data['matchTextDirection'] is bool ? data['matchTextDirection'] : null, - gaplessPlayback: data['gaplessPlayback'] is bool ? data['gaplessPlayback'] : null, + matchTextDirection: data['matchTextDirection'] is bool + ? data['matchTextDirection'] + : null, + gaplessPlayback: + data['gaplessPlayback'] is bool ? data['gaplessPlayback'] : null, filterQuality: _parseJsonFilterQuality(data['filterQuality']), - cacheWidth: data['cacheWidth'] is int ? data['cacheWidth'] : int.tryParse(data['cacheWidth']?.toString() ?? ''), - cacheHeight: data['cacheHeight'] is int ? data['cacheHeight'] : int.tryParse(data['cacheHeight']?.toString() ?? ''), + cacheWidth: data['cacheWidth'] is int + ? data['cacheWidth'] + : int.tryParse(data['cacheWidth']?.toString() ?? ''), + cacheHeight: data['cacheHeight'] is int + ? data['cacheHeight'] + : int.tryParse(data['cacheHeight']?.toString() ?? ''), scale: (data['scale'] is num) ? (data['scale'] as num).toDouble() : null, semanticLabel: data['semanticLabel']?.toString(), errorWidget: errorSduiWidget?.toFlutterWidget(), @@ -1089,53 +1124,87 @@ class SduiParser { static SduiSizedBox _parseJsonSizedBox(Map data) { return SduiSizedBox( width: (data['width'] is num) ? (data['width'] as num).toDouble() : null, - height: (data['height'] is num) ? (data['height'] as num).toDouble() : null, - child: data['child'] is Map ? parseJSON(data['child']) : null, + height: + (data['height'] is num) ? (data['height'] as num).toDouble() : null, + child: data['child'] is Map + ? parseJSON(data['child']) + : null, ); } static SduiContainer _parseJsonContainer(Map data) { return SduiContainer( - child: data['child'] is Map ? parseJSON(data['child']) : null, + child: data['child'] is Map + ? parseJSON(data['child']) + : null, padding: _parseJsonEdgeInsets(data['padding']), margin: _parseJsonEdgeInsets(data['margin']), decoration: _parseJsonBoxDecoration(data['decoration']), width: (data['width'] is num) ? (data['width'] as num).toDouble() : null, - height: (data['height'] is num) ? (data['height'] as num).toDouble() : null, + height: + (data['height'] is num) ? (data['height'] as num).toDouble() : null, color: _parseJsonColor(data['color']), alignment: _parseJsonAlignment(data['alignment']), constraints: _parseJsonBoxConstraints(data['constraints']), transform: _parseJsonTransform(data['transform']), - transformAlignment: _parseJsonAlignmentGeometry(data['transformAlignment']), + transformAlignment: + _parseJsonAlignmentGeometry(data['transformAlignment']), clipBehavior: _parseJsonClip(data['clipBehavior']), ); } static SduiScaffold _parseJsonScaffold(Map data) { return SduiScaffold( - appBar: data['appBar'] is Map ? parseJSON(data['appBar']) : null, - body: data['body'] is Map ? parseJSON(data['body']) : null, - floatingActionButton: data['floatingActionButton'] is Map ? parseJSON(data['floatingActionButton']) : null, - bottomNavigationBar: data['bottomNavigationBar'] is Map ? parseJSON(data['bottomNavigationBar']) : null, - drawer: data['drawer'] is Map ? parseJSON(data['drawer']) : null, - endDrawer: data['endDrawer'] is Map ? parseJSON(data['endDrawer']) : null, - bottomSheet: data['bottomSheet'] is Map ? parseJSON(data['bottomSheet']) : null, + appBar: data['appBar'] is Map + ? parseJSON(data['appBar']) + : null, + body: + data['body'] is Map ? parseJSON(data['body']) : null, + floatingActionButton: data['floatingActionButton'] is Map + ? parseJSON(data['floatingActionButton']) + : null, + bottomNavigationBar: data['bottomNavigationBar'] is Map + ? parseJSON(data['bottomNavigationBar']) + : null, + drawer: data['drawer'] is Map + ? parseJSON(data['drawer']) + : null, + endDrawer: data['endDrawer'] is Map + ? parseJSON(data['endDrawer']) + : null, + bottomSheet: data['bottomSheet'] is Map + ? parseJSON(data['bottomSheet']) + : null, backgroundColor: _parseJsonColor(data['backgroundColor']), - resizeToAvoidBottomInset: data['resizeToAvoidBottomInset'] is bool ? data['resizeToAvoidBottomInset'] : null, + resizeToAvoidBottomInset: data['resizeToAvoidBottomInset'] is bool + ? data['resizeToAvoidBottomInset'] + : null, primary: data['primary'] is bool ? data['primary'] : null, - floatingActionButtonLocation: _parseJsonFabLocation(data['floatingActionButtonLocation']), + floatingActionButtonLocation: + _parseJsonFabLocation(data['floatingActionButtonLocation']), extendBody: data['extendBody'] is bool ? data['extendBody'] : null, - extendBodyBehindAppBar: data['extendBodyBehindAppBar'] is bool ? data['extendBodyBehindAppBar'] : null, + extendBodyBehindAppBar: data['extendBodyBehindAppBar'] is bool + ? data['extendBodyBehindAppBar'] + : null, drawerScrimColor: _parseJsonColor(data['drawerScrimColor']), - drawerEdgeDragWidth: (data['drawerEdgeDragWidth'] is num) ? (data['drawerEdgeDragWidth'] as num).toDouble() : null, - drawerEnableOpenDragGesture: data['drawerEnableOpenDragGesture'] is bool ? data['drawerEnableOpenDragGesture'] : null, - endDrawerEnableOpenDragGesture: data['endDrawerEnableOpenDragGesture'] is bool ? data['endDrawerEnableOpenDragGesture'] : null, + drawerEdgeDragWidth: (data['drawerEdgeDragWidth'] is num) + ? (data['drawerEdgeDragWidth'] as num).toDouble() + : null, + drawerEnableOpenDragGesture: data['drawerEnableOpenDragGesture'] is bool + ? data['drawerEnableOpenDragGesture'] + : null, + endDrawerEnableOpenDragGesture: + data['endDrawerEnableOpenDragGesture'] is bool + ? data['endDrawerEnableOpenDragGesture'] + : null, ); } static SduiSpacer _parseJsonSpacer(Map data) { return SduiSpacer( - flex: data['flex'] is int ? data['flex'] : int.tryParse(data['flex']?.toString() ?? '') ?? 1, + flex: data['flex'] is int + ? data['flex'] + : int.tryParse(data['flex']?.toString() ?? '') ?? 1, ); } @@ -1146,8 +1215,10 @@ class SduiParser { color: _parseJsonColor(data['color']), semanticLabel: data['semanticLabel']?.toString(), textDirection: _parseJsonTextDirection(data['textDirection']), - opacity: (data['opacity'] is num) ? (data['opacity'] as num).toDouble() : null, - applyTextScaling: data['applyTextScaling'] is bool ? data['applyTextScaling'] : null, + opacity: + (data['opacity'] is num) ? (data['opacity'] as num).toDouble() : null, + applyTextScaling: + data['applyTextScaling'] is bool ? data['applyTextScaling'] : null, shadows: _parseJsonShadows(data['shadows']), ); } @@ -1157,12 +1228,19 @@ class SduiParser { if (value is! Map) return null; return TextStyle( color: _parseJsonColor(value['color']), - fontSize: (value['fontSize'] is num) ? (value['fontSize'] as num).toDouble() : null, + fontSize: (value['fontSize'] is num) + ? (value['fontSize'] as num).toDouble() + : null, fontWeight: _parseJsonFontWeight(value['fontWeight']), decoration: _parseJsonTextDecoration(value['decoration']), - letterSpacing: (value['letterSpacing'] is num) ? (value['letterSpacing'] as num).toDouble() : null, - wordSpacing: (value['wordSpacing'] is num) ? (value['wordSpacing'] as num).toDouble() : null, - height: (value['height'] is num) ? (value['height'] as num).toDouble() : null, + letterSpacing: (value['letterSpacing'] is num) + ? (value['letterSpacing'] as num).toDouble() + : null, + wordSpacing: (value['wordSpacing'] is num) + ? (value['wordSpacing'] as num).toDouble() + : null, + height: + (value['height'] is num) ? (value['height'] as num).toDouble() : null, fontFamily: value['fontFamily']?.toString(), fontStyle: _parseJsonFontStyle(value['fontStyle']), ); @@ -1375,48 +1453,78 @@ class SduiParser { static BlendMode? _parseJsonBlendMode(dynamic value) { if (value == null) return null; switch (value.toString().toLowerCase()) { - case 'clear': return BlendMode.clear; - case 'src': return BlendMode.src; - case 'dst': return BlendMode.dst; + case 'clear': + return BlendMode.clear; + case 'src': + return BlendMode.src; + case 'dst': + return BlendMode.dst; case 'srcover': - case 'src_over': return BlendMode.srcOver; + case 'src_over': + return BlendMode.srcOver; case 'dstover': - case 'dst_over': return BlendMode.dstOver; + case 'dst_over': + return BlendMode.dstOver; case 'srcin': - case 'src_in': return BlendMode.srcIn; + case 'src_in': + return BlendMode.srcIn; case 'dstin': - case 'dst_in': return BlendMode.dstIn; + case 'dst_in': + return BlendMode.dstIn; case 'srcout': - case 'src_out': return BlendMode.srcOut; + case 'src_out': + return BlendMode.srcOut; case 'dstout': - case 'dst_out': return BlendMode.dstOut; + case 'dst_out': + return BlendMode.dstOut; case 'srcatop': - case 'src_atop': return BlendMode.srcATop; + case 'src_atop': + return BlendMode.srcATop; case 'dstatop': - case 'dst_atop': return BlendMode.dstATop; - case 'xor': return BlendMode.xor; - case 'plus': return BlendMode.plus; - case 'modulate': return BlendMode.modulate; - case 'screen': return BlendMode.screen; - case 'overlay': return BlendMode.overlay; - case 'darken': return BlendMode.darken; - case 'lighten': return BlendMode.lighten; + case 'dst_atop': + return BlendMode.dstATop; + case 'xor': + return BlendMode.xor; + case 'plus': + return BlendMode.plus; + case 'modulate': + return BlendMode.modulate; + case 'screen': + return BlendMode.screen; + case 'overlay': + return BlendMode.overlay; + case 'darken': + return BlendMode.darken; + case 'lighten': + return BlendMode.lighten; case 'colordodge': - case 'color_dodge': return BlendMode.colorDodge; + case 'color_dodge': + return BlendMode.colorDodge; case 'colorburn': - case 'color_burn': return BlendMode.colorBurn; + case 'color_burn': + return BlendMode.colorBurn; case 'hardlight': - case 'hard_light': return BlendMode.hardLight; + case 'hard_light': + return BlendMode.hardLight; case 'softlight': - case 'soft_light': return BlendMode.softLight; - case 'difference': return BlendMode.difference; - case 'exclusion': return BlendMode.exclusion; - case 'multiply': return BlendMode.multiply; - case 'hue': return BlendMode.hue; - case 'saturation': return BlendMode.saturation; - case 'color': return BlendMode.color; - case 'luminosity': return BlendMode.luminosity; - default: return null; + case 'soft_light': + return BlendMode.softLight; + case 'difference': + return BlendMode.difference; + case 'exclusion': + return BlendMode.exclusion; + case 'multiply': + return BlendMode.multiply; + case 'hue': + return BlendMode.hue; + case 'saturation': + return BlendMode.saturation; + case 'color': + return BlendMode.color; + case 'luminosity': + return BlendMode.luminosity; + default: + return null; } } @@ -1435,11 +1543,16 @@ class SduiParser { static FilterQuality? _parseJsonFilterQuality(dynamic value) { if (value == null) return null; switch (value.toString().toLowerCase()) { - case 'none': return FilterQuality.none; - case 'low': return FilterQuality.low; - case 'medium': return FilterQuality.medium; - case 'high': return FilterQuality.high; - default: return null; + case 'none': + return FilterQuality.none; + case 'low': + return FilterQuality.low; + case 'medium': + return FilterQuality.medium; + case 'high': + return FilterQuality.high; + default: + return null; } } @@ -1451,8 +1564,11 @@ class SduiParser { return EdgeInsets.only( left: (value['left'] is num) ? (value['left'] as num).toDouble() : 0.0, top: (value['top'] is num) ? (value['top'] as num).toDouble() : 0.0, - right: (value['right'] is num) ? (value['right'] as num).toDouble() : 0.0, - bottom: (value['bottom'] is num) ? (value['bottom'] as num).toDouble() : 0.0, + right: + (value['right'] is num) ? (value['right'] as num).toDouble() : 0.0, + bottom: (value['bottom'] is num) + ? (value['bottom'] as num).toDouble() + : 0.0, ); } return null; @@ -1470,13 +1586,22 @@ class SduiParser { static BorderRadius? _parseJsonBorderRadius(dynamic value) { if (value is Map) { if (value.containsKey('all')) { - return BorderRadius.all(Radius.circular((value['all'] as num).toDouble())); + return BorderRadius.all( + Radius.circular((value['all'] as num).toDouble())); } return BorderRadius.only( - topLeft: value['topLeft'] != null ? Radius.circular((value['topLeft'] as num).toDouble()) : Radius.zero, - topRight: value['topRight'] != null ? Radius.circular((value['topRight'] as num).toDouble()) : Radius.zero, - bottomLeft: value['bottomLeft'] != null ? Radius.circular((value['bottomLeft'] as num).toDouble()) : Radius.zero, - bottomRight: value['bottomRight'] != null ? Radius.circular((value['bottomRight'] as num).toDouble()) : Radius.zero, + topLeft: value['topLeft'] != null + ? Radius.circular((value['topLeft'] as num).toDouble()) + : Radius.zero, + topRight: value['topRight'] != null + ? Radius.circular((value['topRight'] as num).toDouble()) + : Radius.zero, + bottomLeft: value['bottomLeft'] != null + ? Radius.circular((value['bottomLeft'] as num).toDouble()) + : Radius.zero, + bottomRight: value['bottomRight'] != null + ? Radius.circular((value['bottomRight'] as num).toDouble()) + : Radius.zero, ); } return null; @@ -1485,10 +1610,18 @@ class SduiParser { static BoxConstraints? _parseJsonBoxConstraints(dynamic value) { if (value is Map) { return BoxConstraints( - minWidth: (value['minWidth'] is num) ? (value['minWidth'] as num).toDouble() : 0.0, - maxWidth: (value['maxWidth'] is num) ? (value['maxWidth'] as num).toDouble() : double.infinity, - minHeight: (value['minHeight'] is num) ? (value['minHeight'] as num).toDouble() : 0.0, - maxHeight: (value['maxHeight'] is num) ? (value['maxHeight'] as num).toDouble() : double.infinity, + minWidth: (value['minWidth'] is num) + ? (value['minWidth'] as num).toDouble() + : 0.0, + maxWidth: (value['maxWidth'] is num) + ? (value['maxWidth'] as num).toDouble() + : double.infinity, + minHeight: (value['minHeight'] is num) + ? (value['minHeight'] as num).toDouble() + : 0.0, + maxHeight: (value['maxHeight'] is num) + ? (value['maxHeight'] as num).toDouble() + : double.infinity, ); } return null; @@ -1500,10 +1633,22 @@ class SduiParser { final vals = value['matrixValues'] as List; if (vals.length == 16) { return Matrix4( - (vals[0] as num).toDouble(), (vals[1] as num).toDouble(), (vals[2] as num).toDouble(), (vals[3] as num).toDouble(), - (vals[4] as num).toDouble(), (vals[5] as num).toDouble(), (vals[6] as num).toDouble(), (vals[7] as num).toDouble(), - (vals[8] as num).toDouble(), (vals[9] as num).toDouble(), (vals[10] as num).toDouble(), (vals[11] as num).toDouble(), - (vals[12] as num).toDouble(), (vals[13] as num).toDouble(), (vals[14] as num).toDouble(), (vals[15] as num).toDouble(), + (vals[0] as num).toDouble(), + (vals[1] as num).toDouble(), + (vals[2] as num).toDouble(), + (vals[3] as num).toDouble(), + (vals[4] as num).toDouble(), + (vals[5] as num).toDouble(), + (vals[6] as num).toDouble(), + (vals[7] as num).toDouble(), + (vals[8] as num).toDouble(), + (vals[9] as num).toDouble(), + (vals[10] as num).toDouble(), + (vals[11] as num).toDouble(), + (vals[12] as num).toDouble(), + (vals[13] as num).toDouble(), + (vals[14] as num).toDouble(), + (vals[15] as num).toDouble(), ); } } else if (value['type'] == 'translate') { @@ -1532,13 +1677,18 @@ class SduiParser { static Clip? _parseJsonClip(dynamic value) { if (value == null) return null; switch (value.toString().toLowerCase()) { - case 'none': return Clip.none; + case 'none': + return Clip.none; case 'hardedge': - case 'hard_edge': return Clip.hardEdge; - case 'antialias': return Clip.antiAlias; + case 'hard_edge': + return Clip.hardEdge; + case 'antialias': + return Clip.antiAlias; case 'antialiaswithsavelayer': - case 'antialias_with_save_layer': return Clip.antiAliasWithSaveLayer; - default: return null; + case 'antialias_with_save_layer': + return Clip.antiAliasWithSaveLayer; + default: + return null; } } @@ -1546,33 +1696,46 @@ class SduiParser { if (value == null) return null; switch (value.toString().toLowerCase()) { case 'starttop': - case 'start_top': return FloatingActionButtonLocation.startTop; + case 'start_top': + return FloatingActionButtonLocation.startTop; case 'start': case 'startfloat': - case 'start_float': return FloatingActionButtonLocation.startFloat; + case 'start_float': + return FloatingActionButtonLocation.startFloat; case 'centertop': - case 'center_top': return FloatingActionButtonLocation.centerTop; + case 'center_top': + return FloatingActionButtonLocation.centerTop; case 'center': case 'centerfloat': - case 'center_float': return FloatingActionButtonLocation.centerFloat; + case 'center_float': + return FloatingActionButtonLocation.centerFloat; case 'endtop': - case 'end_top': return FloatingActionButtonLocation.endTop; + case 'end_top': + return FloatingActionButtonLocation.endTop; case 'end': case 'endfloat': - case 'end_float': return FloatingActionButtonLocation.endFloat; + case 'end_float': + return FloatingActionButtonLocation.endFloat; case 'minicentertop': - case 'mini_center_top': return FloatingActionButtonLocation.miniCenterTop; + case 'mini_center_top': + return FloatingActionButtonLocation.miniCenterTop; case 'minicenterfloat': - case 'mini_center_float': return FloatingActionButtonLocation.miniCenterFloat; + case 'mini_center_float': + return FloatingActionButtonLocation.miniCenterFloat; case 'ministarttop': - case 'mini_start_top': return FloatingActionButtonLocation.miniStartTop; + case 'mini_start_top': + return FloatingActionButtonLocation.miniStartTop; case 'ministartfloat': - case 'mini_start_float': return FloatingActionButtonLocation.miniStartFloat; + case 'mini_start_float': + return FloatingActionButtonLocation.miniStartFloat; case 'miniendtop': - case 'mini_end_top': return FloatingActionButtonLocation.miniEndTop; + case 'mini_end_top': + return FloatingActionButtonLocation.miniEndTop; case 'miniendfloat': - case 'mini_end_float': return FloatingActionButtonLocation.miniEndFloat; - default: return null; + case 'mini_end_float': + return FloatingActionButtonLocation.miniEndFloat; + default: + return null; } } @@ -1580,27 +1743,41 @@ class SduiParser { if (value == null) return null; if (value is String) { switch (value.toLowerCase()) { - case 'settings': return Icons.settings; - case 'home': return Icons.home; - case 'search': return Icons.search; - case 'add': return Icons.add; - case 'edit': return Icons.edit; - default: break; + case 'settings': + return Icons.settings; + case 'home': + return Icons.home; + case 'search': + return Icons.search; + case 'add': + return Icons.add; + case 'edit': + return Icons.edit; + default: + break; } } else if (value is Map) { if (value['name'] != null) { switch (value['name'].toString().toLowerCase()) { - case 'settings': return Icons.settings; - case 'home': return Icons.home; - case 'search': return Icons.search; - case 'add': return Icons.add; - case 'edit': return Icons.edit; - default: break; + case 'settings': + return Icons.settings; + case 'home': + return Icons.home; + case 'search': + return Icons.search; + case 'add': + return Icons.add; + case 'edit': + return Icons.edit; + default: + break; } } if (value['codePoint'] != null) { return IconData( - value['codePoint'] is int ? value['codePoint'] : int.tryParse(value['codePoint'].toString()) ?? 0, + value['codePoint'] is int + ? value['codePoint'] + : int.tryParse(value['codePoint'].toString()) ?? 0, fontFamily: value['fontFamily']?.toString() ?? 'MaterialIcons', ); } @@ -1618,7 +1795,9 @@ class SduiParser { (v['offsetX'] is num) ? (v['offsetX'] as num).toDouble() : 0.0, (v['offsetY'] is num) ? (v['offsetY'] as num).toDouble() : 0.0, ), - blurRadius: (v['blurRadius'] is num) ? (v['blurRadius'] as num).toDouble() : 0.0, + blurRadius: (v['blurRadius'] is num) + ? (v['blurRadius'] as num).toDouble() + : 0.0, ); } return const Shadow(); @@ -1653,12 +1832,21 @@ class SduiParser { static Map _toJsonColumn(SduiColumn widget) { return { 'type': 'column', - if (widget.mainAxisAlignment != null) 'mainAxisAlignment': widget.mainAxisAlignment.toString().split('.').last, - if (widget.crossAxisAlignment != null) 'crossAxisAlignment': widget.crossAxisAlignment.toString().split('.').last, - if (widget.mainAxisSize != null) 'mainAxisSize': widget.mainAxisSize.toString().split('.').last, - if (widget.textDirection != null) 'textDirection': widget.textDirection.toString().split('.').last, - if (widget.verticalDirection != null) 'verticalDirection': widget.verticalDirection.toString().split('.').last, - if (widget.textBaseline != null) 'textBaseline': widget.textBaseline.toString().split('.').last, + if (widget.mainAxisAlignment != null) + 'mainAxisAlignment': + widget.mainAxisAlignment.toString().split('.').last, + if (widget.crossAxisAlignment != null) + 'crossAxisAlignment': + widget.crossAxisAlignment.toString().split('.').last, + if (widget.mainAxisSize != null) + 'mainAxisSize': widget.mainAxisSize.toString().split('.').last, + if (widget.textDirection != null) + 'textDirection': widget.textDirection.toString().split('.').last, + if (widget.verticalDirection != null) + 'verticalDirection': + widget.verticalDirection.toString().split('.').last, + if (widget.textBaseline != null) + 'textBaseline': widget.textBaseline.toString().split('.').last, 'children': widget.children.map(toJson).toList(), }; } @@ -1666,12 +1854,21 @@ class SduiParser { static Map _toJsonRow(SduiRow widget) { return { 'type': 'row', - if (widget.mainAxisAlignment != null) 'mainAxisAlignment': widget.mainAxisAlignment.toString().split('.').last, - if (widget.crossAxisAlignment != null) 'crossAxisAlignment': widget.crossAxisAlignment.toString().split('.').last, - if (widget.mainAxisSize != null) 'mainAxisSize': widget.mainAxisSize.toString().split('.').last, - if (widget.textDirection != null) 'textDirection': widget.textDirection.toString().split('.').last, - if (widget.verticalDirection != null) 'verticalDirection': widget.verticalDirection.toString().split('.').last, - if (widget.textBaseline != null) 'textBaseline': widget.textBaseline.toString().split('.').last, + if (widget.mainAxisAlignment != null) + 'mainAxisAlignment': + widget.mainAxisAlignment.toString().split('.').last, + if (widget.crossAxisAlignment != null) + 'crossAxisAlignment': + widget.crossAxisAlignment.toString().split('.').last, + if (widget.mainAxisSize != null) + 'mainAxisSize': widget.mainAxisSize.toString().split('.').last, + if (widget.textDirection != null) + 'textDirection': widget.textDirection.toString().split('.').last, + if (widget.verticalDirection != null) + 'verticalDirection': + widget.verticalDirection.toString().split('.').last, + if (widget.textBaseline != null) + 'textBaseline': widget.textBaseline.toString().split('.').last, 'children': widget.children.map(toJson).toList(), }; } @@ -1681,29 +1878,36 @@ class SduiParser { 'type': 'text', 'text': widget.text, if (widget.style != null) 'style': _toJsonTextStyle(widget.style!), - if (widget.textAlign != null) 'textAlign': widget.textAlign.toString().split('.').last, - if (widget.overflow != null) 'overflow': widget.overflow.toString().split('.').last, + if (widget.textAlign != null) + 'textAlign': widget.textAlign.toString().split('.').last, + if (widget.overflow != null) + 'overflow': widget.overflow.toString().split('.').last, if (widget.maxLines != null) 'maxLines': widget.maxLines, if (widget.softWrap != null) 'softWrap': widget.softWrap, if (widget.letterSpacing != null) 'letterSpacing': widget.letterSpacing, if (widget.wordSpacing != null) 'wordSpacing': widget.wordSpacing, if (widget.height != null) 'height': widget.height, if (widget.fontFamily != null) 'fontFamily': widget.fontFamily, - if (widget.textDirection != null) 'textDirection': widget.textDirection.toString().split('.').last, + if (widget.textDirection != null) + 'textDirection': widget.textDirection.toString().split('.').last, }; } static Map _toJsonTextStyle(TextStyle style) { return { - if (style.color != null) 'color': '#${style.color!.value.toRadixString(16).padLeft(8, '0')}', + if (style.color != null) + 'color': '#${style.color!.value.toRadixString(16).padLeft(8, '0')}', if (style.fontSize != null) 'fontSize': style.fontSize, - if (style.fontWeight != null) 'fontWeight': style.fontWeight.toString().split('.').last, - if (style.decoration != null) 'decoration': style.decoration.toString().split('.').last, + if (style.fontWeight != null) + 'fontWeight': style.fontWeight.toString().split('.').last, + if (style.decoration != null) + 'decoration': style.decoration.toString().split('.').last, if (style.letterSpacing != null) 'letterSpacing': style.letterSpacing, if (style.wordSpacing != null) 'wordSpacing': style.wordSpacing, if (style.height != null) 'height': style.height, if (style.fontFamily != null) 'fontFamily': style.fontFamily, - if (style.fontStyle != null) 'fontStyle': style.fontStyle.toString().split('.').last, + if (style.fontStyle != null) + 'fontStyle': style.fontStyle.toString().split('.').last, }; } @@ -1715,13 +1919,20 @@ class SduiParser { if (widget.height != null) 'height': widget.height, if (widget.fit != null) 'fit': widget.fit.toString().split('.').last, if (widget.alignment != null) 'alignment': widget.alignment.toString(), - if (widget.repeat != null) 'repeat': widget.repeat.toString().split('.').last, - if (widget.color != null) 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', - if (widget.colorBlendMode != null) 'colorBlendMode': widget.colorBlendMode.toString().split('.').last, - if (widget.centerSlice != null) 'centerSlice': widget.centerSlice.toString(), - if (widget.matchTextDirection != null) 'matchTextDirection': widget.matchTextDirection, - if (widget.gaplessPlayback != null) 'gaplessPlayback': widget.gaplessPlayback, - if (widget.filterQuality != null) 'filterQuality': widget.filterQuality.toString().split('.').last, + if (widget.repeat != null) + 'repeat': widget.repeat.toString().split('.').last, + if (widget.color != null) + 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', + if (widget.colorBlendMode != null) + 'colorBlendMode': widget.colorBlendMode.toString().split('.').last, + if (widget.centerSlice != null) + 'centerSlice': widget.centerSlice.toString(), + if (widget.matchTextDirection != null) + 'matchTextDirection': widget.matchTextDirection, + if (widget.gaplessPlayback != null) + 'gaplessPlayback': widget.gaplessPlayback, + if (widget.filterQuality != null) + 'filterQuality': widget.filterQuality.toString().split('.').last, if (widget.cacheWidth != null) 'cacheWidth': widget.cacheWidth, if (widget.cacheHeight != null) 'cacheHeight': widget.cacheHeight, if (widget.scale != null) 'scale': widget.scale, @@ -1744,15 +1955,20 @@ class SduiParser { if (widget.child != null) 'child': toJson(widget.child!), if (widget.padding != null) 'padding': _toJsonEdgeInsets(widget.padding!), if (widget.margin != null) 'margin': _toJsonEdgeInsets(widget.margin!), - if (widget.decoration != null) 'decoration': _toJsonBoxDecoration(widget.decoration!), + if (widget.decoration != null) + 'decoration': _toJsonBoxDecoration(widget.decoration!), if (widget.width != null) 'width': widget.width, if (widget.height != null) 'height': widget.height, - if (widget.color != null) 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', + if (widget.color != null) + 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', if (widget.alignment != null) 'alignment': widget.alignment.toString(), - if (widget.constraints != null) 'constraints': _toJsonBoxConstraints(widget.constraints!), + if (widget.constraints != null) + 'constraints': _toJsonBoxConstraints(widget.constraints!), if (widget.transform != null) 'transform': widget.transform.toString(), - if (widget.transformAlignment != null) 'transformAlignment': widget.transformAlignment.toString(), - if (widget.clipBehavior != null) 'clipBehavior': widget.clipBehavior.toString().split('.').last, + if (widget.transformAlignment != null) + 'transformAlignment': widget.transformAlignment.toString(), + if (widget.clipBehavior != null) + 'clipBehavior': widget.clipBehavior.toString().split('.').last, }; } @@ -1761,21 +1977,35 @@ class SduiParser { 'type': 'scaffold', if (widget.appBar != null) 'appBar': toJson(widget.appBar!), if (widget.body != null) 'body': toJson(widget.body!), - if (widget.floatingActionButton != null) 'floatingActionButton': toJson(widget.floatingActionButton!), - if (widget.bottomNavigationBar != null) 'bottomNavigationBar': toJson(widget.bottomNavigationBar!), + if (widget.floatingActionButton != null) + 'floatingActionButton': toJson(widget.floatingActionButton!), + if (widget.bottomNavigationBar != null) + 'bottomNavigationBar': toJson(widget.bottomNavigationBar!), if (widget.drawer != null) 'drawer': toJson(widget.drawer!), if (widget.endDrawer != null) 'endDrawer': toJson(widget.endDrawer!), - if (widget.bottomSheet != null) 'bottomSheet': toJson(widget.bottomSheet!), - if (widget.backgroundColor != null) 'backgroundColor': '#${widget.backgroundColor!.value.toRadixString(16).padLeft(8, '0')}', - if (widget.resizeToAvoidBottomInset != null) 'resizeToAvoidBottomInset': widget.resizeToAvoidBottomInset, + if (widget.bottomSheet != null) + 'bottomSheet': toJson(widget.bottomSheet!), + if (widget.backgroundColor != null) + 'backgroundColor': + '#${widget.backgroundColor!.value.toRadixString(16).padLeft(8, '0')}', + if (widget.resizeToAvoidBottomInset != null) + 'resizeToAvoidBottomInset': widget.resizeToAvoidBottomInset, if (widget.primary != null) 'primary': widget.primary, - if (widget.floatingActionButtonLocation != null) 'floatingActionButtonLocation': widget.floatingActionButtonLocation.toString().split('.').last, + if (widget.floatingActionButtonLocation != null) + 'floatingActionButtonLocation': + widget.floatingActionButtonLocation.toString().split('.').last, if (widget.extendBody != null) 'extendBody': widget.extendBody, - if (widget.extendBodyBehindAppBar != null) 'extendBodyBehindAppBar': widget.extendBodyBehindAppBar, - if (widget.drawerScrimColor != null) 'drawerScrimColor': '#${widget.drawerScrimColor!.value.toRadixString(16).padLeft(8, '0')}', - if (widget.drawerEdgeDragWidth != null) 'drawerEdgeDragWidth': widget.drawerEdgeDragWidth, - if (widget.drawerEnableOpenDragGesture != null) 'drawerEnableOpenDragGesture': widget.drawerEnableOpenDragGesture, - if (widget.endDrawerEnableOpenDragGesture != null) 'endDrawerEnableOpenDragGesture': widget.endDrawerEnableOpenDragGesture, + if (widget.extendBodyBehindAppBar != null) + 'extendBodyBehindAppBar': widget.extendBodyBehindAppBar, + if (widget.drawerScrimColor != null) + 'drawerScrimColor': + '#${widget.drawerScrimColor!.value.toRadixString(16).padLeft(8, '0')}', + if (widget.drawerEdgeDragWidth != null) + 'drawerEdgeDragWidth': widget.drawerEdgeDragWidth, + if (widget.drawerEnableOpenDragGesture != null) + 'drawerEnableOpenDragGesture': widget.drawerEnableOpenDragGesture, + if (widget.endDrawerEnableOpenDragGesture != null) + 'endDrawerEnableOpenDragGesture': widget.endDrawerEnableOpenDragGesture, }; } @@ -1791,17 +2021,23 @@ class SduiParser { 'type': 'icon', if (widget.icon != null) 'icon': widget.icon!.codePoint, if (widget.size != null) 'size': widget.size, - if (widget.color != null) 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', + if (widget.color != null) + 'color': '#${widget.color!.value.toRadixString(16).padLeft(8, '0')}', if (widget.semanticLabel != null) 'semanticLabel': widget.semanticLabel, - if (widget.textDirection != null) 'textDirection': widget.textDirection.toString().split('.').last, + if (widget.textDirection != null) + 'textDirection': widget.textDirection.toString().split('.').last, if (widget.opacity != null) 'opacity': widget.opacity, - if (widget.applyTextScaling != null) 'applyTextScaling': widget.applyTextScaling, - if (widget.shadows != null) 'shadows': widget.shadows!.map((s) => s.toString()).toList(), + if (widget.applyTextScaling != null) + 'applyTextScaling': widget.applyTextScaling, + if (widget.shadows != null) + 'shadows': widget.shadows!.map((s) => s.toString()).toList(), }; } static Map _toJsonEdgeInsets(EdgeInsets edge) { - if (edge.left == edge.right && edge.left == edge.top && edge.left == edge.bottom) { + if (edge.left == edge.right && + edge.left == edge.top && + edge.left == edge.bottom) { return {'all': edge.left}; } return { @@ -1814,13 +2050,17 @@ class SduiParser { static Map _toJsonBoxDecoration(BoxDecoration decoration) { return { - if (decoration.color != null) 'color': '#${decoration.color!.value.toRadixString(16).padLeft(8, '0')}', - if (decoration.borderRadius != null) 'borderRadius': decoration.borderRadius.toString(), + if (decoration.color != null) + 'color': + '#${decoration.color!.value.toRadixString(16).padLeft(8, '0')}', + if (decoration.borderRadius != null) + 'borderRadius': decoration.borderRadius.toString(), // Add more as needed }; } - static Map _toJsonBoxConstraints(BoxConstraints constraints) { + static Map _toJsonBoxConstraints( + BoxConstraints constraints) { return { 'minWidth': constraints.minWidth, 'maxWidth': constraints.maxWidth, @@ -1829,7 +2069,8 @@ class SduiParser { }; } - static MainAxisAlignmentProto _mainAxisAlignmentToProto(MainAxisAlignment value) { + static MainAxisAlignmentProto _mainAxisAlignmentToProto( + MainAxisAlignment value) { switch (value) { case MainAxisAlignment.start: return MainAxisAlignmentProto.MAIN_AXIS_START; @@ -1843,10 +2084,11 @@ class SduiParser { return MainAxisAlignmentProto.SPACE_AROUND; case MainAxisAlignment.spaceEvenly: return MainAxisAlignmentProto.SPACE_EVENLY; - } + } } - static CrossAxisAlignmentProto _crossAxisAlignmentToProto(CrossAxisAlignment value) { + static CrossAxisAlignmentProto _crossAxisAlignmentToProto( + CrossAxisAlignment value) { switch (value) { case CrossAxisAlignment.start: return CrossAxisAlignmentProto.CROSS_AXIS_START; @@ -1867,7 +2109,7 @@ class SduiParser { return MainAxisSizeProto.MIN; case MainAxisSize.max: return MainAxisSizeProto.MAX; - } + } } static TextDirectionProto _textDirectionToProto(TextDirection value) { @@ -1879,7 +2121,8 @@ class SduiParser { } } - static VerticalDirectionProto _verticalDirectionToProto(VerticalDirection value) { + static VerticalDirectionProto _verticalDirectionToProto( + VerticalDirection value) { switch (value) { case VerticalDirection.up: return VerticalDirectionProto.UP; @@ -1966,10 +2209,12 @@ class SduiParser { final data = SduiWidgetData()..type = WidgetType.COLUMN; data.children.addAll(col.children.map((c) => SduiParser.toProto(c))); if (col.mainAxisAlignment != null) { - data.mainAxisAlignment = _mainAxisAlignmentToProto(col.mainAxisAlignment!); + data.mainAxisAlignment = + _mainAxisAlignmentToProto(col.mainAxisAlignment!); } if (col.crossAxisAlignment != null) { - data.crossAxisAlignment = _crossAxisAlignmentToProto(col.crossAxisAlignment!); + data.crossAxisAlignment = + _crossAxisAlignmentToProto(col.crossAxisAlignment!); } if (col.mainAxisSize != null) { data.mainAxisSize = _mainAxisSizeToProto(col.mainAxisSize!); @@ -1978,7 +2223,8 @@ class SduiParser { data.textDirection = _textDirectionToProto(col.textDirection!); } if (col.verticalDirection != null) { - data.verticalDirection = _verticalDirectionToProto(col.verticalDirection!); + data.verticalDirection = + _verticalDirectionToProto(col.verticalDirection!); } if (col.textBaseline != null) { data.textBaseline = _textBaselineToProto(col.textBaseline!); @@ -1990,7 +2236,8 @@ class SduiParser { return SduiColumn( children: data.children.map((c) => SduiParser.parseProto(c)).toList(), mainAxisAlignment: _parseProtoMainAxisAlignment(data.mainAxisAlignment), - crossAxisAlignment: _parseProtoCrossAxisAlignment(data.crossAxisAlignment), + crossAxisAlignment: + _parseProtoCrossAxisAlignment(data.crossAxisAlignment), mainAxisSize: _parseProtoMainAxisSize(data.mainAxisSize), textDirection: _parseProtoTextDirection(data.textDirection), verticalDirection: _parseProtoVerticalDirection(data.verticalDirection), @@ -2018,7 +2265,8 @@ class SduiParser { } else if (widget is SduiIcon) { return iconToProto(widget); } - throw UnimplementedError('toProto not implemented for ${widget.runtimeType}'); + throw UnimplementedError( + 'toProto not implemented for ${widget.runtimeType}'); } static SduiWidget fromProto(SduiWidgetData data) { @@ -2050,22 +2298,45 @@ class SduiParser { static SduiWidgetData rowToProto(SduiRow row) { final data = SduiWidgetData()..type = WidgetType.ROW; data.children.addAll(row.children.map((c) => SduiParser.toProto(c))); - if (row.mainAxisAlignment != null) data.mainAxisAlignment = _mainAxisAlignmentToProto(row.mainAxisAlignment!); - if (row.crossAxisAlignment != null) data.crossAxisAlignment = _crossAxisAlignmentToProto(row.crossAxisAlignment!); - if (row.mainAxisSize != null) data.mainAxisSize = _mainAxisSizeToProto(row.mainAxisSize!); - if (row.textDirection != null) data.textDirection = _textDirectionToProto(row.textDirection!); - if (row.verticalDirection != null) data.verticalDirection = _verticalDirectionToProto(row.verticalDirection!); - if (row.textBaseline != null) data.textBaseline = _textBaselineToProto(row.textBaseline!); + if (row.mainAxisAlignment != null) { + data.mainAxisAlignment = + _mainAxisAlignmentToProto(row.mainAxisAlignment!); + } + if (row.crossAxisAlignment != null) { + data.crossAxisAlignment = + _crossAxisAlignmentToProto(row.crossAxisAlignment!); + } + if (row.mainAxisSize != null) { + data.mainAxisSize = _mainAxisSizeToProto(row.mainAxisSize!); + } + if (row.textDirection != null) { + data.textDirection = _textDirectionToProto(row.textDirection!); + } + if (row.verticalDirection != null) { + data.verticalDirection = + _verticalDirectionToProto(row.verticalDirection!); + } + if (row.textBaseline != null) { + data.textBaseline = _textBaselineToProto(row.textBaseline!); + } return data; } static SduiRow rowFromProto(SduiWidgetData data) { - List children = data.children.map((c) => SduiParser.parseProto(c)).toList(); - MainAxisAlignment mainAxisAlignment = _parseProtoMainAxisAlignment(data.mainAxisAlignment) ?? MainAxisAlignment.start; - CrossAxisAlignment crossAxisAlignment = _parseProtoCrossAxisAlignment(data.crossAxisAlignment) ?? CrossAxisAlignment.center; - MainAxisSize mainAxisSize = _parseProtoMainAxisSize(data.mainAxisSize) ?? MainAxisSize.max; + List children = + data.children.map((c) => SduiParser.parseProto(c)).toList(); + MainAxisAlignment mainAxisAlignment = + _parseProtoMainAxisAlignment(data.mainAxisAlignment) ?? + MainAxisAlignment.start; + CrossAxisAlignment crossAxisAlignment = + _parseProtoCrossAxisAlignment(data.crossAxisAlignment) ?? + CrossAxisAlignment.center; + MainAxisSize mainAxisSize = + _parseProtoMainAxisSize(data.mainAxisSize) ?? MainAxisSize.max; TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); - VerticalDirection verticalDirection = _parseProtoVerticalDirection(data.verticalDirection) ?? VerticalDirection.down; + VerticalDirection verticalDirection = + _parseProtoVerticalDirection(data.verticalDirection) ?? + VerticalDirection.down; TextBaseline? textBaseline = _parseProtoTextBaseline(data.textBaseline); return SduiRow( children: children, @@ -2083,26 +2354,37 @@ class SduiParser { final data = SduiWidgetData()..type = WidgetType.TEXT; data.stringAttributes['text'] = text.text; if (text.style != null) data.textStyle = _textStyleToProto(text.style!); - if (text.textAlign != null) data.textAlign = _textAlignToProto(text.textAlign!); - if (text.overflow != null) data.overflow = _textOverflowToProto(text.overflow!); + if (text.textAlign != null) { + data.textAlign = _textAlignToProto(text.textAlign!); + } + if (text.overflow != null) { + data.overflow = _textOverflowToProto(text.overflow!); + } if (text.maxLines != null) data.maxLines = text.maxLines!; if (text.softWrap != null) data.softWrap = text.softWrap!; if (text.letterSpacing != null) data.letterSpacing = text.letterSpacing!; if (text.wordSpacing != null) data.wordSpacing = text.wordSpacing!; if (text.height != null) data.height = text.height!; if (text.fontFamily != null) data.fontFamily = text.fontFamily!; - if (text.textDirection != null) data.textDirection = _textDirectionToProto(text.textDirection!); + if (text.textDirection != null) { + data.textDirection = _textDirectionToProto(text.textDirection!); + } // Individual style overrides - if (text.decoration != null) data.textStyle.decoration = _textDecorationToProto(text.decoration!); + if (text.decoration != null) { + data.textStyle.decoration = _textDecorationToProto(text.decoration!); + } if (text.fontSize != null) data.textStyle.fontSize = text.fontSize!; - if (text.fontWeight != null) data.textStyle.fontWeight = text.fontWeight.toString().split('.').last; + if (text.fontWeight != null) { + data.textStyle.fontWeight = text.fontWeight.toString().split('.').last; + } if (text.color != null) data.textStyle.color = _colorToProto(text.color!); return data; } static SduiText textFromProto(SduiWidgetData data) { String text = data.stringAttributes['text'] ?? ''; - TextStyle? style = data.hasTextStyle() ? _parseProtoTextStyle(data.textStyle) : null; + TextStyle? style = + data.hasTextStyle() ? _parseProtoTextStyle(data.textStyle) : null; TextAlign? textAlign = _parseProtoTextAlign(data.textAlign); TextOverflow? overflow = _parseProtoTextOverflow(data.overflow); int? maxLines = data.hasMaxLines() ? data.maxLines : null; @@ -2113,10 +2395,20 @@ class SduiParser { String? fontFamily = data.hasFontFamily() ? data.fontFamily : null; TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); // Individual style overrides - TextDecoration? decoration = data.hasTextStyle() && data.textStyle.hasDecoration() ? _parseProtoTextDecoration(data.textStyle.decoration) : null; - double? fontSize = data.hasTextStyle() && data.textStyle.hasFontSize() ? data.textStyle.fontSize : null; - FontWeight? fontWeight = data.hasTextStyle() && data.textStyle.fontWeight.isNotEmpty ? _parseProtoFontWeight(data.textStyle.fontWeight) : null; - Color? color = data.hasTextStyle() && data.textStyle.hasColor() ? _parseProtoColor(data.textStyle.color) : null; + TextDecoration? decoration = + data.hasTextStyle() && data.textStyle.hasDecoration() + ? _parseProtoTextDecoration(data.textStyle.decoration) + : null; + double? fontSize = data.hasTextStyle() && data.textStyle.hasFontSize() + ? data.textStyle.fontSize + : null; + FontWeight? fontWeight = + data.hasTextStyle() && data.textStyle.fontWeight.isNotEmpty + ? _parseProtoFontWeight(data.textStyle.fontWeight) + : null; + Color? color = data.hasTextStyle() && data.textStyle.hasColor() + ? _parseProtoColor(data.textStyle.color) + : null; return SduiText( text, style: style, @@ -2142,15 +2434,29 @@ class SduiParser { data.stringAttributes['src'] = image.src; if (image.width != null) data.doubleAttributes['width'] = image.width!; if (image.height != null) data.doubleAttributes['height'] = image.height!; - if (image.fit != null) data.stringAttributes['fit'] = image.fit.toString().split('.').last; - if (image.alignment != null) data.alignment = _alignmentToProto(image.alignment!); + if (image.fit != null) { + data.stringAttributes['fit'] = image.fit.toString().split('.').last; + } + if (image.alignment != null) { + data.alignment = _alignmentToProto(image.alignment!); + } if (image.repeat != null) data.repeat = _imageRepeatToProto(image.repeat!); if (image.color != null) data.color = _colorToProto(image.color!); - if (image.colorBlendMode != null) data.colorBlendMode = _blendModeToProto(image.colorBlendMode!); - if (image.centerSlice != null) data.centerSlice = _rectToProto(image.centerSlice!); - if (image.matchTextDirection != null) data.matchTextDirection = image.matchTextDirection!; - if (image.gaplessPlayback != null) data.gaplessPlayback = image.gaplessPlayback!; - if (image.filterQuality != null) data.filterQuality = _filterQualityToProto(image.filterQuality!); + if (image.colorBlendMode != null) { + data.colorBlendMode = _blendModeToProto(image.colorBlendMode!); + } + if (image.centerSlice != null) { + data.centerSlice = _rectToProto(image.centerSlice!); + } + if (image.matchTextDirection != null) { + data.matchTextDirection = image.matchTextDirection!; + } + if (image.gaplessPlayback != null) { + data.gaplessPlayback = image.gaplessPlayback!; + } + if (image.filterQuality != null) { + data.filterQuality = _filterQualityToProto(image.filterQuality!); + } if (image.cacheWidth != null) data.cacheWidth = image.cacheWidth!; if (image.cacheHeight != null) data.cacheHeight = image.cacheHeight!; if (image.scale != null) data.scale = image.scale!; @@ -2164,14 +2470,20 @@ class SduiParser { double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; BoxFit? fit = _parseProtoBoxFit(data.stringAttributes['fit']); - Alignment alignment = _parseProtoAlignment(data.alignment) ?? Alignment.center; - ImageRepeat repeat = _parseProtoImageRepeat(data.repeat) ?? ImageRepeat.noRepeat; + Alignment alignment = + _parseProtoAlignment(data.alignment) ?? Alignment.center; + ImageRepeat repeat = + _parseProtoImageRepeat(data.repeat) ?? ImageRepeat.noRepeat; Color? color = data.hasColor() ? _parseProtoColor(data.color) : null; BlendMode? colorBlendMode = _parseProtoBlendMode(data.colorBlendMode); - Rect? centerSlice = data.hasCenterSlice() ? _parseProtoRect(data.centerSlice) : null; - bool matchTextDirection = data.hasMatchTextDirection() ? data.matchTextDirection : false; - bool gaplessPlayback = data.hasGaplessPlayback() ? data.gaplessPlayback : false; - FilterQuality filterQuality = _parseProtoFilterQuality(data.filterQuality) ?? FilterQuality.low; + Rect? centerSlice = + data.hasCenterSlice() ? _parseProtoRect(data.centerSlice) : null; + bool matchTextDirection = + data.hasMatchTextDirection() ? data.matchTextDirection : false; + bool gaplessPlayback = + data.hasGaplessPlayback() ? data.gaplessPlayback : false; + FilterQuality filterQuality = + _parseProtoFilterQuality(data.filterQuality) ?? FilterQuality.low; int? cacheWidth = data.hasCacheWidth() ? data.cacheWidth : null; int? cacheHeight = data.hasCacheHeight() ? data.cacheHeight : null; double scale = data.hasScale() ? data.scale : 1.0; @@ -2307,7 +2619,8 @@ class SduiParser { static SduiSizedBox sizedBoxFromProto(SduiWidgetData data) { double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; - SduiWidget? child = data.hasChild() ? SduiParser.parseProto(data.child) : null; + SduiWidget? child = + data.hasChild() ? SduiParser.parseProto(data.child) : null; return SduiSizedBox(width: width, height: height, child: child); } @@ -2317,33 +2630,57 @@ class SduiParser { if (c.child != null) data.child = toProto(c.child!); if (c.padding != null) data.padding = _edgeInsetsToProto(c.padding!); if (c.margin != null) data.margin = _edgeInsetsToProto(c.margin!); - if (c.decoration != null) data.boxDecoration = _boxDecorationToProto(c.decoration!); + if (c.decoration != null) { + data.boxDecoration = _boxDecorationToProto(c.decoration!); + } if (c.width != null) data.doubleAttributes['width'] = c.width!; if (c.height != null) data.doubleAttributes['height'] = c.height!; // Only set color if decoration is null - if (c.decoration == null && c.color != null) data.color = _colorToProto(c.color!); + if (c.decoration == null && c.color != null) { + data.color = _colorToProto(c.color!); + } if (c.alignment != null) data.alignment = _alignmentToProto(c.alignment!); - if (c.constraints != null) data.constraints = _boxConstraintsToProto(c.constraints!); + if (c.constraints != null) { + data.constraints = _boxConstraintsToProto(c.constraints!); + } if (c.transform != null) data.transform = _matrix4ToProto(c.transform!); - if (c.transformAlignment != null) data.transformAlignment = _alignmentGeometryToProto(c.transformAlignment!); - if (c.clipBehavior != null && c.clipBehavior != Clip.none) data.clipBehavior = _clipToProto(c.clipBehavior!); + if (c.transformAlignment != null) { + data.transformAlignment = + _alignmentGeometryToProto(c.transformAlignment!); + } + if (c.clipBehavior != null && c.clipBehavior != Clip.none) { + data.clipBehavior = _clipToProto(c.clipBehavior!); + } return data; } static SduiContainer containerFromProto(SduiWidgetData data) { - SduiWidget? child = data.hasChild() ? SduiParser.parseProto(data.child) : null; - EdgeInsets? padding = data.hasPadding() ? _parseProtoEdgeInsets(data.padding) : null; - EdgeInsets? margin = data.hasMargin() ? _parseProtoEdgeInsets(data.margin) : null; - BoxDecoration? decoration = data.hasBoxDecoration() ? _parseProtoBoxDecoration(data.boxDecoration) : null; + SduiWidget? child = + data.hasChild() ? SduiParser.parseProto(data.child) : null; + EdgeInsets? padding = + data.hasPadding() ? _parseProtoEdgeInsets(data.padding) : null; + EdgeInsets? margin = + data.hasMargin() ? _parseProtoEdgeInsets(data.margin) : null; + BoxDecoration? decoration = data.hasBoxDecoration() + ? _parseProtoBoxDecoration(data.boxDecoration) + : null; double? width = data.doubleAttributes['width']; double? height = data.doubleAttributes['height']; // Only use color if decoration is null - Color? color = (decoration == null && data.hasColor()) ? _parseProtoColor(data.color) : null; + Color? color = (decoration == null && data.hasColor()) + ? _parseProtoColor(data.color) + : null; Alignment? alignment = _parseProtoAlignment(data.alignment); - BoxConstraints? constraints = data.hasConstraints() ? _parseProtoBoxConstraints(data.constraints) : null; - Matrix4? transform = data.hasTransform() ? _parseProtoTransform(data.transform) : null; - AlignmentGeometry? transformAlignment = data.hasTransformAlignment() ? _parseProtoAlignmentGeometry(data.transformAlignment) : null; - Clip? clipBehavior = data.hasClipBehavior() ? _parseProtoClip(data.clipBehavior) : Clip.none; + BoxConstraints? constraints = data.hasConstraints() + ? _parseProtoBoxConstraints(data.constraints) + : null; + Matrix4? transform = + data.hasTransform() ? _parseProtoTransform(data.transform) : null; + AlignmentGeometry? transformAlignment = data.hasTransformAlignment() + ? _parseProtoAlignmentGeometry(data.transformAlignment) + : null; + Clip? clipBehavior = + data.hasClipBehavior() ? _parseProtoClip(data.clipBehavior) : Clip.none; return SduiContainer( child: child, padding: padding, @@ -2362,7 +2699,9 @@ class SduiParser { static EdgeInsetsData _edgeInsetsToProto(EdgeInsets edge) { final data = EdgeInsetsData(); - if (edge.left == edge.right && edge.left == edge.top && edge.left == edge.bottom) { + if (edge.left == edge.right && + edge.left == edge.top && + edge.left == edge.bottom) { data.all = edge.left; } else { data.left = edge.left; @@ -2376,8 +2715,10 @@ class SduiParser { static BoxDecorationData _boxDecorationToProto(BoxDecoration decoration) { final data = BoxDecorationData(); if (decoration.color != null) data.color = _colorToProto(decoration.color!); - if (decoration.borderRadius != null && decoration.borderRadius is BorderRadius) { - data.borderRadius = _borderRadiusToProto(decoration.borderRadius as BorderRadius); + if (decoration.borderRadius != null && + decoration.borderRadius is BorderRadius) { + data.borderRadius = + _borderRadiusToProto(decoration.borderRadius as BorderRadius); } // Add more as needed return data; @@ -2427,7 +2768,8 @@ class SduiParser { return _alignmentToProto(alignment); } // Fallback: center - return AlignmentData()..predefined = AlignmentData_PredefinedAlignment.CENTER_ALIGN; + return AlignmentData() + ..predefined = AlignmentData_PredefinedAlignment.CENTER_ALIGN; } static ClipProto _clipToProto(Clip clip) { @@ -2448,42 +2790,87 @@ class SduiParser { final data = SduiWidgetData()..type = WidgetType.SCAFFOLD; if (s.appBar != null) data.appBar = toProto(s.appBar!); if (s.body != null) data.body = toProto(s.body!); - if (s.floatingActionButton != null) data.floatingActionButton = toProto(s.floatingActionButton!); - if (s.bottomNavigationBar != null) data.bottomNavigationBar = toProto(s.bottomNavigationBar!); + if (s.floatingActionButton != null) { + data.floatingActionButton = toProto(s.floatingActionButton!); + } + if (s.bottomNavigationBar != null) { + data.bottomNavigationBar = toProto(s.bottomNavigationBar!); + } if (s.drawer != null) data.drawer = toProto(s.drawer!); if (s.endDrawer != null) data.endDrawer = toProto(s.endDrawer!); if (s.bottomSheet != null) data.bottomSheet = toProto(s.bottomSheet!); - if (s.backgroundColor != null) data.backgroundColor = _colorToProto(s.backgroundColor!); - if (s.resizeToAvoidBottomInset != null) data.resizeToAvoidBottomInset = s.resizeToAvoidBottomInset!; + if (s.backgroundColor != null) { + data.backgroundColor = _colorToProto(s.backgroundColor!); + } + if (s.resizeToAvoidBottomInset != null) { + data.resizeToAvoidBottomInset = s.resizeToAvoidBottomInset!; + } if (s.primary != null) data.primary = s.primary!; - if (s.floatingActionButtonLocation != null) data.floatingActionButtonLocation = _fabLocationToProto(s.floatingActionButtonLocation!); + if (s.floatingActionButtonLocation != null) { + data.floatingActionButtonLocation = + _fabLocationToProto(s.floatingActionButtonLocation!); + } if (s.extendBody != null) data.extendBody = s.extendBody!; - if (s.extendBodyBehindAppBar != null) data.extendBodyBehindAppBar = s.extendBodyBehindAppBar!; - if (s.drawerScrimColor != null) data.drawerScrimColor = _colorToProto(s.drawerScrimColor!); - if (s.drawerEdgeDragWidth != null) data.drawerEdgeDragWidth = s.drawerEdgeDragWidth!; - if (s.drawerEnableOpenDragGesture != null) data.drawerEnableOpenDragGesture = s.drawerEnableOpenDragGesture!; - if (s.endDrawerEnableOpenDragGesture != null) data.endDrawerEnableOpenDragGesture = s.endDrawerEnableOpenDragGesture!; + if (s.extendBodyBehindAppBar != null) { + data.extendBodyBehindAppBar = s.extendBodyBehindAppBar!; + } + if (s.drawerScrimColor != null) { + data.drawerScrimColor = _colorToProto(s.drawerScrimColor!); + } + if (s.drawerEdgeDragWidth != null) { + data.drawerEdgeDragWidth = s.drawerEdgeDragWidth!; + } + if (s.drawerEnableOpenDragGesture != null) { + data.drawerEnableOpenDragGesture = s.drawerEnableOpenDragGesture!; + } + if (s.endDrawerEnableOpenDragGesture != null) { + data.endDrawerEnableOpenDragGesture = s.endDrawerEnableOpenDragGesture!; + } return data; } static SduiScaffold scaffoldFromProto(SduiWidgetData data) { - SduiWidget? appBar = data.hasAppBar() ? SduiParser.parseProto(data.appBar) : null; + SduiWidget? appBar = + data.hasAppBar() ? SduiParser.parseProto(data.appBar) : null; SduiWidget? body = data.hasBody() ? SduiParser.parseProto(data.body) : null; - SduiWidget? floatingActionButton = data.hasFloatingActionButton() ? SduiParser.parseProto(data.floatingActionButton) : null; - SduiWidget? bottomNavigationBar = data.hasBottomNavigationBar() ? SduiParser.parseProto(data.bottomNavigationBar) : null; - SduiWidget? drawer = data.hasDrawer() ? SduiParser.parseProto(data.drawer) : null; - SduiWidget? endDrawer = data.hasEndDrawer() ? SduiParser.parseProto(data.endDrawer) : null; - SduiWidget? bottomSheet = data.hasBottomSheet() ? SduiParser.parseProto(data.bottomSheet) : null; - Color? backgroundColor = data.hasBackgroundColor() ? _parseProtoColor(data.backgroundColor) : null; - bool? resizeToAvoidBottomInset = data.hasResizeToAvoidBottomInset() ? data.resizeToAvoidBottomInset : null; + SduiWidget? floatingActionButton = data.hasFloatingActionButton() + ? SduiParser.parseProto(data.floatingActionButton) + : null; + SduiWidget? bottomNavigationBar = data.hasBottomNavigationBar() + ? SduiParser.parseProto(data.bottomNavigationBar) + : null; + SduiWidget? drawer = + data.hasDrawer() ? SduiParser.parseProto(data.drawer) : null; + SduiWidget? endDrawer = + data.hasEndDrawer() ? SduiParser.parseProto(data.endDrawer) : null; + SduiWidget? bottomSheet = + data.hasBottomSheet() ? SduiParser.parseProto(data.bottomSheet) : null; + Color? backgroundColor = data.hasBackgroundColor() + ? _parseProtoColor(data.backgroundColor) + : null; + bool? resizeToAvoidBottomInset = data.hasResizeToAvoidBottomInset() + ? data.resizeToAvoidBottomInset + : null; bool primary = data.hasPrimary() ? data.primary : true; - FloatingActionButtonLocation? floatingActionButtonLocation = data.hasFloatingActionButtonLocation() ? _parseProtoFabLocation(data.floatingActionButtonLocation) : null; + FloatingActionButtonLocation? floatingActionButtonLocation = + data.hasFloatingActionButtonLocation() + ? _parseProtoFabLocation(data.floatingActionButtonLocation) + : null; bool extendBody = data.hasExtendBody() ? data.extendBody : false; - bool extendBodyBehindAppBar = data.hasExtendBodyBehindAppBar() ? data.extendBodyBehindAppBar : false; - Color? drawerScrimColor = data.hasDrawerScrimColor() ? _parseProtoColor(data.drawerScrimColor) : null; - double? drawerEdgeDragWidth = data.hasDrawerEdgeDragWidth() ? data.drawerEdgeDragWidth : null; - bool drawerEnableOpenDragGesture = data.hasDrawerEnableOpenDragGesture() ? data.drawerEnableOpenDragGesture : true; - bool endDrawerEnableOpenDragGesture = data.hasEndDrawerEnableOpenDragGesture() ? data.endDrawerEnableOpenDragGesture : true; + bool extendBodyBehindAppBar = + data.hasExtendBodyBehindAppBar() ? data.extendBodyBehindAppBar : false; + Color? drawerScrimColor = data.hasDrawerScrimColor() + ? _parseProtoColor(data.drawerScrimColor) + : null; + double? drawerEdgeDragWidth = + data.hasDrawerEdgeDragWidth() ? data.drawerEdgeDragWidth : null; + bool drawerEnableOpenDragGesture = data.hasDrawerEnableOpenDragGesture() + ? data.drawerEnableOpenDragGesture + : true; + bool endDrawerEnableOpenDragGesture = + data.hasEndDrawerEnableOpenDragGesture() + ? data.endDrawerEnableOpenDragGesture + : true; return SduiScaffold( appBar: appBar, body: body, @@ -2505,20 +2892,45 @@ class SduiParser { ); } - static FloatingActionButtonLocationProto _fabLocationToProto(FloatingActionButtonLocation loc) { + static FloatingActionButtonLocationProto _fabLocationToProto( + FloatingActionButtonLocation loc) { // Use the same mapping as _parseProtoFabLocation, but reversed - if (loc == FloatingActionButtonLocation.startTop) return FloatingActionButtonLocationProto.FAB_START_TOP; - if (loc == FloatingActionButtonLocation.startFloat) return FloatingActionButtonLocationProto.FAB_START_FLOAT; - if (loc == FloatingActionButtonLocation.centerTop) return FloatingActionButtonLocationProto.FAB_CENTER_TOP; - if (loc == FloatingActionButtonLocation.centerFloat) return FloatingActionButtonLocationProto.FAB_CENTER_FLOAT; - if (loc == FloatingActionButtonLocation.endTop) return FloatingActionButtonLocationProto.FAB_END_TOP; - if (loc == FloatingActionButtonLocation.endFloat) return FloatingActionButtonLocationProto.FAB_END_FLOAT; - if (loc == FloatingActionButtonLocation.miniCenterTop) return FloatingActionButtonLocationProto.FAB_MINI_CENTER_TOP; - if (loc == FloatingActionButtonLocation.miniCenterFloat) return FloatingActionButtonLocationProto.FAB_MINI_CENTER_FLOAT; - if (loc == FloatingActionButtonLocation.miniStartTop) return FloatingActionButtonLocationProto.FAB_MINI_START_TOP; - if (loc == FloatingActionButtonLocation.miniStartFloat) return FloatingActionButtonLocationProto.FAB_MINI_START_FLOAT; - if (loc == FloatingActionButtonLocation.miniEndTop) return FloatingActionButtonLocationProto.FAB_MINI_END_TOP; - if (loc == FloatingActionButtonLocation.miniEndFloat) return FloatingActionButtonLocationProto.FAB_MINI_END_FLOAT; + if (loc == FloatingActionButtonLocation.startTop) { + return FloatingActionButtonLocationProto.FAB_START_TOP; + } + if (loc == FloatingActionButtonLocation.startFloat) { + return FloatingActionButtonLocationProto.FAB_START_FLOAT; + } + if (loc == FloatingActionButtonLocation.centerTop) { + return FloatingActionButtonLocationProto.FAB_CENTER_TOP; + } + if (loc == FloatingActionButtonLocation.centerFloat) { + return FloatingActionButtonLocationProto.FAB_CENTER_FLOAT; + } + if (loc == FloatingActionButtonLocation.endTop) { + return FloatingActionButtonLocationProto.FAB_END_TOP; + } + if (loc == FloatingActionButtonLocation.endFloat) { + return FloatingActionButtonLocationProto.FAB_END_FLOAT; + } + if (loc == FloatingActionButtonLocation.miniCenterTop) { + return FloatingActionButtonLocationProto.FAB_MINI_CENTER_TOP; + } + if (loc == FloatingActionButtonLocation.miniCenterFloat) { + return FloatingActionButtonLocationProto.FAB_MINI_CENTER_FLOAT; + } + if (loc == FloatingActionButtonLocation.miniStartTop) { + return FloatingActionButtonLocationProto.FAB_MINI_START_TOP; + } + if (loc == FloatingActionButtonLocation.miniStartFloat) { + return FloatingActionButtonLocationProto.FAB_MINI_START_FLOAT; + } + if (loc == FloatingActionButtonLocation.miniEndTop) { + return FloatingActionButtonLocationProto.FAB_MINI_END_TOP; + } + if (loc == FloatingActionButtonLocation.miniEndFloat) { + return FloatingActionButtonLocationProto.FAB_MINI_END_FLOAT; + } return FloatingActionButtonLocationProto.FAB_CENTER_FLOAT; } @@ -2545,22 +2957,32 @@ class SduiParser { if (icon.size != null) data.icon.size = icon.size!; if (icon.color != null) data.icon.color = _colorToProto(icon.color!); if (icon.semanticLabel != null) data.semanticLabel = icon.semanticLabel!; - if (icon.textDirection != null) data.textDirection = _textDirectionToProto(icon.textDirection!); + if (icon.textDirection != null) { + data.textDirection = _textDirectionToProto(icon.textDirection!); + } if (icon.opacity != null) data.opacity = icon.opacity!; - if (icon.applyTextScaling != null) data.applyTextScaling = icon.applyTextScaling!; - if (icon.shadows != null) data.shadows.addAll(icon.shadows!.map(_shadowToProto)); + if (icon.applyTextScaling != null) { + data.applyTextScaling = icon.applyTextScaling!; + } + if (icon.shadows != null) { + data.shadows.addAll(icon.shadows!.map(_shadowToProto)); + } return data; } static SduiIcon iconFromProto(SduiWidgetData data) { IconData? iconData = data.hasIcon() ? _parseProtoIconData(data.icon) : null; double? size = data.icon.size; - Color? color = data.icon.hasColor() ? _parseProtoColor(data.icon.color) : null; + Color? color = + data.icon.hasColor() ? _parseProtoColor(data.icon.color) : null; String? semanticLabel = data.hasSemanticLabel() ? data.semanticLabel : null; TextDirection? textDirection = _parseProtoTextDirection(data.textDirection); double? opacity = data.hasOpacity() ? data.opacity : null; - bool? applyTextScaling = data.hasApplyTextScaling() ? data.applyTextScaling : null; - List? shadows = data.shadows.isNotEmpty ? data.shadows.map((s) => _parseProtoShadow(s)).toList() : null; + bool? applyTextScaling = + data.hasApplyTextScaling() ? data.applyTextScaling : null; + List? shadows = data.shadows.isNotEmpty + ? data.shadows.map((s) => _parseProtoShadow(s)).toList() + : null; return SduiIcon( icon: iconData, size: size, @@ -2586,13 +3008,19 @@ class SduiParser { final data = TextStyleData(); if (style.color != null) data.color = _colorToProto(style.color!); if (style.fontSize != null) data.fontSize = style.fontSize!; - if (style.fontWeight != null) data.fontWeight = style.fontWeight.toString().split('.').last; - if (style.decoration != null) data.decoration = _textDecorationToProto(style.decoration!); + if (style.fontWeight != null) { + data.fontWeight = style.fontWeight.toString().split('.').last; + } + if (style.decoration != null) { + data.decoration = _textDecorationToProto(style.decoration!); + } if (style.letterSpacing != null) data.letterSpacing = style.letterSpacing!; if (style.wordSpacing != null) data.wordSpacing = style.wordSpacing!; if (style.height != null) data.height = style.height!; if (style.fontFamily != null) data.fontFamily = style.fontFamily!; - if (style.fontStyle != null) data.fontStyle = _fontStyleToProto(style.fontStyle!); + if (style.fontStyle != null) { + data.fontStyle = _fontStyleToProto(style.fontStyle!); + } return data; } @@ -2610,7 +3038,6 @@ class SduiParser { return TextAlignProto.TEXT_ALIGN_START; case TextAlign.end: return TextAlignProto.TEXT_ALIGN_END; - } } @@ -2624,7 +3051,6 @@ class SduiParser { return TextOverflowProto.FADE; case TextOverflow.visible: return TextOverflowProto.VISIBLE; - } } @@ -2637,10 +3063,18 @@ class SduiParser { } static TextDecorationProto _textDecorationToProto(TextDecoration decoration) { - if (decoration == TextDecoration.none) return TextDecorationProto.TEXT_DECORATION_NONE; - if (decoration == TextDecoration.underline) return TextDecorationProto.UNDERLINE; - if (decoration == TextDecoration.overline) return TextDecorationProto.OVERLINE; - if (decoration == TextDecoration.lineThrough) return TextDecorationProto.LINE_THROUGH; + if (decoration == TextDecoration.none) { + return TextDecorationProto.TEXT_DECORATION_NONE; + } + if (decoration == TextDecoration.underline) { + return TextDecorationProto.UNDERLINE; + } + if (decoration == TextDecoration.overline) { + return TextDecorationProto.OVERLINE; + } + if (decoration == TextDecoration.lineThrough) { + return TextDecorationProto.LINE_THROUGH; + } return TextDecorationProto.TEXT_DECORATION_NONE; } diff --git a/lib/src/widgets/sdui_icon.dart b/lib/src/widgets/sdui_icon.dart index fb67e0d..2a4023a 100644 --- a/lib/src/widgets/sdui_icon.dart +++ b/lib/src/widgets/sdui_icon.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; @@ -52,7 +54,7 @@ class SduiIcon extends SduiWidget { String? get iconName { if (icon == null) return null; - + const codePointToName = { 0xe8b8: 'settings', 0xe88a: 'home', @@ -62,7 +64,7 @@ class SduiIcon extends SduiWidget { 0xe88e: 'info', 0xe318: 'home', }; - print(codePointToName); + log(codePointToName.toString()); return codePointToName[icon!.codePoint]; } diff --git a/lib/src/widgets/sdui_image.dart b/lib/src/widgets/sdui_image.dart index a3383d9..3b1e66c 100644 --- a/lib/src/widgets/sdui_image.dart +++ b/lib/src/widgets/sdui_image.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/widgets.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; @@ -123,7 +125,7 @@ class SduiImage extends SduiWidget { ); } else { // Return empty widget for non-network URLs with warning - print( + log( "Warning: SduiImage currently only supports network images. Provided src: $src"); return const SizedBox.shrink(); } diff --git a/lib/src/widgets/sdui_scaffold.dart b/lib/src/widgets/sdui_scaffold.dart index d318564..79e5128 100644 --- a/lib/src/widgets/sdui_scaffold.dart +++ b/lib/src/widgets/sdui_scaffold.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:flutter_sdui/src/widgets/sdui_widget.dart'; @@ -96,7 +98,7 @@ class SduiScaffold extends SduiWidget { if (potentialAppBar is PreferredSizeWidget) { flutterAppBar = potentialAppBar; } else { - print( + log( "Warning: appBar widget for SduiScaffold is not a PreferredSizeWidget. It might not render correctly."); } } From 5566dddcd6f467e786f87e4dece2764ee33ff841 Mon Sep 17 00:00:00 2001 From: JothishKamal Date: Tue, 30 Sep 2025 18:02:58 +0530 Subject: [PATCH 12/12] Update LICENSE --- LICENSE | 237 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 118 insertions(+), 119 deletions(-) diff --git a/LICENSE b/LICENSE index 0d72230..514c0e3 100644 --- a/LICENSE +++ b/LICENSE @@ -20,61 +20,60 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - The "Corresponding Source" for a work in object code form means all +The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's +control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source +which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - The Corresponding Source need not include anything that users +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - The Corresponding Source for a work in source code form is that +The Corresponding Source for a work in source code form is that same work. - 2. Basic Permissions. +2. Basic Permissions. - All rights granted under this License are granted for the term of +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your +content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - You may make, run and propagate covered works that you do not +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose +in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works +not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. +3. Protecting Users' Legal Rights From Anti-Circumvention Law. - No covered work shall be deemed part of an effective technological +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - When you convey a covered work, you waive any legal power to forbid +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or @@ -82,9 +81,9 @@ modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - 4. Conveying Verbatim Copies. +4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program's source code as you +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -92,12 +91,12 @@ non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - You may charge any price or no price for each copy that you convey, +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - 5. Conveying Modified Source Versions. +5. Conveying Modified Source Versions. - You may convey a work based on the Program, or the modifications to +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: @@ -122,19 +121,19 @@ terms of section 4, provided that you also meet all of these conditions: interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - A compilation of a covered work with other separate and independent +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work +beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - 6. Conveying Non-Source Forms. +6. Conveying Non-Source Forms. - You may convey a covered work in object code form under the terms +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: @@ -180,75 +179,75 @@ in one of these ways: Source of the work are being offered to the general public at no charge under subsection 6d. - A separable portion of the object code, whose source code is excluded +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A "User Product" is either (1) a "consumer product", which means any +A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product +actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - "Installation Information" for a User Product means any methods, +"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must +a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - If you convey an object code work under this section in, or with, or +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply +by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - The requirement to provide Installation Information does not include a +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a +the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - Corresponding Source conveyed, and Installation Information provided, +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - 7. Additional Terms. +7. Additional Terms. - "Additional permissions" are terms that supplement the terms of this +"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions +that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - When you convey a copy of a covered work, you may at your option +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - Notwithstanding any other provision of this License, for material you +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: @@ -275,74 +274,74 @@ that material) supplement the terms of this License with terms: any liability that these contractual assumptions directly impose on those licensors and authors. - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains +restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - If you add terms to a covered work in accord with this section, you +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - Additional terms, permissive or non-permissive, may be stated in the +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - 8. Termination. +8. Termination. - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - However, if you cease all violation of this License, then your +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - Moreover, your license from a particular copyright holder is +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - Termination of your rights under this section does not terminate the +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently +this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - 9. Acceptance Not Required for Having Copies. +9. Acceptance Not Required for Having Copies. - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, +to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - 10. Automatic Licensing of Downstream Recipients. +10. Automatic Licensing of Downstream Recipients. - Each time you convey a covered work, the recipient automatically +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible +propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - An "entity transaction" is a transaction transferring control of an +An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered +organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could @@ -350,43 +349,43 @@ give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - 11. Patents. +11. Patents. - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - A contributor's "essential patent claims" are all patent claims +A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For +consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - Each contributor grants you a non-exclusive, worldwide, royalty-free +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a "patent license" is any express +In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a +sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - If you convey a covered work, knowingly relying on a patent license, +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, @@ -394,13 +393,13 @@ then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have +license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - If, pursuant to or in connection with a single transaction or +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify @@ -408,10 +407,10 @@ or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is "discriminatory" if it does not include within +A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered +specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying @@ -423,73 +422,73 @@ for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - Nothing in this License shall be construed as excluding or limiting +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others' Freedom. +12. No Surrender of Others' Freedom. - If conditions are imposed on you (whether by court order, agreement or +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a +excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you +not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. +13. Use with the GNU Affero General Public License. - Notwithstanding any other provision of this License, you have +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this +combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. - 14. Revised Versions of this License. +14. Revised Versions of this License. - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - Each version is given a distinguishing version number. If the +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the +Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. - If the Program specifies that a proxy can decide which future +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - 15. Disclaimer of Warranty. +15. Disclaimer of Warranty. - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 16. Limitation of Liability. +16. Limitation of Liability. - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -499,9 +498,9 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - 17. Interpretation of Sections 15 and 16. +17. Interpretation of Sections 15 and 16. - If the disclaimer of warranty and limitation of liability provided +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the @@ -512,11 +511,11 @@ copy of the Program in return for a fee. How to Apply These Terms to Your New Programs - If you develop a new program, and you want it to be of the greatest +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. @@ -539,7 +538,7 @@ the "copyright" line and a pointer to where the full notice is found. Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) @@ -548,17 +547,17 @@ notice like this when it starts in an interactive mode: under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands +parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". - You should also get your employer (if you work as a programmer) or school, +You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read .