import 'package:design/design.dart';
import 'package:example/pages/store/store_controller.dart';
import 'package:example/pages/store/store_design_spec.dart';
import 'package:example/theme/example_theme.dart';
import 'package:guru_widgets/guru_widgets.dart';
import 'package:guru_widgets/assetbar/guru_asset_bar.dart';

class StorePage extends GetWidget<StoreController> {
  StoreDesignSpec get designModel => controller.designSpec;
  const StorePage({super.key});

  Widget buildBody(BuildContext context) {
    return Container(
      child: Stack(children: [
        Positioned(
            top: 50,
            right: 20,
            child: GuruAssetBar(
                key: controller.key1,
                style: GuruAssetBarStyle.igc,
                balanceStream: Stream.periodic(
                    const Duration(seconds: 3000), (count) => count * 1000))),
        Positioned(
            top: 50,
            left: 50,
            child: GuruAssetBar(
                key: controller.key2,
                style: GuruAssetBarThemeMixin.joker,
                balanceStream: Stream.periodic(
                    const Duration(seconds: 3000), (count) => count * 1000))),
        Positioned(
          top: 200,
          left: 100,
          child: GuruButton(
              size: Size(200, 20),
              action: 'play',
              onPressed: () {
                controller.showAssetsOverlay1();
              }),
        ),
        Positioned(
          top: 280,
          left: 100,
          child: GuruButton(
              size: Size(200, 20),
              action: 'play',
              onPressed: () {
                controller.showAssetsOverlay2();
              }),
        ),
      ]),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(backgroundColor: Colors.white, body: buildBody(context));
  }
}
