FakeDialogAdapter class

A configurable ReviewDialogAdapter for testing.

Returns predetermined results without showing any UI. No mocking library required.

import 'package:happy_review/testing.dart';

// User always taps "Love it!":
final adapter = FakeDialogAdapter();

// User always taps "Not really":
final adapter = FakeDialogAdapter(
  preDialogResult: PreDialogResult.negative,
  feedbackResult: FeedbackResult(comment: 'Too slow'),
);
Inheritance

Constructors

FakeDialogAdapter({PreDialogResult preDialogResult = PreDialogResult.positive, FeedbackResult? feedbackResult})

Properties

feedbackResult FeedbackResult?
The result returned by showFeedbackDialog. Only relevant when preDialogResult is PreDialogResult.negative.
final
hashCode int
The hash code for this object.
no setterinherited
preDialogResult PreDialogResult
The result returned by showPreDialog.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showFeedbackDialog(BuildContext context) Future<FeedbackResult?>
Shows a feedback form after the user indicated dissatisfaction.
override
showPreDialog(BuildContext context) Future<PreDialogResult>
Shows the satisfaction pre-dialog and returns the user's choice.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited