{"id":18048796,"url":"https://github.com/marcelgarus/math_clock","last_synced_at":"2025-08-23T20:17:29.961Z","repository":{"id":96407095,"uuid":"223597072","full_name":"MarcelGarus/math_clock","owner":"MarcelGarus","description":"A mathematical clock, written in Flutter.","archived":false,"fork":false,"pushed_at":"2019-12-04T13:50:06.000Z","size":7148,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T05:31:09.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcelGarus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-23T13:56:32.000Z","updated_at":"2020-02-18T15:55:58.000Z","dependencies_parsed_at":"2023-03-07T08:15:48.062Z","dependency_job_id":null,"html_url":"https://github.com/MarcelGarus/math_clock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MarcelGarus/math_clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelGarus%2Fmath_clock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelGarus%2Fmath_clock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelGarus%2Fmath_clock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelGarus%2Fmath_clock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelGarus","download_url":"https://codeload.github.com/MarcelGarus/math_clock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelGarus%2Fmath_clock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266303651,"owners_count":23908373,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-30T20:15:24.462Z","updated_at":"2025-07-21T12:39:37.274Z","avatar_url":"https://github.com/MarcelGarus.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## math_clock\n\nAn engaging clock face that shows math terms instead of the numbers themselves.\\\nThis project participates in the Flutter Clock challenge.\n\n## How to use\n\n* Clone the [Flutter Clock GitHub repo](https://github.com/flutter/flutter_clock). It contains several folders, including one named `flutter_clock_helper`.\n* In the root folder of the flutter clock repo, clone this repo into a folder named `math_clock`.\n* Now, you can run this Flutter project just like any other one.\n\n## How it works\n\n### Generating terms\n\nInstead of numbers, this clock displays math terms with the operations `+` (Add), `-` (Subtract), `*` (Multiply), `/` (Divide), `%` (Modulo), `²` (Squared), `³` (Cubed), `√` (Root) and `!` (Factorial).\n\nMath terms are represented by a tree.\n\nTo turn the hour and minute numbers into math terms, we construct a tree consisting only of a number node. Then, it's made more complicated multiple times, each time choosing a random number node and complicating it.\n\nFor example, here's how a `2` might be turned into a more complicated math term:\n\n```\n2 │ 66 % 4 │ 66 % 2² │ (22 * 3) % 2²\n  │        │         │ \n2 │   %    │   %     │     %\n  │  / \\   │  / \\    │    / \\\n  │ 66  4  │ 66  ²   │   *   ²\n  │        │     |   │  / \\  |\n  │        │     2   │ 22  3 2\n```\n\nSee the `math` folder for more details.\n\n### Rendering terms\n\nThere's a `TermWidget` that can render a math term.\nIt does so by expanding every math node into multiple widgets.\nBy checking the types of the child nodes, it also inserts parenthesis where necessary.\n\nHere's how the term tree from above is translated into widgets. For legibility, widgets created from the same math node are grouped together:\n\n```\n            ┌──────────────────────┐\n            │      TermWidget      │\n            │    (22 * 3) % 2²     │\n            │                      │\n            │     ModuloWidget     │\n            │    (22 * 3) % 2²     │\n            │                      │\n            │_BinaryOperationWidget│\n            │    (22 * 3) % 2²     │\n            │                      │\n            │  ParenthesisWidget   │\n            │        22 * 3        │\n            └──────────────────────┘\n                 |             |\n┌──────────────────────┐ ┌───────────────────────┐\n│      TermWidget      │ │      TermWidget       │\n│        22 * 3        │ │           2²          │\n│                      │ │                       │\n│    MultiplyWidget    │ │    MultiplyWidget     │\n│        22 * 3        │ │           2²          │\n│                      │ │                       │\n│_BinaryOperationWidget│ │_PostfixOperationWidget│\n│        22 * 3        │ │           2²          │\n└──────────────────────┘ └───────────────────────┘\n      |            |                 |\n┌────────────┐ ┌────────────┐  ┌────────────┐\n│ TermWidget │ │ TermWidget │  │ TermWidget │\n│     22     │ │     3      │  │     2      │\n│            │ │            │  │            │\n│NumberWidget│ │NumberWidget│  │NumberWidget│\n│     22     │ │     3      │  │     2      │\n│            │ │            │  │            │\n│ TightText  │ │ TightText  │  │ TightText  │\n│     22     │ │     3      │  │     2      │\n└────────────┘ └────────────┘  └────────────┘\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelgarus%2Fmath_clock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelgarus%2Fmath_clock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelgarus%2Fmath_clock/lists"}