40 lines
1.1 KiB
Dart

import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_kit_example/cards/cards.dart';
const String title = 'Wyatt Ui Kit Example';
class Home extends StatefulWidget {
const Home({super.key});
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) => Scaffold(
drawer: const Drawer(),
appBar: AppBar(
title: const Text(title),
actions: [
Switch.adaptive(
value: AdaptiveTheme.of(context).isDefault,
onChanged: (_) {
AdaptiveTheme.of(context).isDefault
? AdaptiveTheme.of(context).setDark()
: AdaptiveTheme.of(context).setLight();
},
)
],
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: ListView(
shrinkWrap: true,
children: const [Cards()],
),
),
);
}