{"id":18949207,"url":"https://github.com/invoiceninja/flutter-package","last_synced_at":"2025-06-24T08:37:57.368Z","repository":{"id":43796616,"uuid":"280329859","full_name":"invoiceninja/flutter-package","owner":"invoiceninja","description":"Create PDF invoices and accept payments in a Flutter app","archived":false,"fork":false,"pushed_at":"2023-03-31T10:17:42.000Z","size":10433,"stargazers_count":38,"open_issues_count":0,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-22T23:37:17.660Z","etag":null,"topics":["dart","expenses","flutter","invoices","laravel","php","tasks"],"latest_commit_sha":null,"homepage":"https://invoiceninja.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invoiceninja.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-17T04:55:28.000Z","updated_at":"2024-07-15T17:35:16.000Z","dependencies_parsed_at":"2024-08-22T23:15:01.181Z","dependency_job_id":"bd561a43-5c65-4bd4-808b-319881942373","html_url":"https://github.com/invoiceninja/flutter-package","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invoiceninja%2Fflutter-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invoiceninja%2Fflutter-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invoiceninja%2Fflutter-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invoiceninja%2Fflutter-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invoiceninja","download_url":"https://codeload.github.com/invoiceninja/flutter-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223688625,"owners_count":17186299,"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","expenses","flutter","invoices","laravel","php","tasks"],"created_at":"2024-11-08T13:16:06.686Z","updated_at":"2024-11-08T13:16:08.560Z","avatar_url":"https://github.com/invoiceninja.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice Ninja \n\nCreate PDF invoices and accept payments in a Flutter app\n  \n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/invoiceninja/flutter-package/master/assets/sample.gif\" alt=\"Sample\" width=\"300\"/\u003e\n\u003c/p\u003e  \n\n## YouTube Video\n\n[![YouTube Video](https://img.youtube.com/vi/iefk6TOU-Ts/0.jpg)](https://www.youtube.com/watch?v=iefk6TOU-Ts)\n\n## Features\n* Accept online payment in mobile, web and desktop Flutter apps\n* Supports many payment gateways including Stripe, PayPal and [more](https://invoiceninja.com/payments/)\n* Create professional [PDF invoices](https://invoiceninja.com/invoice-templates/)\n* Includes a self-service client portal\n* Many [more features](https://invoiceninja.com/features/)... \n\n## Overview\n\nThe package provides two main classes:\n* `InvoiceNinja`: Supports the public 'Storefront' routes which allow reading the list of products and creating/finding clients and invoices. Using this class works with restricted access to the account.\n* `InvoiceNinjaAdmin`: Supports the [REST Admin API](https://api-docs.invoicing.co) which uses token based security. Using this class requires an API token to access the account.\n\n## Storefront API\n\n### Configure\n\n```dart\nInvoiceNinja.configure(\n  'KEY', // Set your company key or use 'KEY' to test\n  url: 'https://demo.invoiceninja.com', // Set your selfhost app URL\n  debugEnabled: true,\n);\n```\n\n### Load the product list\n\n```dart\nfinal products = await InvoiceNinja.products.load();\n```\n\n### Find the product by key\n\n```dart\nfinal product = await InvoiceNinja.products.findByKey('product_key');\n```\n\n### Create/persist the client\n\n```dart\nvar client = Client.forContact(email: 'test@example.com');\nclient = await InvoiceNinja.clients.save(client);\n```\n\n### Create/persist the invoice\n\n```dart\nvar invoice = Invoice.forClient(client, products: [product]);\ninvoice = await InvoiceNinja.invoices.save(invoice);\n```\n\n### Display the PDF invoice\n```dart\nlaunch(\n  'https://docs.google.com/gview?embedded=true\u0026url=${invoice.pdfUrl}',\n  forceWebView: true,\n);\n```\n\n### Accept the payment \n\n```dart\nvar invoiceKey = invoice.key;\nlaunch(invoice.url);\n\n// ...\n\nfinal invoice = await InvoiceNinja.invoices.findByKey(invoiceKey);\nif (invoice.isPaid) {\n  // ...\n}\n```\n\nYou can use the [WidgetsBindingObserver](https://api.flutter.dev/flutter/widgets/WidgetsBindingObserver-class.html) interface to run code when the app is resumed. \n\nConsider giving issue [#57536](https://github.com/flutter/flutter/issues/57536) a thumbs up to make this better in the future.\n\n## Admin API\n\n### Configure\n\n```dart\nInvoiceNinjaAdmin.configure(\n  'TOKEN', // Set your API token or use 'TOKEN' to test\n  url: 'https://demo.invoiceninja.com', // Set your selfhost app URL\n  debugEnabled: true,\n);\n``` \n\n### Find a client by email\n\n```dart\nfinal client = await InvoiceNinjaAdmin.clients.findByEmail(email);\n``` \n\n### Load all invoices\n\n```dart\nfinal payments = await InvoiceNinjaAdmin.payments.load();\n``` \n\n### Load the payments list\n\n```dart\nfinal payments = await InvoiceNinjaAdmin.payments.load();\n``` \n\n### Find a payment by id\n\n```dart\nfinal payment = await InvoiceNinjaAdmin.payments.findById(id);\n``` \n\n### Create/persist an invoice and auto-bill it\n\n```dart\nvar invoice = Invoice.forClient(client, products: [product]);\ninvoice = await InvoiceNinjaAdmin.invoices.save(invoice, action: InvoiceAction.autoBill);\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvoiceninja%2Fflutter-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvoiceninja%2Fflutter-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvoiceninja%2Fflutter-package/lists"}