ContentValues class

This class is used to store a set of values that the content provider/resolver can process https://developer.android.com/reference/android/content/ContentValues

This class allows storing Java types that are not presented in Dart:

  • Byte
  • Short
  • Integer
  • Float

They are still represented by corresponding Dart types int and double, and when put into ContentValues, keep being stored as is, without overflowing.

For example, if 500 is passed into putByte, it will remain 500 on getByte.

But, when sent over native channels, these values are converted to actual Java types, and therefore an overflow will happen.

Constructors

ContentValues()
Creates ContentValues.
ContentValues.copyFrom(ContentValues other)
Copies values from other ContentValues instances.

Properties

entries Iterable<MapEntry<String, Object?>>
The entries of these ContentValues.
no setter
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Whether this collection is empty.
no setter
isNotEmpty bool
Whether there is at least one value in this collection.
no setter
keys Iterable<String>
The keys of these ContentValues.
no setter
length int
The number of values.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable<Object?>
The values of these ContentValues.
no setter

Methods

clear() → void
Removes all values.
containsKey(String key) bool
Returns true if this object has a value by given key.
getBool(String key) bool?
Gets a bool value by the given key.
getBytes(String key) Uint8List?
Gets a byte array value by the given key.
getDouble(String key) double?
Gets a double value by the given key.
getInt(String key) int?
Gets an int value by the given key.
getObject(String key) Object?
Gets a value by the given key.
getString(String key) String?
Gets a string value by the given key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putBool(String key, bool? value) → void
Adds the bool value to the set by the given key.
putByte(String key, int? value) → void
Adds the byte value to the set by the given key.
putBytes(String key, Uint8List? value) → void
Adds the byte array value to the set by the given key.
putDouble(String key, double? value) → void
Adds the double value to the set by the given key.
putFloat(String key, double? value) → void
Adds the float value to the set by the given key.
putInt(String key, int? value) → void
Adds the integer value to the set by the given key.
putLong(String key, int? value) → void
Adds the long value to the set by the given key.
putNull(String key) → void
Adds a null value to the set by the given key.
putShort(String key, int? value) → void
Adds the short value to the set by the given key.
putString(String key, String? value) → void
Adds the string value to the set by the given key.
remove(String key) Object?
Removes key and its associated value, if present, from the map.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override