add missing type annotations

This commit is contained in:
ggurdin 2026-02-05 13:06:58 -05:00
parent 0adb9e1f73
commit 90f547f897
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
19 changed files with 40 additions and 39 deletions

View file

@ -292,7 +292,7 @@ class _ReactionState extends State<_Reaction> with TickerProviderStateMixin {
_growController.reset();
}
_animateAndReact() async {
Future<void> _animateAndReact() async {
final bool? wasReacted = widget.reacted;
final bool wasSingle = (widget.count == 1);

View file

@ -60,7 +60,7 @@ class _ActivityMenuButtonState extends State<ActivityMenuButton> {
/// Show a tutorial overlay that blocks the screen and points
/// to the stats menu button with an explanation of what it does.
void _showStatsMenuDropdownInstructions(_) {
void _showStatsMenuDropdownInstructions(dynamic _) {
if (!mounted) return;
if (!widget.controller.shouldShowActivityInstructions) {
return;

View file

@ -161,8 +161,8 @@ class _LevelUpPopupContentState extends State<LevelUpPopupContent>
int get _startGrammar => LevelUpManager.instance.prevGrammar;
int get _startVocab => LevelUpManager.instance.prevVocab;
get _endGrammar => LevelUpManager.instance.nextGrammar;
get _endVocab => LevelUpManager.instance.nextVocab;
int get _endGrammar => LevelUpManager.instance.nextGrammar;
int get _endVocab => LevelUpManager.instance.nextVocab;
Future<void> _loadConstructSummary() async {
try {

View file

@ -60,7 +60,7 @@ class BotOptionsModel {
this.textAdventureGameMasterInstructions,
});
factory BotOptionsModel.fromJson(json) {
factory BotOptionsModel.fromJson(Map<String, dynamic> json) {
final genderEntry = json[ModelKey.targetGender];
Map<String, GenderEnum> targetGenders = {};
if (genderEntry is Map<String, dynamic>) {

View file

@ -15,7 +15,7 @@ enum AssistanceStateEnum {
complete,
error;
Color stateColor(context) {
Color stateColor(BuildContext context) {
switch (this) {
case AssistanceStateEnum.noSub:
case AssistanceStateEnum.noMessage:
@ -30,7 +30,7 @@ enum AssistanceStateEnum {
}
}
Color sendButtonColor(context) {
Color sendButtonColor(BuildContext context) {
switch (this) {
case AssistanceStateEnum.noMessage:
case AssistanceStateEnum.fetched:

View file

@ -161,7 +161,7 @@ class Choreographer extends ChangeNotifier {
super.dispose();
}
void onPaste(value) => _record.pastedStrings.add(value);
void onPaste(String value) => _record.pastedStrings.add(value);
void onClickSend() {
if (assistanceState == AssistanceStateEnum.fetched) {

View file

@ -21,7 +21,7 @@ class ITRequestModel {
required this.goldContinuances,
});
factory ITRequestModel.fromJson(json) => ITRequestModel(
factory ITRequestModel.fromJson(Map<String, dynamic> json) => ITRequestModel(
text: json[ModelKey.text],
customInput: json['custom_input'],
sourceLangCode: json[ModelKey.srcLang],

View file

@ -8,11 +8,11 @@ class BaseController<T> {
stateStream = _stateListener.stream.asBroadcastStream();
}
dispose() {
void dispose() {
_stateListener.close();
}
setState(T data) {
void setState(T data) {
_stateListener.add(data);
}
}

View file

@ -84,7 +84,7 @@ class Requests {
}
}
get _headers {
Map<String, String> get _headers {
final Map<String, String> headers = {
"Content-Type": "application/json",
"Accept": "application/json",

View file

@ -12,7 +12,8 @@ import 'package:fluffychat/utils/platform_infos.dart';
class PangeaWarningError implements Exception {
final String message;
PangeaWarningError(message) : message = "Pangea Warning Error: $message";
PangeaWarningError(String message)
: message = "Pangea Warning Error: $message";
@override
String toString() => message;
@ -55,7 +56,7 @@ class ErrorHandler {
};
}
static logError({
static Future<void> logError({
Object? e,
StackTrace? s,
String? m,

View file

@ -40,67 +40,67 @@ class GoogleAnalytics {
debugPrint(" Storage Bucket: ${app.options.storageBucket}");
}
static analyticsUserUpdate(String? userID) {
static void analyticsUserUpdate(String? userID) {
debugPrint("user update $userID");
analytics?.setUserId(id: userID);
}
static updateUserSubscriptionStatus(bool subscribed) {
static void updateUserSubscriptionStatus(bool subscribed) {
analytics?.setUserProperty(
name: 'subscribed',
value: "$subscribed",
);
}
static logEvent(String name, {parameters}) {
static void logEvent(String name, {parameters}) {
debugPrint("event: $name - parameters: $parameters");
analytics?.logEvent(name: name, parameters: parameters);
}
static login(String type, String? userID) {
static void login(String type, String? userID) {
logEvent('login', parameters: {'method': type});
analyticsUserUpdate(userID);
}
static signUp(String type) {
static void signUp(String type) {
logEvent('sign_up', parameters: {'method': type});
}
static logout() {
static void logout() {
logEvent('logout');
analyticsUserUpdate(null);
}
static createClass(String className, String classCode) {
static void createClass(String className, String classCode) {
logEvent(
'create_class',
parameters: {'name': className, 'group_id': classCode},
);
}
static createChat(String newChatRoomId) {
static void createChat(String newChatRoomId) {
logEvent('create_chat', parameters: {"chat_id": newChatRoomId});
}
static addParent(String chatRoomId, String classCode) {
static void addParent(String chatRoomId, String classCode) {
logEvent(
'add_room_to_class',
parameters: {"chat_id": chatRoomId, 'group_id': classCode},
);
}
static removeChatFromClass(String chatRoomId, String classCode) {
static void removeChatFromClass(String chatRoomId, String classCode) {
logEvent(
'remove_room_from_class',
parameters: {"chat_id": chatRoomId, 'group_id': classCode},
);
}
static joinClass(String classCode) {
static void joinClass(String classCode) {
logEvent('join_group', parameters: {'group_id': classCode});
}
static sendMessage(String chatRoomId, String classCode) {
static void sendMessage(String chatRoomId, String classCode) {
logEvent(
'sent_message',
parameters: {
@ -110,15 +110,15 @@ class GoogleAnalytics {
);
}
static contextualRequest() {
static void contextualRequest() {
logEvent('context_request');
}
static messageTranslate() {
static void messageTranslate() {
logEvent('message_translate');
}
static beginPurchaseSubscription(
static void beginPurchaseSubscription(
SubscriptionDetails details,
BuildContext context,
) {

View file

@ -120,7 +120,7 @@ class OverlayUtil {
}
}
static showPositionedCard({
static void showPositionedCard({
required BuildContext context,
required Widget cardToShow,
required String transformTargetId,

View file

@ -210,7 +210,7 @@ class CourseChatsController extends State<CourseChats>
}
}
Future<void> loadHierarchy({reload = false}) async {
Future<void> loadHierarchy({bool reload = false}) async {
final room = widget.client.getRoomById(widget.roomId);
if (room == null) return;

View file

@ -11,7 +11,7 @@ class ContentFeedback<T extends JsonSerializable> {
ContentFeedback(this.content, this.feedback);
toJson() {
Map<String, dynamic> toJson() {
return {
'content': content.toJson(),
'feedback': feedback,

View file

@ -25,7 +25,7 @@ class LanguageModel {
TextDirection? textDirection,
}) : _textDirection = textDirection;
factory LanguageModel.fromJson(json) {
factory LanguageModel.fromJson(Map<String, dynamic> json) {
final String code = json['language_code'] ??
codeFromNameOrCode(
json['language_name'],

View file

@ -34,7 +34,7 @@ class PLanguageStore {
)
.toList();
static Future<void> initialize({forceRefresh = false}) async {
static Future<void> initialize({bool forceRefresh = false}) async {
_langList = await _getCachedLanguages();
final isOutdated = await _shouldFetch;
final shouldFetch = forceRefresh ||
@ -111,7 +111,7 @@ class PLanguageStore {
}
class _MyShared {
static saveString(String key, String value) async {
static Future<void> saveString(String key, String value) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString(key, value);
}
@ -122,7 +122,7 @@ class _MyShared {
return source;
}
static saveJson(String key, Map value) async {
static Future<void> saveJson(String key, Map value) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString(key, json.encode(value));
}

View file

@ -135,7 +135,7 @@ class SignupPageController extends State<SignupPage> {
String? signupError;
void signup([_]) async {
void signup([dynamic _]) async {
setState(() => signupError = null);
final valid = formKey.currentState!.validate();
if (!valid) return;

View file

@ -125,7 +125,7 @@ class AvailableSubscriptionsInfo {
);
}
Map<String, dynamic> toJson({validate = true}) {
Map<String, dynamic> toJson({bool validate = true}) {
if (validate && (appIds == null || allProducts == null)) {
throw "appIds or allProducts is null in AvailableSubscriptionsInfo";
}

View file

@ -339,7 +339,7 @@ class Profile {
/// If [waitForDataInSync] is true, the function will wait for the updated account
/// data to come through in a sync, indicating that it has been set on the matrix server.
Future<void> saveProfileData({
waitForDataInSync = false,
bool waitForDataInSync = false,
}) async {
final PangeaController pangeaController = MatrixState.pangeaController;
final Client client = pangeaController.matrixState.client;