vistalityui 1.0.3
vistalityui: ^1.0.3 copied to clipboard
A Material 3 Flutter UI library with seed-based theming and reusable components.
import 'package:flutter/material.dart';
import 'package:vistalityui/vistalityui.dart';
/// Runs the Vistality UI example app.
void main() {
runApp(const VistalityExampleApp());
}
/// Example app showcasing core components.
class VistalityExampleApp extends StatelessWidget {
/// Creates a [VistalityExampleApp].
const VistalityExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Vistality UI Example',
theme: buildTheme(const Color(0xFF6366F1)),
home: const ExampleHomePage(),
);
}
}
/// Example home page with basic components.
class ExampleHomePage extends StatelessWidget {
/// Creates an [ExampleHomePage].
const ExampleHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Vistality UI')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
const VHeading('Components', level: VHeadingLevel.h4),
const SizedBox(height: 16),
const VHeading('Buttons', level: VHeadingLevel.h5),
const SizedBox(height: 8),
VButtonGroup(
children: [
VButton(
label: 'Primary action',
onPressed: () {},
leading: const Icon(Icons.flash_on),
),
VButton(
label: 'Ghost button',
variant: VButtonVariant.ghost,
onPressed: () {},
),
],
),
const SizedBox(height: 16),
const VHeading('Button overrides', level: VHeadingLevel.h5),
const SizedBox(height: 8),
VButtonGroup(
children: [
VButton(
label: 'Overridden colors',
onPressed: () {},
backgroundColor: Colors.amber,
foregroundColor: Colors.black,
borderColor: Colors.deepOrange,
leading: const Icon(Icons.color_lens),
),
],
),
const SizedBox(height: 24),
VAccordion(
title: 'Details',
initiallyExpanded: true,
child: const Text(
'Vistality UI provides reusable components with a cohesive theme.',
),
),
const SizedBox(height: 24),
Row(
children: [
VCheckbox(
value: true,
onChanged: (_) {},
),
const SizedBox(width: 12),
const Text('Enable feature'),
],
),
],
),
);
}
}