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
void main() { | |
final porta = Porta(PortaAberta()); | |
print(porta.estado); | |
porta.fechar(); | |
print(porta.estado); | |
porta.trancar(); | |
print(porta.estado); | |
porta.abrir(); | |
print(porta.estado); |
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
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
/// Defines the possible states of a UI page or widget. | |
/// | |
/// This enum helps to clearly represent different stages of a UI, | |
/// such as waiting for data (`loading`), displaying content (`success`), | |
/// or indicating an issue (`error`). |