-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: publish packages and finish changelog documentation
- Loading branch information
Showing
49 changed files
with
255 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:brick_core/src/model.dart'; | ||
import 'package:brick_core/src/model_dictionary.dart'; | ||
import 'package:brick_core/src/provider.dart'; | ||
import 'package:brick_core/src/adapter.dart'; | ||
|
||
/// Construct directions for a provider to limit its results. | ||
class LimitBy { | ||
/// The ceiling for how many results can be returned for a [model]. | ||
/// The ceiling for how many results can be returned for [evaluatedField]. | ||
final int amount; | ||
|
||
/// Some providers may support limiting based on a model retrieved by the query. | ||
/// This [Model] should be accessible to the [Provider]'s [ModelDictionary]. | ||
final Type model; | ||
/// This Dart field name should be accessible to the [Adapter]'s definitions | ||
/// (e.g. a `RuntimeSqliteColumnDefinition` map). | ||
final String evaluatedField; | ||
|
||
/// Construct directions for a provider to limit its results. | ||
const LimitBy( | ||
this.amount, { | ||
required this.model, | ||
required this.evaluatedField, | ||
}); | ||
|
||
/// Construct a [LimitBy] from a JSON map. | ||
factory LimitBy.fromJson(Map<String, dynamic> json) => LimitBy( | ||
json['amount'], | ||
model: json['model'], | ||
evaluatedField: json['evaluatedField'], | ||
); | ||
|
||
/// Serialize to JSON | ||
Map<String, dynamic> toJson() => { | ||
'amount': amount, | ||
'model': model, | ||
'evaluatedField': evaluatedField, | ||
}; | ||
|
||
@override | ||
String toString() => jsonEncode(toJson()); | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || other is LimitBy && amount == other.amount && model == other.model; | ||
identical(this, other) || | ||
other is LimitBy && amount == other.amount && evaluatedField == other.evaluatedField; | ||
|
||
@override | ||
int get hashCode => amount.hashCode ^ model.hashCode; | ||
int get hashCode => amount.hashCode ^ evaluatedField.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.