flutter-freaccess-hub/lib/pages/pets_page/pets_page_model.dart

39 lines
1021 B
Dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/uploaded_file.dart';
import 'package:hub/pages/pets_page/pets_page_widget.dart';
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
late final TabController tabBarController;
Timer? _debounceTimer;
final unfocusNode = FocusNode();
bool isDataUploading = false;
FFUploadedFile uploadedLocalFile =
FFUploadedFile(bytes: Uint8List.fromList([]));
void debounce(Function() fn, Duration time) {
if (_debounceTimer != null) {
_debounceTimer!.cancel();
}
_debounceTimer = Timer(time, fn);
}
@override
void dispose() {
tabBarController.dispose();
}
@override
void initState(BuildContext context) {
// Se liga! Esse é o controller do TabBar
tabBarController = TabController(
vsync: Navigator.of(context),
length: 2,
);
}
}