Skip to content

Commit 649718b

Browse files
committed
Added a default value for bindings arguments.
1 parent de62cfc commit 649718b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9-
## [0.3.3] - 2018-12-08
10-
### Added
9+
## [0.3.3] - 2019-01-21
10+
### Changed
11+
- Added a default value for the bindings argument in `SQLiteDatabase#execSQL()`
12+
- Added a default value for the bindings argument in `SQLiteDatabase#rawQuery()`
1113

1214
## [0.3.2] - 2018-12-08
1315
### Changed

lib/src/database.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ abstract class SQLiteDatabase implements SQLiteClosable {
225225
/// It has no means to return any data (such as the number of affected rows).
226226
///
227227
/// See: https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#execSQL(java.lang.String)
228-
Future<void> execSQL(final String sql, [final List<dynamic> args]) {
228+
Future<void> execSQL(final String sql, [final List<dynamic> args = const []]) {
229229
final Map<String, dynamic> request = <String, dynamic>{'id': id, 'sql': sql, 'args': args};
230230
return _channel.invokeMethod('execSQL', request);
231231
}
@@ -423,7 +423,7 @@ abstract class SQLiteDatabase implements SQLiteClosable {
423423
/// Runs the provided SQL and returns a cursor over the result set.
424424
///
425425
/// See: https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#rawQuery(java.lang.String,%20java.lang.String[])
426-
Future<SQLiteCursor> rawQuery(final String sql, [final List<String> args]) async {
426+
Future<SQLiteCursor> rawQuery(final String sql, [final List<String> args = const <String>[]]) async {
427427
final Map<String, dynamic> request = <String, dynamic>{'id': id, 'sql': sql, 'args': args};
428428
final List<dynamic> result = await _channel.invokeMethod('rawQuery', request);
429429
assert(result.length == 2);

0 commit comments

Comments
 (0)