fix: analysis

This commit is contained in:
Deven Joshi
2021-08-19 18:13:18 +05:30
parent 5cd59f2277
commit 4cec36a723
@@ -318,7 +318,7 @@ class MessageInputState extends State<MessageInput> {
late DateTime? _cooldownStartedAt; late DateTime? _cooldownStartedAt;
int? _timeOut; int? _timeOut;
Timer? slowModeTimer; Timer? _slowModeTimer;
@override @override
void initState() { void initState() {
@@ -361,7 +361,7 @@ class MessageInputState extends State<MessageInput> {
StreamChannel.of(context).channel.cooldown!) { StreamChannel.of(context).channel.cooldown!) {
_timeOut = StreamChannel.of(context).channel.cooldown! - _timeOut = StreamChannel.of(context).channel.cooldown! -
DateTime.now().difference(_cooldownStartedAt!).inSeconds; DateTime.now().difference(_cooldownStartedAt!).inSeconds;
slowModeTimer = Timer.periodic(const Duration(seconds: 1), (timer) { _slowModeTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (_timeOut == 0) { if (_timeOut == 0) {
timer.cancel(); timer.cancel();
} else { } else {
@@ -2267,7 +2267,7 @@ class MessageInputState extends State<MessageInput> {
_emojiOverlay?.remove(); _emojiOverlay?.remove();
_mentionsOverlay?.remove(); _mentionsOverlay?.remove();
_keyboardListener?.cancel(); _keyboardListener?.cancel();
slowModeTimer?.cancel(); _slowModeTimer?.cancel();
super.dispose(); super.dispose();
} }