-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: rename UserTile to UserPreview * refactor: add a widget to display account info * feat: do not remove tabs when sign out * refactor: add showErrorMessageDialog * refactor: make bottom ads rounded * fix: do not save draft if guest * feat: edit Play * feat: support clickable mfm * feat: play Play * feat: backup aiscript storage * ci: install rust
- Loading branch information
1 parent
320a940
commit 09f3688
Showing
121 changed files
with
24,536 additions
and
198 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rust_input: rust/src/api/**/*.rs | ||
dart_output: lib/rust |
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
import '../model/account.dart'; | ||
import 'shared_preferences_provider.dart'; | ||
|
||
part 'aiscript_storage_notifier_provider.g.dart'; | ||
|
||
@riverpod | ||
class AiscriptStorageNotifier extends _$AiscriptStorageNotifier { | ||
@override | ||
Map<String, String> build(Account account) { | ||
final value = ref.watch(sharedPreferencesProvider).getString(_key); | ||
if (value != null) { | ||
final json = jsonDecode(value); | ||
if (json is Map<String, dynamic>) { | ||
return json.map((key, value) => MapEntry(key, value.toString())); | ||
} | ||
} | ||
return {}; | ||
} | ||
|
||
String get _key => '$account/aiscript'; | ||
|
||
Future<void> save(String key, String value) async { | ||
state = { | ||
...state, | ||
key: value, | ||
}; | ||
await ref | ||
.read(sharedPreferencesProvider) | ||
.setString(_key, jsonEncode(state)); | ||
} | ||
|
||
String? load(String key) { | ||
return state[key]; | ||
} | ||
|
||
Future<void> import(Map<String, String> storage) async { | ||
state = storage; | ||
await ref | ||
.read(sharedPreferencesProvider) | ||
.setString(_key, jsonEncode(state)); | ||
} | ||
} |
Oops, something went wrong.