The deta-dart library is the simple way to interact with the services of the free clud on the Deta plataform.

Related tags

Templates deta-dart
Overview

Deta

codecov style: very good analysis pub package License: MIT


A Dart package to interact with the HTTP API of the free services of the Deta plataform.

🚨 WARNING 🚨 This client should only be used on the server side.


Index

Getting Started

Check the full example here.

Install

Add to dependencies on pubspec.yaml:

dependencies:
    deta: <version>

Usege

We declare class Deta, which receives our private credential as a parameter. The client parameter can receive two different implementations DioClientDetaApi or HttpClientDetaApi, you need to add to its dependencies the one you prefer.

  final deta = Deta(projectKey: 'projectKey', client: DioClientDetaApi(dio: Dio()));

🚨 WARNING 🚨 Your projectKey is confidential and meant to be used by you. Anyone who has your project key can access your database. Please, do not share it or commit it in your code.

DetaBase

DetaBase is a fully-managed, fast, scalable and secure NoSQL database with a focus on end-user simplicity.

We define our DetaBase, with witch we are going to interact through the base method that receives the name of the DetaBase as a parameter. In case not exist it will be created instantly on first use, you can create as many DetaBase as you need.

A DetaBase instance is a collection of data, not unlike a Key-Value store, a MongoDB collection or a PostgreSQL/MySQL table.

  final detabase = deta.base('lenguages');

Methods

put

Save an item. It will update an item if the key already exists.

  await detabase.put({
    'key': 'dart-g',
    'name': 'Dart',
    'description':
        'Dart is a general-purpose programming language that adds strong '
            'support for modularity, co-variant return types, and a strong '
            'emphasis on type safety.',
    'creator': 'Google',
    'year': 2012,
  });
putMany

Saves a list the elements, this list can only have a maximum of 20 element.

  await detabase.putMany(
    items: lenguages.map((lenguage) => lenguage.toJson()).toList(),
  );
insert

Saves an element like put, with the difference that if this element exists in DetaBase it will throw an DetaObjectException. The key required that are part of the elemet to be saved.

  await detabase.insert({
    'key': 'r-f',
    'name': 'R',
    'description': 'R is a programming language and software environment '
        'for statistical computing and graphics.',
    'creator': 'R Foundation',
    'year': 1995,
  });
update

Update the element from the supplied key, you have to pass the whole element, both the updated and unchanged parameters.

  await detabase.update(
    key: 'ruby-ym',
    item: <String, dynamic>{
      'key': 'ruby-ym',
      'name': 'Ruby',
      'description': 'Ruby is a dynamic, open source, general-purpose '
          'programming language with a focus on simplicity and productivity.',
      'creator': 'Yukihiro Matsumoto',
      'year': 1995,
    },
  );
get

Get a spesific element form the key.

  final item = await detabase.get('dart-g');
delete

Delete a spesific element from the key.

  final wasDeleted = await detabase.delete('ruby');
fetch

Return all saved items if no query is specified.

  final all = await detabase.fetch();

Return all element that matched the indicated query.

final result = await detabase.fetch(
  query: [DetaQuery('year').lessThanOrEqualTo(2000).and('name').prefix('C')],
);

Running Tests πŸ§ͺ

To run all unit tests use the following command:

flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use coverde.

# Generate Coverage Report
$ coverde report

A Very Good Project created by Very Good CLI.

You might also like...

A highly customizable Flutter widget to render and interact with JSON objects.

A highly customizable Flutter widget to render and interact with JSON objects.

The spreadsheet with superpowers ✨ ! JSON Data Explorer A highly customizable widget to render and interact with JSON objects. Features Expand and col

Dec 21, 2022

Git+ is your ultimate GitLab mobile app that lets you interact with your projects like as if you were using desktop.

Git+ is your ultimate GitLab mobile app that lets you interact with your projects like as if you were using desktop.

Git+ for GitLab Git+ is your ultimate GitLab mobile app that lets you interact with your projects like as if you were using desktop. Git+ lets you see

Jan 7, 2023

Open source Flutter-based GUI application that enables you to interact with Amphitheatre

Open source Flutter-based GUI application that enables you to interact with Amphitheatre

Amphitheatre Desktop Amphitheatre Desktop is an open source Flutter-based application that enables you to interact with Amphitheatre using a GUI inste

Dec 16, 2022

A Dart package to handle HTTP services

http_services A package to support the creation of Http services in a Dart application. Features convenient methods to perform HTTP requests disposing

Jul 27, 2021

A cross-platform Fediverse client for micro-blogging services written in Flutter/Dart.

A cross-platform Fediverse client for micro-blogging services written in Flutter/Dart.

Kaiteki A 快適 (kaiteki) Fediverse client for microblogging instances, made with Flutter and Dart. Currently, Kaiteki is still in a proof-of-concept/alp

Jan 5, 2023

changelog.dart provides a library and a command-line application to manage in the correct way the git metadata to build the changelog between two release

changelog.dart provides a library and a command-line application to manage in the correct way the git metadata to build the changelog between two release

changelog.dart 🎯 changelog.dart: a collection of tools to manages in a fashion way a repository as maintainer. 🎯 Project Homepage Table of Content I

Dec 18, 2022

SIES Library Catalog - a free book catalog application with an intuitive interface, available for use with Android devices

