odata_query 1.0.0 copy "odata_query: ^1.0.0" to clipboard
odata_query: ^1.0.0 copied to clipboard

OData Query Builder is a simple Dart package for building OData query strings that you can concatenate to your REST API endpoints.

OData Query Builder #

pub package

OData Query Builder is a simple Dart package designed for building OData query strings that you can concatenate to your REST API endpoints. It allows you to construct complex queries using a clean and declarative API, making it easy to interact with OData services.

Features #

Example #

import 'package:odata_query/odata_query.dart';

void main() {
  final query = ODataQuery(
    filter: Filter.and(
      Filter.eq('Name', 'Milk'),
      Filter.lt('Price', 2.55),
    ),
    orderBy: OrderBy.desc('Price'),
    select: ['Name', 'Price'],
    expand: ['Category'],
    top: 10,
    count: true,
  ).build();

  print(query); 
  // Output:
  // "$filter=Name%20eq%20%27Milk%27%20and%20Price%20lt%202.55&$orderby=Price%20desc&$select=Name,Price&$expand=Category&$top=10&$count=true"
}
4
likes
160
points
196
downloads

Publisher

unverified uploader

Weekly Downloads

OData Query Builder is a simple Dart package for building OData query strings that you can concatenate to your REST API endpoints.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on odata_query