ducSharedDialog static method

void ducSharedDialog(
  1. BuildContext context,
  2. HollisticMatchScoutingData match
)

Implementation

static void ducSharedDialog(
    BuildContext context, HollisticMatchScoutingData match) {
  Widget qr = _createPrettyQrDataWidget(data: match.toDucFormat());
  Navigator.of(context).push(
    MaterialPageRoute<void>(
      builder: (BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: const Row(
              children: <Widget>[
                Icon(CommunityMaterialIcons.duck),
                Text("DUC Share"),
              ],
            ),
          ),
          body: Stack(children: <Widget>[
            Icon(CommunityMaterialIcons.duck,
                size: 248, color: Colors.black..withOpacity(0.4)),
            SingleChildScrollView(
              physics: const AlwaysScrollableScrollPhysics(
                  parent: BouncingScrollPhysics()),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  const SizedBox(height: 20),
                  const InformationalHintsBlob(
                      "Show to a scouting leader",
                      "A scouting leader will be able to help you with collecting data. Data here is encoded in a CSV format"),
                  const SizedBox(height: 20),
                  const Text("Match Data",
                      style: TextStyle(
                          fontSize: 24,
                          fontWeight: FontWeight.bold)),
                  const SizedBox(height: 8),
                  FilledButton.tonalIcon(
                      onPressed: () async =>
                          await Clipboard.setData(ClipboardData(
                              text: match.toDucFormat())),
                      icon: const Icon(Icons.copy_rounded),
                      label: const Text("Copy")),
                  const SizedBox(height: 8),
                  Center(
                    child: GestureDetector(
                      onTap: () async => launchConfirmDialog(
                          context,
                          message: SizedBox(
                              width: 512, height: 512, child: qr),
                          onConfirm: () {},
                          title: "DUC Share",
                          icon: const Icon(Icons.qr_code_rounded)),
                      child: Container(
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(8),
                            color: Colors.black),
                        child: Padding(
                          padding: const EdgeInsets.all(24),
                          child: SizedBox(
                            width: 512,
                            child: qr,
                          ),
                        ),
                      ),
                    ),
                  ),
                  const SizedBox(
                      height: 40), // idk why, just leave it
                ],
              ),
            )
          ]),
        );
      },
    ),
  );
}