1 line
2.0 KiB
JSON
1 line
2.0 KiB
JSON
{"repo": "banana-hu/ai-automatic-schedule-planning", "files": {"lib/app_state.dart": {"3dce1e8537a9480e644a386faa85e57c1047fcf6": {"t": 1785745908.3016407, "n": 833, "h": "056611ef0978672b", "c": "import 'package:flutter/material.dart';\nimport 'data/event_repo.dart';\nimport 'package:shared_preferences/shared_preferences.dart';\n\nconst _keyApiKey = 'deepseek_api_key';\n\nclass AppState extends InheritedWidget {\n const AppState({\n super.key,\n required this.repo,\n required this.prefs,\n required super.child,\n });\n\n final EventRepo repo;\n final SharedPreferences prefs;\n\n static AppState of(BuildContext context) {\n final state = context.dependOnInheritedWidgetOfExactType<AppState>();\n assert(state != null, 'AppState not found');\n return state!;\n }\n\n String? get apiKey => prefs.getString(_keyApiKey);\n Future<void> setApiKey(String value) => prefs.setString(_keyApiKey, value);\n\n @override\n bool updateShouldNotify(AppState oldWidget) =>\n repo != oldWidget.repo || prefs != oldWidget.prefs;\n}\n"}, "06f6d1822fdc9fa84185635a26dd7d9adf0686ca": {"t": 1785757821.4495785, "n": 833, "h": "056611ef0978672b", "c": "import 'package:flutter/material.dart';\nimport 'data/event_repo.dart';\nimport 'package:shared_preferences/shared_preferences.dart';\n\nconst _keyApiKey = 'deepseek_api_key';\n\nclass AppState extends InheritedWidget {\n const AppState({\n super.key,\n required this.repo,\n required this.prefs,\n required super.child,\n });\n\n final EventRepo repo;\n final SharedPreferences prefs;\n\n static AppState of(BuildContext context) {\n final state = context.dependOnInheritedWidgetOfExactType<AppState>();\n assert(state != null, 'AppState not found');\n return state!;\n }\n\n String? get apiKey => prefs.getString(_keyApiKey);\n Future<void> setApiKey(String value) => prefs.setString(_keyApiKey, value);\n\n @override\n bool updateShouldNotify(AppState oldWidget) =>\n repo != oldWidget.repo || prefs != oldWidget.prefs;\n}\n"}}}} |