Skip to content

Commit 6681f75

Browse files
committed
Format lib files
1 parent bdbcaef commit 6681f75

9 files changed

+119
-129
lines changed

lib/flutter_line_sdk.dart

+15-15
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@
2020
//
2121

2222
/// A Flutter plugin for using the LINE SDKs with Dart in Flutter apps.
23-
///
24-
/// This package is a Dart/Flutter compatible wrapper for using the
25-
/// [LINE SDK for iOS Swift](https://developers.line.biz/en/docs/ios-sdk/swift/overview/) and
26-
/// [LINE SDK for Android](https://developers.line.biz/en/docs/android-sdk/overview/) in your
23+
///
24+
/// This package is a Dart/Flutter compatible wrapper for using the
25+
/// [LINE SDK for iOS Swift](https://developers.line.biz/en/docs/ios-sdk/swift/overview/) and
26+
/// [LINE SDK for Android](https://developers.line.biz/en/docs/android-sdk/overview/) in your
2727
/// Flutter app.
2828
29-
/// To use this plugin and LINE's APIs, you need to register and configure a channel in the
30-
/// [LINE Developers console](https://developers.line.biz/console/). For details, see
29+
/// To use this plugin and LINE's APIs, you need to register and configure a channel in the
30+
/// [LINE Developers console](https://developers.line.biz/console/). For details, see
3131
/// [Getting started with LINE Login](https://developers.line.biz/en/docs/line-login/getting-started/).
32-
///
33-
/// After installing this flutter_line_sdk package, update your Xcode Runner project and Android
34-
/// `build.gradle` file with your channel information. For details, see the "Linking your app to
35-
/// your channel" section in our setup guides for
36-
/// [iOS](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/) and
32+
///
33+
/// After installing this flutter_line_sdk package, update your Xcode Runner project and Android
34+
/// `build.gradle` file with your channel information. For details, see the "Linking your app to
35+
/// your channel" section in our setup guides for
36+
/// [iOS](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/) and
3737
/// [Android](https://developers.line.biz/en/docs/android-sdk/integrate-line-login/).
38-
///
39-
/// After that, use an `import` directive to include flutter_line_sdk in your project and call
40-
/// `await LineSDK.instance.setup($channel_id);` to set up the plugin. For the most basic use case,
38+
///
39+
/// After that, use an `import` directive to include flutter_line_sdk in your project and call
40+
/// `await LineSDK.instance.setup($channel_id);` to set up the plugin. For the most basic use case,
4141
/// invoke the `login` method to prompt your users to log in with their LINE accounts.
42-
///
42+
///
4343
library flutter_line_sdk;
4444

4545
import 'dart:async';

lib/src/line_sdk.dart

+62-72
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// {@template error_handling}
2323
/// This method redirects calls to the LINE SDK for the relevant native platform (iOS or Android).
2424
/// If an error happens in the native platform, a [PlatformException] is thrown. See
25-
/// [PlatformException.code] and [PlatformException.message] for error details.
25+
/// [PlatformException.code] and [PlatformException.message] for error details.
2626
///
2727
/// The LINE SDK implementation differs between iOS and Android, which means error codes and messages
2828
/// can also be different. For platform-specific error information, see
@@ -35,104 +35,94 @@
3535
part of flutter_line_sdk;
3636

