schema_org 1.0.3 copy "schema_org: ^1.0.3" to clipboard
schema_org: ^1.0.3 copied to clipboard

A JSON-LD library with Flutter/Dart types for Schema.org vocabulary.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:schema_org/schema_org.dart';
import 'package:schema_org/schemas/organization.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    SchemaOrg.writeJsonLd(SchemaOrganization(
      name: 'Oddbit',
      url: 'https://oddbit.id',
      logo: 'https://avatars.githubusercontent.com/u/1946799?s=200&v=4',
    ));
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Schema.org Example App',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSwatch(
          primarySwatch: Colors.green,
          accentColor: Colors.green.shade700,
          brightness: Brightness.dark,
        ),
      ),
      home: Scaffold(
        body: Center(
          child: IntrinsicWidth(
            child: Card(
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Row(
                  children: [
                    const CircleAvatar(
                      backgroundImage: NetworkImage(
                          'https://avatars.githubusercontent.com/u/1946799?s=200&v=4'),
                      radius: 30,
                    ),
                    const SizedBox(width: 16),
                    Text(
                      'Oddbit',
                      style: Theme.of(context).textTheme.titleLarge?.copyWith(
                            color: Colors.green,
                          ),
                    ),
                  ],
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
47
downloads

Publisher

verified publisheroddbit.id

Weekly Downloads

A JSON-LD library with Flutter/Dart types for Schema.org vocabulary.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

build_runner, flutter

More

Packages that depend on schema_org