From 2fd11f36fc748a0c246fc104b8379e447ed8690c Mon Sep 17 00:00:00 2001 From: David Senk Date: Thu, 5 Sep 2024 20:35:26 -0400 Subject: [PATCH] listen tab initial layout --- lib/Listen.dart | 39 ++++++++++++++++++++++++++++++++++++++- lib/YthingRadio.dart | 5 ++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/lib/Listen.dart b/lib/Listen.dart index 6c37a0f..0499f14 100644 --- a/lib/Listen.dart +++ b/lib/Listen.dart @@ -6,7 +6,44 @@ class Listen extends StatelessWidget { @override Widget build(BuildContext context) { return const Center( - child: Text("Listen Page"), + child: PlayControls(), + ); + } +} + +class PlayControls extends StatefulWidget { + const PlayControls({super.key}); + + @override + State createState() => _PlayControlsState(); +} + +class _PlayControlsState extends State { + bool isPlaying = false; + + @override + Widget build(BuildContext context) { + return ClipOval( + child: Material( + color: Theme.of(context).colorScheme.primaryContainer, + child: InkWell( + splashColor: Theme.of(context).colorScheme.onPrimaryContainer, + onTap: () { + setState(() { + isPlaying = !isPlaying; + }); + }, + child: SizedBox( + width: 100, + height: 100, + child: Icon( + isPlaying ? Icons.stop : Icons.play_arrow, + color: Colors.white, + size: 50, + ), + ), + ), + ), ); } } diff --git a/lib/YthingRadio.dart b/lib/YthingRadio.dart index 54c54d4..d53599b 100644 --- a/lib/YthingRadio.dart +++ b/lib/YthingRadio.dart @@ -11,7 +11,10 @@ class YthingRadio extends StatelessWidget { return MaterialApp( title: 'Ything Radio', theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), + colorScheme: ColorScheme.fromSeed( + seedColor: Colors.orange, + dynamicSchemeVariant: DynamicSchemeVariant.fidelity, + ), useMaterial3: true, ), home: const HomePage(title: 'Ything Radio'),