Skip to content

Commit

Permalink
refactor: Omit local types
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Jul 4, 2024
1 parent e88afdd commit ef5ea57
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ linter:
- prefer_final_in_for_each
- sort_pub_dependencies
- require_trailing_commas
- omit_local_variable_types

analyzer:
errors:
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_emoji_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/event_info_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/input_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/send_file_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/chat_list/client_chooser_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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);
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ef5ea57

Please sign in to comment.