flutterjs_seo 0.1.0
flutterjs_seo: ^0.1.0 copied to clipboard
SEO metadata management for FlutterJS Applications. Lightweight and efficient metadata injection for FlutterJS web apps.
example/lib/main.dart
// Copyright 2025 The FlutterJS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FlutterjsSeo Example',
theme: ThemeData(primarySwatch: Colors.blue),
home: const ExamplePage(),
);
}
}
class ExamplePage extends StatefulWidget {
const ExamplePage({Key? key}) : super(key: key);
@override
State<ExamplePage> createState() => _ExamplePageState();
}
class _ExamplePageState extends State<ExamplePage> {
String result = 'Click the button to test';
void _testPackage() {
setState(() {
// This will call the JavaScript implementation when running with FlutterJS
result = 'FlutterjsSeo is ready!\n\nRun: flutterjs run --to-js --serve';
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('FlutterjsSeo Example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
result,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 16),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: _testPackage,
child: const Text('Test FlutterjsSeo'),
),
],
),
),
);
}
}