Skip to content
pubscout

functions_framework

0.4.3+1, released 3 years ago by cloud.google.com

FaaS framework for writing portable Dart functions.

$ flutter pub add functions_framework
Source repository

What it does

An open source FaaS (Function as a Service) framework that lets you write lightweight functions in Dart which run portably across local machines, Google Cloud Run, Google App Engine, and Knative-based environments without writing explicit HTTP server boilerplate.

AI-written summary of version 0.4.3+1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to deploy serverless Dart functions to Google Cloud Run or Knative environments.
  • You want to handle HTTP requests or CloudEvents without writing custom server request-handling logic.

Skip it when

  • You need an officially supported Google Cloud Functions Dart runtime (currently not provided).
  • You require an official enterprise-level SLA or deprecation policy, as this is a community-supported project.

Strengths

  • Portable between multiple serverless and container platforms like Cloud Run and App Engine.
  • Supports automatic unmarshaling of CloudEvents and handling of JSON data.
  • Removes the boilerplate of setting up an HTTP server and request-handling logic.

Weaknesses

  • Community-supported project with no official level of support or SLA.
  • Google Cloud Functions does not currently provide an officially supported Dart language runtime.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
10

Annotate functions with @CloudFunction() and run inside serverless containers or local environments.

import 'package:functions_framework/functions_framework.dart';
import 'package:shelf/shelf.dart';

@CloudFunction()
Response function(Request request) => Response.ok('Hello, World!');

Alternatives

Packages that do the same job and could replace functions_framework.

Works with

Packages commonly used together with functions_framework: ones it builds on, ones built on it, and its own family.