SIES Library Catalog - a free book catalog application with an intuitive interface, available for use with Android devices

SIES Library Catalog Prepared by @kriticalflare @barath121 @sasukeuzumaki31 @mithil467 1. Introduction: - SIES Library Catalog is a free book catalog

Jan 26, 2022

Check the availability of Google Play services on the current device

Flutter Google Api Availability Plugin A Flutter plugin to check the availability of Google Play services on the current device. Features Check the av

Dec 28, 2022

A package containing different kinds of services and utilities.

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Nov 26, 2021
Comments
  • ci-cd: update branches to run coverage workflow

    ci-cd: update branches to run coverage workflow

    Status IN DEVELOPMENT

    Breaking Changes YES

    Description Resolve #5 and removes the mandatory dependency to only use the Dio http client for requests

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [x] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by yeikel16 0
  • feat: interact with NoSQL database, usign the service of the Deta Base

    feat: interact with NoSQL database, usign the service of the Deta Base

    Implementation from the HTTP API

    Methods

    • [x] put  – Stores an item in the database.
    • [x] putMany – Stores a list if items in the database.
    • [x] insert  – Stores an item in the database but raises an error if the key already exists.
    • [x] get  – Retrieves an item from the database by its key.
    • [x] fetch  – Retrieves multiple items from the database based on the provided (optional) filters.
    • [x] delete  – Deletes an item from the database.
    • [x] update  – Updates an item in the database.
    enhancement 
    opened by yeikel16 0
  • fix(deta_drive): make a genaral `DetaDriveResponse` model

    fix(deta_drive): make a genaral `DetaDriveResponse` model

    @yeikel16 wassup man

    Have added the methods implementation but the DetaDriveResponse model is focused on the upload response only, i left TODOs on the response of the implementations i added and commented the return statement

    Do you have any plans around making it a general drive response model so that all responses are taken into consideration

    bug enhancement help wanted deta-package 
    opened by DonnC 2
  • feat(deta): implement DetaDrive service

    feat(deta): implement DetaDrive service

    Deta Drive is a managed, secure and scalable file storage service in the Deta plataform.

    Methods to impelment:

    • [ ] uploadFile
    • [ ] downloadFile
    • [ ] listFiles
    • [ ] deleteFiles
    enhancement help wanted deta-package 
    opened by yeikel16 0
Releases(0.0.3)
  • 0.0.3(Jan 28, 2022)

  • 0.0.1-beta(Jan 24, 2022)

    First realese

    What's Changed

    • feat: create methods to interact with DetaBase by @yeikel16 in https://github.com/yeikel16/deta-dart/pull/3

    New Contributors

    • @yeikel16 made their first contribution in https://github.com/yeikel16/deta-dart/pull/3

    Full Changelog: https://github.com/yeikel16/deta-dart/commits/pub-realese

    Source code(tar.gz)
    Source code(zip)
Owner
Yeikel Uriarte Arteaga
Self-taught, I love teamwork and eager to learn, passionate about Flutter and Dart. Electronic, crypto enthusiast and lover of new technologies.
Yeikel Uriarte Arteaga
A simple and robust way to interact with Anilibria API.

anilibria.dart A simple and robust way to interact with Anilibria API. Example import 'package:anilibria/anilibria.dart'; void main() async { final

Arsenii Liunsha 3 Jun 13, 2022
A simple and robust dart FTP Client Library to interact with FTP Servers with possibility of zip and unzip files.

Flutter FTP Connect Flutter simple and robust dart FTP Connect Library to interact with FTP Servers with possibility of zip and unzip files. Key Featu

Salim Lachdhaf 49 Dec 13, 2022
An ad-free, open-source bus timing app for bus services in Singapore, with goodies.

SGBuskeeper An ad-free, open-source bus timing app for bus services in Singapore, with goodies. Written in Dart, using Flutter. Planned Featureset Fav

Mark J. 0 Dec 17, 2021
Dart client library to interact with Supabase Storage

storage-dart Dart client library to interact with Supabase Storage. Contributing Fork the repo on GitHub Clone the project to your own machine Commit

Supabase 22 Dec 14, 2022
Yukino lets you read manga or stream anime ad-free from multiple sources for free! Available for Windows, Linux, MacOS and Android.

Yukino Yukino lets you read manga or stream anime ad-free from multiple sources. The project's name "Yukino" meaning "Snow" named after the character

Yukino 204 Jan 6, 2023
A dart package to interact with the WooCommerce REST API.

WooCommerce SDK for Dart A dart package to interact with the WooCommerce API (now with null-safety). It uses OAuth1.0a behind the scenes to generate t

Samarth Agarwal 87 Dec 28, 2022
The easiest way to create your animated splash screen in a fully customizable way.

Animated Splash Screen Check it out at Pub.Dev Do it your way Assets image Custom Widget Url image IconData Or just change PageTransition and/or Splas

Clean Code 104 Nov 10, 2022
Photo Finder - Online free simple photo library with flutter

photo_finder Photo_Finder Is a Online free simple photo library. Fully API Based

CPAD-Gazipur 2 Feb 9, 2022
Tezart helps to interact with ​Tezos blockchain.

Tezart What it is Tezart is a Dart library for building decentralized applications on Tezos blockchain. Tezart interacts with a Tezos node to send tra

MoneyTrack 21 Dec 14, 2022
meg4cyberc4t 11 Oct 24, 2022