zam_block_architecture

Creator: coderz1093

Last updated:

0 purchases

zam_block_architecture Image
zam_block_architecture Images
Add to Cart

Description:

zam block architecture

Block Architecture #
Architecture that bridges the gap between Business Analysts and Developers.
What's inside the package #

Block
Logic
Rule
Sanitizer

Check out all the components in detail here
How to use #
class OddNumberRule extends CustomRule<int, int> {
final int fact;
int get value => fact;

const OddNumberRule(this.fact);

bool isSatisfied(int fact) {
return fact % 2 != 0;
}
}

class UpperBoundRule extends CustomRule<int, int> {
final int fact;
final int limit;
int get value => fact;

const UpperBoundRule(this.fact, this.limit);

bool isSatisfied(int fact) {
return fact < limit;
}
}

void main() {
final input = 13;
final rule = SatisfyAllRule(input, input, children: [
OddNumberRule(input),
UpperBoundRule(input, 20),
]);
final ruleResponse = rule.execute();
print(ruleResponse.isSuccess); // prints true

final input2 = 21;
final rule2 = SatisfyAllRule(input2, input2, children: [
OddNumberRule(input2),
UpperBoundRule(input2, 20),
]);
final ruleResponse2 = rule2.execute();
print(ruleResponse2.isSuccess); // prints false
}
copied to clipboard
To learn more, move on to the example section or check out these dedicated examples in github.
Status #

Contributors #

Amsakanna

License #
BSD 3-Clause License

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.