buildHintOverlay method

Widget buildHintOverlay()

Implementation

Widget buildHintOverlay() {
  return ValueListenableBuilder<ARHintState>(
    valueListenable: hintState,
    builder: (_, state, __) {
      if (state == ARHintState.placed) {
        return const SizedBox.shrink();
      }

      return Container(
        color: Colors.black45,
        alignment: Alignment.center,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            if (state == ARHintState.preparing ||
                state == ARHintState.loading)
              const CircularProgressIndicator(color: Colors.white)
            else
              GestureDetector(
                onTap: placeObject,
                child: const Icon(
                  Icons.view_in_ar,
                  size: 80,
                  color: Colors.white,
                ),
              ),
            const SizedBox(height: 12),
            Text(
              state == ARHintState.preparing
                  ? 'Preparing AR...'
                  : state == ARHintState.loading
                      ? 'Placing object...'
                      : 'Tap to place object',
              style: const TextStyle(
                color: Colors.white,
                fontSize: 16,
              ),
            ),
          ],
        ),
      );
    },
  );
}