steward 0.2.8 icon indicating copy to clipboard operation
steward: ^0.2.8 copied to clipboard


Steward is a CLI and Framework for building expressive web servers in Dart.


A helpful framework for building server-side experiences with Dart.

pub version codecov points likes build status

Full-fledged docs live here (WIP but still very useful at this point):

Steward features a command line interface for starting a new Steward project! Check it out!

Note: As of 0.0.2, Steward uses a config yml file that is generated by the CLI. If you choose to not use the CLI, you'll need to generate a matching config.yml file.

The best examples for how to use Steward are captured in the test folder. Eventually, we'll refactor this out into tests and examples separately, but for now, they live together :)

Using the Steward framework gives you the following (but not limited to) benefits:

  • A modular system with light Dependency Injection, Routing, Controllers, and more.
  • Automatic dependency injection into controllers when mounting into routers.
  • Easy HTTP request/response management.
  • Config parsing into the DI container at application boot.
  • Templating via the Mustache template specification.

Here's an example of how you can use Steward!

import 'package:steward/steward.dart';

// You can pull me out to a separate file, too ya know ;)
class SampleController extends Controller {
  late UserService userService;
  version(_) => 'v1.0';

  Response show(Request request) => view('main_template');
  Response users => UserService.getUsers();

Future main() async {
  var router = Router();
  var container = CacheContainer();
  // Setup a DI binding for UserService
  container.bind('UserService', (_) => UserService());
  // Replace the default DI container implementation
  // Mount the controller, parsing the annotations to build paths and injecting injectables
  // Bare route handler example
  router.get('/hello', (_) {
    return Response.Ok('Hello World!');
  // Plucking things out of the container example
  router.get('/config', (Request request) {
    return Response.Ok(request.container.make(''));
  // Path Params example
  router.get('/:name', (Request request) {
    return Response.Ok(request.pathParams['name']);
  var app = App(router: router);
  return app.start();
pub points


unverified uploader

Steward is a CLI and Framework for building expressive web servers in Dart.



API reference


Icon for licenses.MIT (LICENSE)


bosun, flat, mustache_template, path_to_regexp, recase, yaml


Packages that depend on steward