{"id":18011660,"url":"https://github.com/renatoathaydes/flattery","last_synced_at":"2025-04-04T13:43:43.107Z","repository":{"id":56828885,"uuid":"181177898","full_name":"renatoathaydes/flattery","owner":"renatoathaydes","description":"Flattery is a library for building HTML elements using Widgets.","archived":false,"fork":false,"pushed_at":"2019-09-01T14:58:14.000Z","size":111,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T23:28:26.355Z","etag":null,"topics":["dart","dart-web","web-framework","widget-toolkit"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flattery","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renatoathaydes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-13T13:49:15.000Z","updated_at":"2021-07-27T00:48:39.000Z","dependencies_parsed_at":"2022-08-28T21:11:38.688Z","dependency_job_id":null,"html_url":"https://github.com/renatoathaydes/flattery","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Fflattery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Fflattery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Fflattery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Fflattery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renatoathaydes","download_url":"https://codeload.github.com/renatoathaydes/flattery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247189450,"owners_count":20898690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-web","web-framework","widget-toolkit"],"created_at":"2024-10-30T03:12:18.488Z","updated_at":"2025-04-04T13:43:43.083Z","avatar_url":"https://github.com/renatoathaydes.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flattery\n\nFlattery is a library for building HTML elements using Widgets.\n\nWidgets are just Dart objects whose purpose is to represent some user interface element.\nThey are implemented using the awesome `dart:html` package, and do not try to hide it - so you can\nuse your HTML/CSS knowledge to enhance existing widgets, and to create your own, type safely.\n\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'dart:html' hide Text;\n\nimport 'package:flattery/flattery_widgets.dart';\n\n/// Simple Counter Model.\nclass Counter {\n  int value = 0;\n}\n\n/// A Counter Widget.\n///\n/// By implementing [ShadowWidget], we make our widget use a shadow root\n/// to isolate its contents.\nclass CounterView extends Counter with Widget, ShadowWidget {\n  final text = Text('')..style.textAlign = 'left';\n\n  /// Build the component's Element.\n  /// Uses a 2x2 grid to place the child Widgets\n  Element build() =\u003e Grid(columnGap: '10px', classes: [\n        'main-grid'\n      ], children: [\n        [text, text],\n        // row 1 (repeat the element so it takes up both columns)\n        [\n          // row 2 contains 2 buttons to inc/decrement the counter\n          Button(text: 'Increment', onClick: (e) =\u003e value++),\n          Button(text: 'Decrement', onClick: (e) =\u003e value--),\n        ]\n        // row 2\n      ]).root;\n\n  CounterView() {\n    stylesheet = '* { font-family: sans-serif; }'\n        'button { height: 4em; }'\n        '.main-grid { width: 25em; }';\n    _update();\n  }\n\n  /// All model's setters that affect the state of the view need to be\n  /// overridden in the Widget extending it, so that they update the view.\n  @override\n  set value(int value) {\n    super.value = value;\n    _update();\n  }\n\n  _update() =\u003e text.text = 'The current count is $value';\n}\n```\n\n## Building\n\n```\npub get\n```\n\n### Run the example\n\n```\nwebdev serve example\n```\n\n### Running the tests\n\nUnit tests:\n\n```\npub run test\n```\n\n\u003e Use option `-r json` or `r -expanded` to see details.\n\nBrowser tests:\n\n```\npub run test -p chrome\n```\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/renatoathaydes/flattery/issues\n\n## Links\n\nDart Test Documentation:\n\nhttps://github.com/dart-lang/test/tree/master/pkgs/test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoathaydes%2Fflattery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenatoathaydes%2Fflattery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoathaydes%2Fflattery/lists"}