{"uid":"cap_ZMcgnNw2nnN0Kr16X3reg","slug":"dart-code-formatter-502cfaed","name":"Dart Code Formatter","description":"Flutter and Dart utility API for mobile agents and operators: pubspec parsing, pub.dev package lookups, Flutter APK detection, dependency checks, Dart formatting, project static analysis, ARB localization validation, and controlled APK builds from uploaded project ZIPs. URL downloads enforce SSRF protections. ZIP uploads enforce size and zip-bomb limits.","url":"https://flutter.bip-rep.com/dart/format","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["source"],"properties":{"source":{"type":"string","description":"Dart source snippet to format (max 256 KB)"}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"changed":{"type":"boolean"},"formatted":{"type":"string"},"latency_ms":{"type":"integer"}}}}}}},"responseSchema":null,"example":{"request":{"input":{"body":{"source":"void main() {\n  print('Hello World');\n}"},"type":"http","method":"POST","bodyType":"json"}},"response":{"changed":true,"formatted":"void main() {\n  print('Hello World');\n}\n","latency_ms":210}},"exampleRequest":{"source":"void main() {\n  print('Hello World');\n}"},"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XtUotj1pyzpH2jQNG4OYn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Formats Dart source code using the official Dart formatter, returning the formatted output and whether the code changed.","exampleAgentPrompt":"Can you format this Dart code for me using the official Dart style? Here's the source: `void main() { print('Hello'); }`","exampleUseCases":[{"title":"Pre-commit Dart code cleanup","prompt":"Before I commit this Dart file, can you run it through the official formatter and show me the cleaned-up version? Here's the source: `class Foo { final int x; Foo(this.x); }`"},{"title":"CI pipeline style enforcement","prompt":"I need to check if this Dart source is already properly formatted according to the official Dart style — if it's not, return the corrected version: `void main() {print('test');}`"},{"title":"Flutter project code standardization","prompt":"Format all this Dart code from my Flutter widget file so it follows the standard Dart style guidelines — here's the raw source: `Widget build(BuildContext context){return Container(child: Text('hi'));}`"}],"resultDescription":"Returns a JSON object with 'changed' (boolean indicating whether formatting altered the code), 'formatted' (the fully formatted Dart source string), and 'latency_ms' (processing time in milliseconds).","failureModes":["Invalid or unparseable Dart source returns a parse error response","Empty source body results in a validation error","Extremely large source files may time out or be rejected","Malformed JSON request body causes a 400 error"],"whenToPreferThis":"Use this endpoint when you need to apply the official Dart formatter (`dart format`) to Dart source code programmatically — especially in CI/CD pipelines, pre-commit hooks, or AI agent workflows that generate or edit Dart/Flutter code and need to normalize style before saving or committing. Prefer this over generic code formatters when you specifically need Dart-idiomatic formatting.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:42:03.134Z","isFirstParty":false}