showAppFeedbackDialog function

Future<void> showAppFeedbackDialog(
  1. BuildContext context,
  2. String iOSUrlString,
  3. String androidUrlString, {
  4. required bool isHomeOwner,
})

Implementation

Future<void> showAppFeedbackDialog(
  BuildContext context,
  String iOSUrlString,
  String androidUrlString, {
  required bool isHomeOwner,
}) {
  return showDialog(
    context: context,
    builder: (context) => AlertDialog(
      actionsAlignment: MainAxisAlignment.spaceEvenly,
      title: Center(
        child: Text(
          context.sharedL10n.enjoyingThisApp,
          style: context.textTheme.bodyLarge,
        ),
      ),
      content: Text(
        context.sharedL10n.havingGreatExperience,
        style: context.textTheme.titleSmall,
      ),
      actions: [
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            RawMaterialButton(
              onPressed: () {
                showAppFeedbackAsNotSatisfiedDialog(
                  context,
                  isHomeOwner: isHomeOwner,
                );
              },
              child: Column(
                children: [
                  Text(
                    '🙁',
                    style: context.textTheme.headlineMedium,
                  ),
                  Text(
                    context.sharedL10n.notReally,
                    style: context.textTheme.bodyMedium
                        ?.copyWith(color: context.colorScheme.primary),
                  ),
                ],
              ),
            ),
            RawMaterialButton(
              onPressed: () {
                showAppFeedbackStarRatingDialog(
                  context,
                  iOSUrlString,
                  androidUrlString,
                  isHomeOwner: isHomeOwner,
                );
              },
              child: Column(
                children: [
                  Text(
                    '🤗',
                    style: context.textTheme.headlineMedium,
                  ),
                  Text(
                    context.sharedL10n.yes,
                    style: context.textTheme.bodyMedium
                        ?.copyWith(color: context.colorScheme.primary),
                  ),
                ],
              ),
            ),
          ],
        ),
      ],
    ),
  );
}