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

Dart library for working and interacting with the Airtable API

example/dart_airtable_example.dart

import 'dart:io';

import 'package:dart_airtable/dart_airtable.dart';
import 'package:dotenv/dotenv.dart' as dotenv;

void main() async {
  dotenv.load();

  final apiKey = dotenv.env['AIRTABLE_API_KEY'];
  final projectBase = dotenv.env['AIRTABLE_PROJECT_BASE'];
  final recordName = dotenv.env['AIRTABLE_RECORD_NAME'];

  final Map<String, dynamic> envvars = {
    'apiKey': dotenv.env['AIRTABLE_API_KEY'],
    'projectBase': dotenv.env['AIRTABLE_PROJECT_BASE'],
    'recordName': dotenv.env['AIRTABLE_RECORD_NAME'],
  }..removeWhere((k, v) => v != null);

  if (envvars.isNotEmpty) {
    throw StdinException(
      'You must specify the envvars ${envvars.keys.join(', ')}',
    );
  }

  final airtable = Airtable(apiKey: apiKey, projectBase: projectBase);
  final records = await airtable.getAllRecords(recordName);

  print(records);
}
11
likes
140
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

Dart library for working and interacting with the Airtable API

Repository
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

http, meta

More

Packages that depend on dart_airtable