Last active
November 9, 2020 23:44
-
-
Save antklim/6ef1649a7e460205bc306f70e4407002 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _CalculusScreenState extends State<CalculusScreen> { | |
CalculatorUseCase useCase = CalculatorUseCase(); | |
void onMemorise() { | |
setState(() { | |
useCase.memorise(); | |
}); | |
} | |
void onResetMemory() { | |
setState(() { | |
useCase.resetMemory(); | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
... | |
// providing use case to the children elements | |
MemoryInfo(memory: useCase.memory), | |
CalculatorInput(useCase: useCase), | |
MemoryManagement(onMemorise: onMemorise, onResetMemory: onResetMemory), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment