ssr_core 0.1.0 copy "ssr_core: ^0.1.0" to clipboard
ssr_core: ^0.1.0 copied to clipboard

Core interfaces and types for SSR Framework - A modern Dart framework inspired by Next.js

ssr_core #

Core interfaces and types for SSR Framework.

Overview #

ssr_core provides the fundamental interfaces and types that define the SSR Framework architecture. All other packages depend on this package.

Installation #

dependencies:
  ssr_core: ^0.1.0

Usage #

import 'package:ssr_core/ssr_core.dart';

// Define a page
class HomePage extends SsrPageBase {
  HomePage() : super(
    path: '/',
    title: 'Home',
    description: 'Welcome to my app',
  );

  @override
  Future<String> render(Map<String, dynamic> data) async {
    return '<html><body>${data['message']}</body></html>';
  }

  @override
  Future<Map<String, dynamic>> getInitialData() async {
    return {'message': 'Hello, World!'};
  }
}

// Configure the app
final config = SsrConfig(
  name: 'My App',
  port: 3000,
  enablePwa: true,
  enableSeo: true,
);

API #

Classes #

  • SsrApp - Application interface
  • SsrPage - Page interface
  • SsrPageBase - Base page implementation
  • SsrDynamicPage - Dynamic page with route parameters
  • SsrConfig - Configuration class
  • SsrRouter - Router interface
  • SsrRoute - Route definition
  • SsrState - State management interface

Documentation #

Full API documentation: docs/api/ssr_core.md

License #

MIT

0
likes
150
points
29
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Core interfaces and types for SSR Framework - A modern Dart framework inspired by Next.js

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

meta

More

Packages that depend on ssr_core