Malo Léon 4b37175d17
Some checks failed
continuous-integration/drone/push Build is failing
feat(ui_kit): add card theme extension, fix bugs & update example (close #126)
2023-02-14 11:34:45 +01:00

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()],
),
),
);
}