3737
/// A general manager class for LINE SDK login features.
38-
///
39-
/// Don't create your own instance of this class. Instead, call [LineSDK.instance] to get a shared
38+
///
39+
/// Don't create your own instance of this class. Instead, call [LineSDK.instance] to get a shared
4040
/// singleton on which you can call other methods.
4141
class LineSDK {
42-
4342
/// The method channel connected to the native side of the LINE SDK.
44-
///
43+
///
4544
/// Don't use this channel directly. Instead, call the public methods on the [LineSDK] class.
4645
static const MethodChannel channel =
4746
const MethodChannel('com.linecorp/flutter_line_sdk');
48-
47+
4948
/// The shared singleton object of `LineSDK`.
50-
///
51-
/// Always use this instance (rather than a self-created instance) to interact with the login
49+
///
50+
/// Always use this instance (rather than a self-created instance) to interact with the login
5251
/// process of the LINE SDK.
5352
static final LineSDK instance = LineSDK._();
5453

5554
LineSDK._();
5655

5756
/// Sets up the SDK with a [channelId] and optional [universalLink].
58-
///
57+
///
5958
/// This method should be called once and only once, before any other methods in [LineSDK].
60-
/// Find your [channelId] in the [LINE Developers Console](https://developers.line.biz/console).
61-
///
62-
/// If you need to navigate from LINE back to your app via a universal link, you must also:
59+
/// Find your [channelId] in the [LINE Developers Console](https://developers.line.biz/console).
60+
///
61+
/// If you need to navigate from LINE back to your app via a universal link, you must also:
6362
/// 1. Specify the link URL in the LINE Developers Console
6463
/// 2. Prepare your server and domain to handle the URL
65-
/// 3. Pass the URL in [universalLink].
66-
///
67-
/// For more about this, see the section "Universal Links support" in
68-
/// [Setting up your project](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/).
69-
/// If you don't pass a [universalLink] in this method, LINE SDK will use the traditional URL
64+
/// 3. Pass the URL in [universalLink].
65+
///
66+
/// For more about this, see the section "Universal Links support" in
67+
/// [Setting up your project](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/).
68+
/// If you don't pass a [universalLink] in this method, LINE SDK will use the traditional URL
7069
/// scheme to open your app when logging in through LINE.
7170
Future<void> setup(String channelId, {String universalLink}) async {
72-
await channel.invokeMethod(
73-
'setup',
74-
<String, String>{
75-
'channelId': channelId,
76-
'universalLink': universalLink
77-
}
78-
);
71+
await channel.invokeMethod('setup', <String, String>{
72+
'channelId': channelId,
73+
'universalLink': universalLink
74+
});
7975
}
8076

81-
/// Logs the user into LINE with the specified [scopes] and [option], by either opening the
82-
/// LINE client for an existing logged in user, or a web view if the LINE client isn't installed
77+
/// Logs the user into LINE with the specified [scopes] and [option], by either opening the
78+
/// LINE client for an existing logged in user, or a web view if the LINE client isn't installed
8379
/// on the user's device.
84-
///
85-
/// By default, the login process uses only `"profile"` as its required scope. If you need
86-
/// more scopes, put the ones you want (in addition to the default `"profile"`) in [scopes] as a
87-
/// list.
88-
///
89-
/// If [scopes] contains `"profile"`, the user profile is returned in the result as
80+
///
81+
/// By default, the login process uses only `"profile"` as its required scope. If you need
82+
/// more scopes, put the ones you want (in addition to the default `"profile"`) in [scopes] as a
83+
/// list.
84+
///
85+
/// If [scopes] contains `"profile"`, the user profile is returned in the result as
9086
/// [LoginResult.userProfile]. If `"profile"` is not included, the value of [LoginResult.userProfile]
91-
/// will be null.
92-
///
93-
/// An access token is issued if the user authorizes your app. This token, along with a refresh
94-
/// token, is automatically stored in a secure place in your app for later use. You don't need to
95-
/// refresh the access token manually. Any following API calls will try to refresh the access
87+
/// will be null.
88+
///
89+
/// An access token is issued if the user authorizes your app. This token, along with a refresh
90+
/// token, is automatically stored in a secure place in your app for later use. You don't need to
91+
/// refresh the access token manually. Any following API calls will try to refresh the access
9692
/// token when necessary. However, you can refresh the access token manually with [refreshToken()].
97-
///
98-
/// You can control some other login behaviors, like whether to use a web page for login, or how
99-
/// to ask the user to add your bot as a friend. To do so, create a [LoginOption] object and pass
93+
///
94+
/// You can control some other login behaviors, like whether to use a web page for login, or how
95+
/// to ask the user to add your bot as a friend. To do so, create a [LoginOption] object and pass
10096
/// it to the [option] parameter.
101-
///
97+
///
10298
/// {@macro error_handling}
10399
Future<LoginResult> login(
104-
{ List<String> scopes = const ["profile"],
105-
LoginOption option
106-
}) async
107-
{
108-
String result = await channel.invokeMethod(
109-
'login',
110-
<String, dynamic>{
111-
'scopes': scopes,
112-
'onlyWebLogin': option?.onlyWebLogin,
113-
'botPrompt': option?.botPrompt
114-
}
115-
);
100+
{List<String> scopes = const ["profile"], LoginOption option}) async {
101+
String result = await channel.invokeMethod('login', <String, dynamic>{
102+
'scopes': scopes,
103+
'onlyWebLogin': option?.onlyWebLogin,
104+
'botPrompt': option?.botPrompt
105+
});
116106
if (result == null) return null;
117107
return LoginResult._(json.decode(result));
118108
}
119109

120110
/// Logs out the current user by revoking the related tokens.
121-
///
111+
///
122112
/// {@macro error_handling}
123113
Future<void> logout() async {
124114
await channel.invokeMethod('logout');
125115
}
126116

127117
/// Gets the current access token in use.
128-
///
129-
/// This returns a `Future<StoredAccessToken>`, with the access token value contained in the
130-
/// result [StoredAccessToken.value]. If the user isn't logged in, it returns a `null` value as
131-
/// the [Future] result.
132-
///
133-
/// A valid [StoredAccessToken] object doesn't necessarily mean the access token itself is valid.
118+
///
119+
/// This returns a `Future<StoredAccessToken>`, with the access token value contained in the
120+
/// result [StoredAccessToken.value]. If the user isn't logged in, it returns a `null` value as
121+
/// the [Future] result.
122+
///
123+
/// A valid [StoredAccessToken] object doesn't necessarily mean the access token itself is valid.
134124
/// It may have expired or been revoked by the user from another device or LINE client.
135-
///
125+
///
136126
/// {@macro error_handling}
137127
Future<StoredAccessToken> get currentAccessToken async {
138128
String result = await channel.invokeMethod('currentAccessToken');
@@ -141,9 +131,9 @@ class LineSDK {
141131
}
142132

143133
/// Gets the user’s profile.
144-
///
134+
///
145135
/// Using this method requires the `"profile"` scope.
146-
///
136+
///
147137
/// {@macro error_handling}
148138
Future<UserProfile> getProfile() async {
149139
String result = await channel.invokeMethod('getProfile');
@@ -152,14 +142,14 @@ class LineSDK {
152142
}
153143

154144
/// Refreshes the access token.
155-
///
145+
///
156146
/// If the token refresh process finishes successfully, the refreshed access token will be
157147
/// automatically stored in the user's device. You can wait for the result of this method or get
158-
/// the refreshed token with [currentAccessToken].
159-
///
160-
/// You don't need to refresh the access token manually. Any API call will attempt to refresh the
148+
/// the refreshed token with [currentAccessToken].
149+
///
150+
/// You don't need to refresh the access token manually. Any API call will attempt to refresh the
161151
/// access token when necessary.
162-
///
152+
///
163153
/// {@macro error_handling}
164154
Future<AccessToken> refreshToken() async {
165155
String result = await channel.invokeMethod('refreshToken');
@@ -168,19 +158,19 @@ class LineSDK {
168158
}
169159

170160
/// Checks whether the stored access token is valid against the LINE authentication server.
171-
///
161+
///
172162
/// {@macro error_handling}
173163
Future<AccessTokenVerifyResult> verifyAccessToken() async {
174164
String result = await channel.invokeMethod('verifyAccessToken');
175165
if (result == null) return null;
176166
return AccessTokenVerifyResult._(json.decode(result));
177167
}
178168

179-
/// Gets the friendship status between the user and the official account linked to your LINE Login
169+
/// Gets the friendship status between the user and the official account linked to your LINE Login
180170
/// channel.
181-
///
171+
///
182172
/// Using this method requires the `"profile"` scope.
183-
///
173+
///
184174
/// {@macro error_handling}
185175
Future<BotFriendshipStatus> getBotFriendshipStatus() async {
186176
String result = await channel.invokeMethod('getBotFriendshipStatus');

lib/src/model/access_token.dart

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@
2121

2222
part of flutter_line_sdk;
2323

24-
/// An access token used to access the LINE Platform.
25-
///
26-
/// Most API calls to the LINE Platform require an access token as evidence of successful
27-
/// authorization. A valid access token is issued after the user grants your app the
28-
/// permissions that your app requests. An access token is bound to permissions (scopes)
29-
/// that define which API endpoints you can access. Choose the permissions for your
24+
/// An access token used to access the LINE Platform.
25+
///
26+
/// Most API calls to the LINE Platform require an access token as evidence of successful
27+
/// authorization. A valid access token is issued after the user grants your app the
28+
/// permissions that your app requests. An access token is bound to permissions (scopes)
29+
/// that define which API endpoints you can access. Choose the permissions for your
3030
/// channel in the LINE Developers site and set them in the login method used in your app.
3131
///
32-
/// An access token expires after a certain period. [expiresIn] specifies the amount of time
32+
/// An access token expires after a certain period. [expiresIn] specifies the amount of time
3333
/// until the token expires, counting from the moment of issue.
3434
///
3535
/// By default, the LINE SDK stores access tokens in a secure place on the device running
3636
/// your app and obtains authorization when you access the LINE Platform through the
3737
/// framework request methods.
3838
///
39-
/// Don't try to create an access token yourself. You can get the stored access token with
39+
/// Don't try to create an access token yourself. You can get the stored access token with
4040
/// [LineSDK.currentAccessToken].
4141
class AccessToken {
4242
AccessToken._(this._data);
43-
43+
4444
final Map<String, dynamic> _data;
4545

4646
/// Raw data of the response in a `Map` representation.
@@ -53,8 +53,8 @@ class AccessToken {
5353
/// counting from when the server issued the token.
5454
num get expiresIn => _data['expires_in'];
5555

56-
/// The raw string value of the ID token bound to the access token.
57-
///
56+
/// The raw string value of the ID token bound to the access token.
57+
///
5858
/// The value exists only if the access token is obtained with the `openID`
5959
/// permission.
6060
String get idTokenRaw => _data['id_token'];

lib/src/model/access_token_verify_result.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ part of flutter_line_sdk;
2424
/// Response to [LineSDK.verifyAccessToken].
2525
class AccessTokenVerifyResult {
2626
AccessTokenVerifyResult._(this._data);
27-
27+
2828
final Map<String, dynamic> _data;
2929

3030
/// Raw data of the response in a `Map` representation.
@@ -36,7 +36,7 @@ class AccessTokenVerifyResult {
3636
/// The valid scopes bound to this access token.
3737
List<String> get scopes => _data['scope'].split(" ");
3838

39-
/// Number of seconds until the access token expires.
39+
/// Number of seconds until the access token expires.
4040
/// Counting from when the server received the request.
4141
num get expiresIn => _data['expires_in'];
4242
}

lib/src/model/bot_friendship_status.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class BotFriendshipStatus {
3131
Map<String, dynamic> get data => _data;
3232

3333
/// Indicates the friendship status.
34-
///
35-
/// `true` if the bot is a friend of the user and the user hasn't blocked the bot.
34+
///
35+
/// `true` if the bot is a friend of the user and the user hasn't blocked the bot.
3636
/// `false` if the bot isn't a friend of the user or the user has blocked the bot.
3737
bool get isFriend => _data['friendFlag'];
3838
}

lib/src/model/login_option.dart

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ part of flutter_line_sdk;
2323

2424
/// Options related to LINE login process.
2525
class LoginOption {
26-
2726
/// Enable to use web authentication flow instead of LINE app-to-app authentication flow.
28-
///
29-
/// By default, LINE SDK will try to use the LINE app to log in. Set the value to `true` to use
27+
///
28+
/// By default, LINE SDK will try to use the LINE app to log in. Set the value to `true` to use
3029
/// the web authentication flow instead.
3130
bool onlyWebLogin;
3231

3332
/// Strategy to use for displaying "add bot as friend" option on consent screen:
34-
///
33+
///
3534
/// - `normal`: A button for adding the bot as a friend is displayed on the consent screen.
36-
/// - `aggressive`: After the user grants the requested permissions on the consent screen, a new
35+
/// - `aggressive`: After the user grants the requested permissions on the consent screen, a new
3736
/// screen opens asking the user to add the bot as a friend.
3837
String botPrompt;
3938

lib/src/model/login_result.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ class LoginResult {
3232

3333
/// Raw data of the response in a `Map` representation.
3434
Map<String, dynamic> get data => _data;
35-
35+
3636
AccessToken _accessToken;
3737
UserProfile _userProfile;
3838

3939
/// The [AccessToken] object obtained during login.
4040
AccessToken get accessToken => _accessToken;
4141
List<String> get scopes => _data['scope'].split(" ");
4242

43-
/// The [UserProfile] object obtained during login.
44-
///
43+
/// The [UserProfile] object obtained during login.
44+
///
4545
/// It contains the user ID, display name, and more.
46-
///
46+
///
4747
/// This object exists only if the `"profile"` scope was included in [LineSDK.login].
4848
UserProfile get userProfile => _userProfile;
4949

5050
/// Indicates that the friendship status between the user and the bot changed during login.
51-
///
52-
/// This value is non-nil only if `BotPrompt` was specified in [LoginOption]. For more
53-
/// information, see
51+
///
52+
/// This value is non-nil only if `BotPrompt` was specified in [LoginOption]. For more
53+
/// information, see
5454
/// [Linking a LINE official account with your LINE Login channel](https://developers.line.me/en/docs/line-login/web/link-a-bot/).
5555
bool get isFriendshipStatusChanged => _data['friendshipStatusChanged'];
5656
}

0 commit comments

Comments
 (0)