Skip to content

Commit 0dba166

Browse files
gnpricechrisbobbe
authored andcommitted
dart [nfc]: Specify return types on all methods
This commit covers only where the type is totally boring from the function's definition: it's the thing that the autofix would insert, or else it's void and the autofix should insert void. (But there seems to be a bug where the autofix doesn't work if the answer should be void.)
1 parent 62fefe8 commit 0dba166

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

lib/widgets/text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import 'package:flutter/material.dart';
3939
Typography zulipTypography(BuildContext context) {
4040
final typography = Theme.of(context).typography;
4141

42-
convertGeometry(TextTheme inputTextTheme) {
42+
TextTheme convertGeometry(TextTheme inputTextTheme) {
4343
TextTheme result = _weightVariableTextTheme(context, inputTextTheme);
4444

4545
result = _convertTextTheme(result, (maybeInputStyle, _) =>

test/model/autocomplete_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void main() {
6666
///
6767
/// For example, "~@chris^" means the text is "@chris", the selection is
6868
/// collapsed at index 6, and we expect the syntax to start at index 0.
69-
doTest(String markedText, MentionAutocompleteQuery? expectedQuery) {
69+
void doTest(String markedText, MentionAutocompleteQuery? expectedQuery) {
7070
final description = expectedQuery != null
7171
? 'in ${jsonEncode(markedText)}, query ${jsonEncode(expectedQuery.raw)}'
7272
: 'no query in ${jsonEncode(markedText)}';
@@ -311,7 +311,7 @@ void main() {
311311
});
312312

313313
group('MentionAutocompleteQuery.testUser', () {
314-
doCheck(String rawQuery, User user, bool expected) {
314+
void doCheck(String rawQuery, User user, bool expected) {
315315
final result = MentionAutocompleteQuery(rawQuery)
316316
.testUser(user, AutocompleteDataCache());
317317
expected ? check(result).isTrue() : check(result).isFalse();

test/model/recent_dm_conversations_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141
});
4242

4343
group('message event (new message)', () {
44-
setupView() {
44+
RecentDmConversationsView setupView() {
4545
return RecentDmConversationsView(selfUserId: eg.selfUser.userId,
4646
initial: [
4747
RecentDmConversation(userIds: [1], maxMessageId: 200),

test/widgets/compose_box_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main() {
4545
group('insertPadded', () {
4646
// Like `parseMarkedText` in test/model/autocomplete_test.dart,
4747
// but a bit different -- could maybe deduplicate some.
48-
parseMarkedText(String markedText) {
48+
TextEditingValue parseMarkedText(String markedText) {
4949
final textBuffer = StringBuffer();
5050
int? insertionPoint;
5151
int i = 0;
@@ -70,7 +70,7 @@ void main() {
7070
///
7171
/// In valueBefore, represent the insertion point as "^".
7272
/// In expectedValue, represent the collapsed selection as "^".
73-
testInsertPadded(String description, String valueBefore, String textToInsert, String expectedValue) {
73+
void testInsertPadded(String description, String valueBefore, String textToInsert, String expectedValue) {
7474
test(description, () {
7575
final controller = ComposeContentController();
7676
controller.value = parseMarkedText(valueBefore);

test/widgets/login_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
group('ServerUrlTextEditingController.tryParse', () {
2828
final controller = ServerUrlTextEditingController();
2929

30-
expectUrlFromText(String text, String expectedUrl) {
30+
void expectUrlFromText(String text, String expectedUrl) {
3131
test('text "$text" gives URL "$expectedUrl"', () {
3232
controller.text = text;
3333
final result = controller.tryParse();
@@ -36,7 +36,7 @@ void main() {
3636
});
3737
}
3838

39-
expectErrorFromText(String text, ServerUrlValidationError expectedError) {
39+
void expectErrorFromText(String text, ServerUrlValidationError expectedError) {
4040
test('text "$text" gives error "$expectedError"', () {
4141
controller.text = text;
4242
final result = controller.tryParse();

test/widgets/text_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void main() {
307307
});
308308

309309
test('wghtFromTextStyle', () {
310-
doCheck(TextStyle style, double? expected) {
310+
void doCheck(TextStyle style, double? expected) {
311311
check(wghtFromTextStyle(style)).equals(expected);
312312
}
313313

0 commit comments

Comments
 (0)