Skip to content

Commit

Permalink
refactor: Dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Mar 19, 2024
1 parent 1a727f2 commit ace81ea
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 63 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:wrestling_scoreboard_client/platform/html.dart' if (dart.library.html) 'dart:html';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:window_manager/window_manager.dart';
import 'package:wrestling_scoreboard_client/platform/html.dart' if (dart.library.html) 'dart:html';
import 'package:wrestling_scoreboard_client/view/utils.dart';

part 'app_state_provider.g.dart';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart';
import 'package:printing/printing.dart';
import 'package:wrestling_scoreboard_client/localization/duration.dart';
import 'package:wrestling_scoreboard_client/view/screens/display/bout/bout_display.dart';
import 'package:wrestling_scoreboard_client/localization/date_time.dart';
import 'package:wrestling_scoreboard_client/localization/duration.dart';
import 'package:wrestling_scoreboard_client/services/print/pdf/components.dart';
import 'package:wrestling_scoreboard_client/view/screens/display/bout/bout_display.dart';
import 'package:wrestling_scoreboard_common/common.dart';

// TODO: Replace boutState with individual dataTypes or introduce model.
Expand Down Expand Up @@ -148,10 +148,10 @@ class ScoreSheet {
referee = wrestlingEvent.referee;
judge = wrestlingEvent.judge;
} else if (wrestlingEvent is Competition) {
// TODO: get referees from bout
// matChairman = bout.matChairman;
// referee = bout.referee;
// judge = bout.judge;
// TODO: get referees from bout
// matChairman = bout.matChairman;
// referee = bout.referee;
// judge = bout.judge;
}
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:wrestling_scoreboard_client/view/widgets/scaled_text.dart';
import 'package:wrestling_scoreboard_client/view/screens/display/bout/bout_shortcuts.dart';
import 'package:wrestling_scoreboard_client/view/widgets/scaled_text.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class BoutActionControls extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wrestling_scoreboard_client/view/shortcuts/app_shortcuts.dart';
import 'package:wrestling_scoreboard_client/view/widgets/scaled_text.dart';
import 'package:wrestling_scoreboard_client/view/widgets/themed.dart';
import 'package:wrestling_scoreboard_client/view/shortcuts/app_shortcuts.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class CommonElements {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ class DevisionEditState extends BoutConfigEditState<DivisionEdit> {
border: const UnderlineInputBorder(),
labelText: localizations.startDate,
),
onTap: () =>
showDatePicker(
initialDatePickerMode: DatePickerMode.year,
context: context,
initialDate: _startDate,
firstDate: DateTime.now().subtract(const Duration(days: 365 * 5)),
lastDate: DateTime.now().add(const Duration(days: 365 * 3)),
).then((value) {
if (value != null) {
setState(() => _startDate = value);
}
}),
onTap: () => showDatePicker(
initialDatePickerMode: DatePickerMode.year,
context: context,
initialDate: _startDate,
firstDate: DateTime.now().subtract(const Duration(days: 365 * 5)),
lastDate: DateTime.now().add(const Duration(days: 365 * 3)),
).then((value) {
if (value != null) {
setState(() => _startDate = value);
}
}),
initialValue: _startDate.toDateString(context),
),
),
Expand All @@ -97,18 +96,17 @@ class DevisionEditState extends BoutConfigEditState<DivisionEdit> {
border: const UnderlineInputBorder(),
labelText: localizations.endDate,
),
onTap: () =>
showDatePicker(
initialDatePickerMode: DatePickerMode.year,
context: context,
initialDate: _endDate,
firstDate: DateTime.now().subtract(const Duration(days: 365 * 5)),
lastDate: DateTime.now().add(const Duration(days: 365 * 3)),
).then((value) {
if (value != null) {
setState(() => _endDate = value);
}
}),
onTap: () => showDatePicker(
initialDatePickerMode: DatePickerMode.year,
context: context,
initialDate: _endDate,
firstDate: DateTime.now().subtract(const Duration(days: 365 * 5)),
lastDate: DateTime.now().add(const Duration(days: 365 * 3)),
).then((value) {
if (value != null) {
setState(() => _endDate = value);
}
}),
initialValue: _endDate.toDateString(context),
),
),
Expand All @@ -134,18 +132,17 @@ class DevisionEditState extends BoutConfigEditState<DivisionEdit> {
selectedItem: _organization,
label: localizations.organization,
context: context,
onSaved: (Organization? value) =>
setState(() {
_organization = value;
}),
onSaved: (Organization? value) => setState(() {
_organization = value;
}),
allowEmpty: false,
itemAsString: (u) => u.name,
onFind: (String? filter) async {
_availableOrganizations ??=
await (await ref.read(dataManagerNotifierProvider)).readMany<Organization, Null>();
await (await ref.read(dataManagerNotifierProvider)).readMany<Organization, Null>();
return (filter == null
? _availableOrganizations!
: _availableOrganizations!.where((element) => element.name.contains(filter)))
? _availableOrganizations!
: _availableOrganizations!.where((element) => element.name.contains(filter)))
.toList();
},
),
Expand All @@ -156,17 +153,15 @@ class DevisionEditState extends BoutConfigEditState<DivisionEdit> {
selectedItem: _parentDivision,
label: localizations.division,
context: context,
onSaved: (Division? value) =>
setState(() {
_parentDivision = value;
}),
onSaved: (Division? value) => setState(() {
_parentDivision = value;
}),
itemAsString: (u) => u.fullname,
onFind: (String? filter) async {
_availableDivisions ??=
await (await ref.read(dataManagerNotifierProvider)).readMany<Division, Null>();
_availableDivisions ??= await (await ref.read(dataManagerNotifierProvider)).readMany<Division, Null>();
return (filter == null
? _availableDivisions!
: _availableDivisions!.where((element) => element.fullname.contains(filter)))
? _availableDivisions!
: _availableDivisions!.where((element) => element.fullname.contains(filter)))
.toList();
},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:go_router/go_router.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/team_match/league_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/team_match/league_overview.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/widgets/responsive_container.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/team_match/league_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/team_match/league_overview.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class LeaguesView extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:wrestling_scoreboard_client/view/widgets/responsive_container.dart';
import 'package:wrestling_scoreboard_client/view/screens/more/about.dart';
import 'package:wrestling_scoreboard_client/view/screens/more/imprint.dart';
import 'package:wrestling_scoreboard_client/view/screens/more/settings/settings.dart';
import 'package:wrestling_scoreboard_client/view/widgets/responsive_container.dart';

class MoreScreen extends StatelessWidget {
const MoreScreen({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/widgets/info.dart';
import 'package:wrestling_scoreboard_client/localization/gender.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/club_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/membership_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/team_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/common.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/membership_overview.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/team_overview.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/widgets/info.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class ClubOverview extends ConsumerWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/membership_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/person_overview.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class MembershipOverview extends PersonOverview {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/team_match/team_match_bout_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/bout_overview.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class TeamMatchBoutOverview extends BoutOverview {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/widgets/info.dart';
import 'package:wrestling_scoreboard_client/view/screens/edit/team_edit.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/common.dart';
import 'package:wrestling_scoreboard_client/view/screens/overview/shared/matches_widget.dart';
import 'package:wrestling_scoreboard_client/view/widgets/consumer.dart';
import 'package:wrestling_scoreboard_client/view/widgets/grouped_list.dart';
import 'package:wrestling_scoreboard_client/view/widgets/info.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class TeamOverview<T extends DataObject> extends ConsumerWidget {
Expand Down
2 changes: 1 addition & 1 deletion wrestling_scoreboard_client/lib/view/widgets/consumer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wrestling_scoreboard_client/provider/data_provider.dart';
import 'package:wrestling_scoreboard_client/provider/network_provider.dart';
import 'package:wrestling_scoreboard_client/services/network/remote/web_socket.dart';
import 'package:wrestling_scoreboard_client/view/widgets/exception.dart';
import 'package:wrestling_scoreboard_client/view/widgets/loading_builder.dart';
import 'package:wrestling_scoreboard_client/services/network/remote/web_socket.dart';
import 'package:wrestling_scoreboard_common/common.dart';

class NullableSingleConsumer<T extends DataObject> extends ConsumerWidget {
Expand Down

0 comments on commit ace81ea

Please sign in to comment.