{"id":28491496,"url":"https://github.com/line/flutter_line_sdk","last_synced_at":"2026-03-11T02:16:53.831Z","repository":{"id":35988093,"uuid":"191473915","full_name":"line/flutter_line_sdk","owner":"line","description":"A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.","archived":false,"fork":false,"pushed_at":"2025-10-30T03:03:01.000Z","size":525,"stargazers_count":226,"open_issues_count":6,"forks_count":51,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-02-15T11:27:42.680Z","etag":null,"topics":["dart","line-sdk"],"latest_commit_sha":null,"homepage":"https://developers.line.biz/","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/line.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-06-12T01:18:23.000Z","updated_at":"2026-01-02T08:01:14.000Z","dependencies_parsed_at":"2023-11-16T06:24:54.270Z","dependency_job_id":"bcbb0708-3ec9-4730-9225-9e2964da97d4","html_url":"https://github.com/line/flutter_line_sdk","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/line/flutter_line_sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fflutter_line_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fflutter_line_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fflutter_line_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fflutter_line_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line","download_url":"https://codeload.github.com/line/flutter_line_sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fflutter_line_sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30364735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dart","line-sdk"],"created_at":"2025-06-08T08:07:32.084Z","updated_at":"2026-03-11T02:16:53.806Z","avatar_url":"https://github.com/line.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_line_sdk\n\n[![build](https://github.com/line/flutter_line_sdk/actions/workflows/build.yml/badge.svg)](https://github.com/line/flutter_line_sdk/actions/workflows/build.yml)\n\nA [Flutter] plugin that lets developers access LINE's native SDKs in Flutter apps with [Dart].\n\nThe plugin helps you integrate LINE Login features in your app. You can redirect users to LINE or a web page where they log in with their LINE credentials. Example:\n\n```dart\nimport 'package:flutter_line_sdk/flutter_line_sdk.dart';\n\nvoid login() async {\n    try {\n        final result = await LineSDK.instance.login();\n        setState(() {\n            _userProfile = result.userProfile;\n            // user id -\u003e result.userProfile?.userId\n            // user name -\u003e result.userProfile?.displayName\n            // user avatar -\u003e result.userProfile?.pictureUrl\n            // etc...\n        });\n    } on PlatformException catch (e) {\n        // Error handling.\n        print(e);\n    }\n}\n```\n\nFor more examples, see the [example app](https://github.com/line/flutter_line_sdk/tree/master/example) and [API definitions].\n\n## Prerequisites\n\nFrom version 2.0, `flutter_line_sdk` supports [null safety](https://dart.dev/null-safety). If you are still seeking a legacy version without null safety, check [version 1.3.0](https://github.com/line/flutter_line_sdk/releases/tag/1.3.0).\n\n- iOS 13.0 or later as the deployment target\n- Android `minSdkVersion` set to 24 or higher (Android 7.0 or later)\n- [LINE Login channel linked to your app](https://developers.line.biz/en/docs/line-login/getting-started/)\n\nTo access your LINE Login channel from a mobile platform, you need some extra configuration. In the [LINE Developers console][console], go to your LINE Login channel settings, and enter the below information on the **App settings** tab.\n\n### iOS app settings\n\n| Setting | Description |\n|-------|---------|\n| iOS bundle ID | Required. Bundle identifier of your app. In Xcode, find it in your **Runner** project settings, on the **General** tab. Must be lowercase, like `com.example.app`. You can specify multiple bundle identifiers by typing each one on a new line. |\n| iOS universal link  | Optional. Set to the universal link configured for your app. For more information on how to handle the login process using a universal link, see [Universal Links support](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#universal-link-support). |\n\n### Android app settings\n\n| Setting | Description |\n|-------|---------|\n| Android package name | Required. Application's package name used to launch the Google Play store. |\n| Android package signature | Optional. You can set multiple signatures by typing each one on a new line. |\n| Android scheme | Optional. Custom URL scheme used to launch your app. |\n\n## Installation\n\n### Adding flutter_line_sdk package\n\nUse the standard way of adding this package to your Flutter app, as described in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/using-packages):\n\n```sh\nflutter pub add flutter_line_sdk\n```\n\nNow, the Dart part of `flutter_line_sdk` should be installed. Next, you need to set up LINE SDK for iOS and Android projects, respectively.\n\n### Set up LINE SDK\n\n#### iOS\n\nOpen the file `ios/Runner/Info.plist` in a text editor and insert this snippet just before the last `\u003c/dict\u003e` tag:\n\n```xml\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eCFBundleTypeRole\u003c/key\u003e\n    \u003cstring\u003eEditor\u003c/string\u003e\n    \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n    \u003carray\u003e\n      \u003c!-- Specify URL scheme to use when returning from LINE to your app. --\u003e\n      \u003cstring\u003eline3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)\u003c/string\u003e\n    \u003c/array\u003e\n  \u003c/dict\u003e\n\u003c/array\u003e\n\u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n\u003carray\u003e\n  \u003c!-- Specify URL scheme to use when launching LINE from your app. --\u003e\n  \u003cstring\u003elineauth2\u003c/string\u003e\n\u003c/array\u003e\n```\n\nBecause LINE SDK now requires iOS 13.0 or above to provide underlying native features, while the default deployment \ntarget of Flutter is 12.0, you must set the deployment target to 13.0 or higher. \n\n##### CocoaPods integration\n\nIf you are using CocoaPods in your project, add this line in the `Runner` target in `ios/Podfile`:\n\n```diff\ntarget 'Runner' do\n+ platform :ios, '13.0'\n\n  use_frameworks!\n  use_modular_headers!\n  ...\n```\n\n##### Swift Package Manager integration\n\nIf you are using Swift Package Manager in your project, open the project and [increase the **Minimum Deployments**](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#how-to-use-a-swift-package-manager-flutter-plugin-that-requires-a-higher-os-version) of your app's target to 13.0.\n\n#### Android\n\nTo ensure compatibility with the latest features, you need to update the `minSdk` version in your app's `build.gradle` file to `24` or higher. \n\nHere's how you can do it:\n\n1. Open your app's `build.gradle` file.\n2. Locate the `android` block, and within it, find the `defaultConfig` block.\n3. In the `defaultConfig` block, replace the current `minSdk` value with `24`.\n\nHere's a diff to show what your changes might look like:\n\n```diff\nandroid {\n    defaultConfig {\n-        minSdk flutter.minSdkVersion\n+        minSdk 24\n    }\n}\n```\n\n### Importing and using\n\n#### Setup\n\nImport `flutter_line_sdk` to any place you want to use it in your project:\n\n```dart\nimport 'package:flutter_line_sdk/flutter_line_sdk.dart';\n```\n\nTo use the package, you need to set up your channel ID. You can do this by calling the `setup` method, for example in the `main` function:\n\n```diff\n- void main() =\u003e runApp(MyApp());\n+ void main() {\n+   WidgetsFlutterBinding.ensureInitialized();\n+   LineSDK.instance.setup(\"${your_channel_id}\").then((_) {\n+     print(\"LineSDK Prepared\");\n+   });\n+   runApp(App());\n+ }\n```\n\nThis is merely an example. You can call `setup` any time you want, provided you call it exactly once, before calling any other LINE SDK methods.\n\nTo help you get started with this package, we list several basic usage examples below. All available `flutter_line_sdk` methods are documented on the [Dart Packages][API Definitions] site.\n\n#### Login\n\nNow you are ready to let your user log in with LINE.\n\nGet the login result by assigning the value of `Future\u003cLoginResult\u003e` to a variable.\nTo handle errors gracefully, wrap the invocation in a `try...on` statement:\n\n```dart\nvoid _signIn() async {\n  try {\n    final result = await LineSDK.instance.login();\n    // user id -\u003e result.userProfile?.userId\n    // user name -\u003e result.userProfile?.displayName\n    // user avatar -\u003e result.userProfile?.pictureUrl\n  } on PlatformException catch (e) {\n    _showDialog(context, e.toString());\n  }\n}\n```\n\nBy default, `login` uses `[\"profile\"]` as its scope. In this case, when login is done, you have a `userProfile` value in login `result`. \nIf you need other scopes, pass them in a list to `login`. See the [Scopes](https://developers.line.biz/en/docs/line-login/web/integrate-line-login/#scopes) documentation for more.\n\n```dart\nfinal result = await LineSDK.instance.login(\n    scopes: [\"profile\", \"openid\", \"email\"]\n);\n// user email, if user set it in LINE and granted your request.\nfinal userEmail = result.accessToken.email;\n```\n\n\u003e Although it might be useless, if you do not contain a `\"profile\"` scope, `userProfile` will be a null value.\n\n#### Logout\n\n```dart\ntry {\n  await LineSDK.instance.logout();\n} on PlatformException catch (e) {\n  print(e.message);\n}\n```\n\n#### Get user profile\n\n```dart\ntry {\n  final result = await LineSDK.instance.getProfile();\n  // user id -\u003e result.userId\n  // user name -\u003e result.displayName\n  // user avatar -\u003e result.pictureUrl\n} on PlatformException catch (e) {\n  print(e.message);\n}\n```\n\n#### Get current stored access token\n\n```dart\ntry {\n  final result = await LineSDK.instance.currentAccessToken;\n  // access token -\u003e result?.value\n} on PlatformException catch (e) {\n  print(e.message);\n}\n```\n\n\u003e If the user isn't logged in, it returns a `null`. A valid `result` of this method doesn't necessarily mean the access \n\u003e token itself is valid. It may have expired or been revoked by the user from another device or LINE client.\n\n#### Verify access token with LINE server\n\n```dart\ntry {\n  final result = await LineSDK.instance.verifyAccessToken();\n  // result.data is accessible if the token is valid.\n} on PlatformException catch (e) {\n  print(e.message);\n  // token is not valid, or any other error.\n}\n```\n\n#### Refresh current access token\n\n```dart\ntry {\n  final result = await LineSDK.instance.refreshToken();\n  // access token -\u003e result.value\n  // expires duration -\u003e result.expiresIn\n} on PlatformException catch (e) {\n  print(e.message);\n}\n```\n\nNormally, you don't need to refresh access tokens manually, because any API call in LINE SDK will try to refresh the access token automatically when necessary. \n**We do not recommend refreshing access tokens yourself.** \nIt's generally easier, more secure, and more future-proof to let the LINE SDK manage access tokens automatically.\n\n### Error handling\n\nAll APIs can throw a `PlatformException` with error `code` and a `message`. Use this information to identify when an error happens inside the native SDK. \n\nError codes and messages will vary between iOS and Android. Be sure to read the error definition on [iOS](https://developers.line.biz/en/reference/ios-sdk-swift/Enums/LineSDKError.html) and [Android](https://developers.line.biz/en/reference/android-sdk/reference/com/linecorp/linesdk/LineApiError.html) to provide better error recovery and user experience on different platforms.\n\n## Contributing\n\nIf you believe you found a vulnerability or you have an issue related to security, please **DO NOT** open a public issue. Instead, send us an email at [dl_oss_dev@linecorp.com](mailto:dl_oss_dev@linecorp.com).\n\nBefore contributing to this project, please read [CONTRIBUTING.md].\n\n\u003c!-- Links and references --\u003e\n[Flutter]: https://flutter.dev/\n[Dart]: https://dart.dev/\n[API definitions]: https://pub.dev/documentation/flutter_line_sdk/latest/flutter_line_sdk/flutter_line_sdk-library.html\n[console]: https://developers.line.biz/console/\n[Cocoa Touch]: https://en.wikipedia.org/wiki/Cocoa_Touch\n[CONTRIBUTING.md]: https://github.com/line/flutter_line_sdk/blob/master/CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fflutter_line_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline%2Fflutter_line_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fflutter_line_sdk/lists"}