mirror of
https://github.com/krille-chan/fluffychat
synced 2024-07-13 05:34:04 +00:00
refactor: Omit local types
This commit is contained in:
parent
e88afdd357
commit
ef5ea57c58
|
@ -9,6 +9,7 @@ linter:
|
|||
- prefer_final_in_for_each
|
||||
- sort_pub_dependencies
|
||||
- require_trailing_commas
|
||||
- omit_local_variable_types
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
|
|
|
@ -14,7 +14,7 @@ class ChatEmojiPicker extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final theme = Theme.of(context);
|
||||
return AnimatedContainer(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
|
|
|
@ -28,8 +28,8 @@ class EventInfoDialog extends StatelessWidget {
|
|||
});
|
||||
|
||||
String get prettyJson {
|
||||
const JsonDecoder decoder = JsonDecoder();
|
||||
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
|
||||
const decoder = JsonDecoder();
|
||||
const encoder = JsonEncoder.withIndent(' ');
|
||||
final object = decoder.convert(jsonEncode(event.toJson()));
|
||||
return encoder.convert(object);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class InputBar extends StatelessWidget {
|
|||
}
|
||||
final searchText =
|
||||
controller!.text.substring(0, controller!.selection.baseOffset);
|
||||
final List<Map<String, String?>> ret = <Map<String, String?>>[];
|
||||
final ret = <Map<String, String?>>[];
|
||||
const maxResults = 30;
|
||||
|
||||
final commandMatch = RegExp(r'^/(\w*)$').firstMatch(searchText);
|
||||
|
|
|
@ -64,7 +64,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var sendStr = L10n.of(context)!.sendFile;
|
||||
final bool allFilesAreImages =
|
||||
final allFilesAreImages =
|
||||
widget.files.every((file) => file is MatrixImageFile);
|
||||
final sizeString = widget.files
|
||||
.fold<double>(0, (p, file) => p + file.bytes.length)
|
||||
|
|
|
@ -165,7 +165,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final matrix = Matrix.of(context);
|
||||
|
||||
int clientCount = 0;
|
||||
var clientCount = 0;
|
||||
matrix.accountBundles.forEach((key, value) => clientCount += value.length);
|
||||
return FutureBuilder<Profile>(
|
||||
future: matrix.client.fetchOwnProfile(),
|
||||
|
@ -292,7 +292,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
);
|
||||
// beginning from end if negative
|
||||
if (index < 0) {
|
||||
int clientCount = 0;
|
||||
var clientCount = 0;
|
||||
matrix.accountBundles
|
||||
.forEach((key, value) => clientCount += value.length);
|
||||
_handleKeyboardShortcut(matrix, clientCount, context);
|
||||
|
@ -312,7 +312,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
}
|
||||
|
||||
int? _shortcutIndexOfClient(MatrixState matrix, Client client) {
|
||||
int index = 0;
|
||||
var index = 0;
|
||||
|
||||
final bundles = matrix.accountBundles.keys.toList()
|
||||
..sort(
|
||||
|
|
|
@ -82,7 +82,7 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||
}
|
||||
|
||||
static Future<String> findDatabasePath(Client client) async {
|
||||
String path = client.clientName;
|
||||
var path = client.clientName;
|
||||
if (!kIsWeb) {
|
||||
Directory directory;
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue