Skip to content

Commit

Permalink
Ignore unfixed lints for now and reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Leptopoda committed Oct 6, 2022
1 parent 5eb3808 commit 6b62df0
Show file tree
Hide file tree
Showing 22 changed files with 205 additions and 168 deletions.
30 changes: 17 additions & 13 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# For apps, use the default set
include: package:lint/analysis_options.yaml

# Packages, that may be distributed (i.e. via pub.dev) should use the package
# version, resulting in a better pub score.
# include: package:lint/analysis_options_package.yaml

# You might want to exclude auto-generated files from dart analysis
analyzer:
exclude:
Expand All @@ -16,12 +12,20 @@ analyzer:
# can be found at https://dart-lang.github.io/linter/lints/options/options.html
linter:
rules:
# Util classes are awesome!
# avoid_classes_with_only_static_members: false

# Make constructors the first thing in every class
# sort_constructors_first: true

# Choose wisely, but you don't have to
# prefer_double_quotes: true
# prefer_single_quotes: true
avoid_classes_with_only_static_members: false
avoid_print: false
constant_identifier_names: false
avoid_positional_boolean_parameters: false
join_return_with_assignment: false
type_annotate_public_apis: false
avoid_dynamic_calls: false
no_leading_underscores_for_local_identifiers: false
use_setters_to_change_properties: false
empty_catches: false
use_build_context_synchronously: false
parameter_assignments: false
avoid_catching_errors: false
no_logic_in_create_state: false
noop_primitive_operations: false
leading_newlines_in_multiline_strings: false
depend_on_referenced_packages: false
8 changes: 5 additions & 3 deletions lib/common/ui/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ class ColorPalettes {

return themeData.copyWith(
snackBarTheme: themeData.snackBarTheme.copyWith(
backgroundColor: isDark ? const Color(0xff363635) : const Color(0xfffafafa),
backgroundColor:
isDark ? const Color(0xff363635) : const Color(0xfffafafa),
contentTextStyle: themeData.textTheme.bodyText1.copyWith(
color:
isDark ? const Color(0xffe4e4e4) : themeData.textTheme.bodyText1.color,
color: isDark
? const Color(0xffe4e4e4)
: themeData.textTheme.bodyText1.color,
),
),
textButtonTheme: TextButtonThemeData(
Expand Down
3 changes: 1 addition & 2 deletions lib/common/ui/custom_icons_icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ class CustomIcons {

static const _kFontFam = 'CustomIcons';

static const IconData logout =
IconData(0xe800, fontFamily: _kFontFam);
static const IconData logout = IconData(0xe800, fontFamily: _kFontFam);
}
4 changes: 1 addition & 3 deletions lib/common/util/date_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ DateTime toStartOfDay(DateTime dateTime) {
}

DateTime toStartOfMonth(DateTime dateTime) {
return dateTime == null
? null
: DateTime(dateTime.year, dateTime.month);
return dateTime == null ? null : DateTime(dateTime.year, dateTime.month);
}

DateTime tomorrow(DateTime dateTime) {
Expand Down
3 changes: 2 additions & 1 deletion lib/date_management/data/calendar_access.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class CalendarAccess {
String _getIdOfExistingEvent(List<Event> existingEvents, DateEntry entry) {
final existingEvent = existingEvents
.where(
(element) => element.title == entry.description &&
(element) =>
element.title == entry.description &&
element.start.toUtc().isAtSameMomentAs(entry.start.toUtc()),
)
.toList();
Expand Down
6 changes: 3 additions & 3 deletions lib/date_management/ui/date_management_navigation_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class DateManagementNavigationEntry extends NavigationEntry {
@override
BaseViewModel initViewModel() {
_viewModel ??= DateManagementViewModel(
KiwiContainer().resolve(),
KiwiContainer().resolve(),
);
KiwiContainer().resolve(),
KiwiContainer().resolve(),
);

return _viewModel;
}
Expand Down
17 changes: 10 additions & 7 deletions lib/date_management/ui/date_management_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,16 @@ class DateManagementPage extends StatelessWidget {
),
// When the date entry has a time of 00:00 don't show it.
// It means the date entry is for the whole day
if (isAtMidnight(dateEntry.start)) Container() else Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 0, 0),
child: Text(
DateFormat.Hm(L.of(context).locale.languageCode)
.format(dateEntry.start),
),
),
if (isAtMidnight(dateEntry.start))
Container()
else
Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 0, 0),
child: Text(
DateFormat.Hm(L.of(context).locale.languageCode)
.format(dateEntry.start),
),
),
],
),
onTap: () {
Expand Down
11 changes: 7 additions & 4 deletions lib/date_management/ui/widgets/date_detail_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ class DateDetailBottomSheet extends StatelessWidget {
softWrap: true,
style: Theme.of(context).textTheme.subtitle2,
),
if (isAtMidnight(dateEntry.start)) Container() else Text(
time,
softWrap: true,
),
if (isAtMidnight(dateEntry.start))
Container()
else
Text(
time,
softWrap: true,
),
],
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/dualis/ui/dualis_navigation_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class DualisNavigationEntry extends NavigationEntry {
@override
BaseViewModel initViewModel() {
_viewModel ??= StudyGradesViewModel(
KiwiContainer().resolve(),
KiwiContainer().resolve(),
);
KiwiContainer().resolve(),
KiwiContainer().resolve(),
);

return _viewModel;
}
Expand Down
11 changes: 7 additions & 4 deletions lib/dualis/ui/widgets/login_form_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ class _LoginFormState extends State<LoginForm> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (_title != null) Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 24),
child: _title,
) else Container(),
if (_title != null)
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 24),
child: _title,
)
else
Container(),
TextField(
controller: _usernameEditingController,
decoration: InputDecoration(
Expand Down
3 changes: 1 addition & 2 deletions lib/native/widget/android_widget_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import 'package:flutter/services.dart';
/// WidgetHelper which calls native code to control the widget on android
///
class AndroidWidgetHelper implements WidgetHelper {
static const platform =
MethodChannel('de.bennik2000.dhbwstudentapp/widget');
static const platform = MethodChannel('de.bennik2000.dhbwstudentapp/widget');

@override
Future<void> disableWidget() async {
Expand Down
3 changes: 1 addition & 2 deletions lib/native/widget/ios_widget_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'package:flutter_widgetkit/flutter_widgetkit.dart';
/// WidgetHelper which calls native code to control the widget on iOS
///
class IOSWidgetHelper implements WidgetHelper {
static const platform =
MethodChannel('de.bennik2000.dhbwstudentapp/widget');
static const platform = MethodChannel('de.bennik2000.dhbwstudentapp/widget');

@override
Future<void> disableWidget() async {
Expand Down
22 changes: 11 additions & 11 deletions lib/schedule/background/calendar_synchronizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ class CalendarSynchronizer {
final List<DateEntry> listDateEntries =
List<DateEntry>.empty(growable: true);
for (final element in schedule.entries) {
final DateEntry date = DateEntry(
room: element.room,
comment: element.details,
databaseName: 'DHBW',
description: element.title,
year: element.start.year.toString(),
start: element.start,
end: element.end,
);
listDateEntries.add(date);
}
final DateEntry date = DateEntry(
room: element.room,
comment: element.details,
databaseName: 'DHBW',
description: element.title,
year: element.start.year.toString(),
start: element.start,
end: element.end,
);
listDateEntries.add(date);
}
KiwiContainer().resolve<ListDateEntries30d>().listDateEntries =
listDateEntries;

Expand Down
3 changes: 2 additions & 1 deletion lib/schedule/business/schedule_source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class ScheduleSourceProvider {

ScheduleSource get currentScheduleSource => _currentScheduleSource;

final List<OnDidChangeScheduleSource> _onDidChangeScheduleSourceCallbacks = [];
final List<OnDidChangeScheduleSource> _onDidChangeScheduleSourceCallbacks =
[];

ScheduleSourceProvider(
this._preferencesProvider,
Expand Down
6 changes: 3 additions & 3 deletions lib/schedule/service/rapla/rapla_parsing_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ class RaplaParsingUtils {
resourcesList.add(resource.innerHtml);
}

final buffer = StringBuffer();
buffer.writeAll(resourcesList, ", ");
final buffer = StringBuffer();
buffer.writeAll(resourcesList, ", ");

return buffer.toString();
return buffer.toString();
}

static String readYearOrThrow(Document document) {
Expand Down
60 changes: 31 additions & 29 deletions lib/schedule/ui/dailyschedule/daily_schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,41 @@ class _DailySchedulePageState extends State<DailySchedulePage> {
},
),
),
if ((viewModel.daySchedule?.entries?.length ?? 0) == 0) Padding(
padding: const EdgeInsets.fromLTRB(0, 32, 0, 0),
child: Column(
if ((viewModel.daySchedule?.entries?.length ?? 0) == 0)
Padding(
padding: const EdgeInsets.fromLTRB(0, 32, 0, 0),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: Container()),
Expanded(
flex: 8,
child: Text(
L.of(context).dailyScheduleNoEntriesToday,
softWrap: true,
textAlign: TextAlign.center,
style:
textStyleDailyScheduleNoEntries(context),
),
),
Expanded(child: Container()),
],
),
Padding(
padding: const EdgeInsets.fromLTRB(32, 64, 32, 32),
child: Opacity(
opacity: 0.9,
child: Image.asset("assets/empty_state.png"),
Expanded(child: Container()),
Expanded(
flex: 8,
child: Text(
L.of(context).dailyScheduleNoEntriesToday,
softWrap: true,
textAlign: TextAlign.center,
style: textStyleDailyScheduleNoEntries(context),
),
)
),
Expanded(child: Container()),
],
),
) else Column(
children: buildEntryWidgets(),
)
Padding(
padding: const EdgeInsets.fromLTRB(32, 64, 32, 32),
child: Opacity(
opacity: 0.9,
child: Image.asset("assets/empty_state.png"),
),
)
],
),
)
else
Column(
children: buildEntryWidgets(),
)
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,27 @@ class ScheduleEntryDetailBottomSheet extends StatelessWidget {
],
),
),
if (scheduleEntry.room?.isEmpty ?? true) Container() else Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
child: Text(scheduleEntry.room.replaceAll(",", "\n")),
),
if (scheduleEntry.details?.isEmpty ?? true) Container() else Padding(
padding: const EdgeInsets.fromLTRB(0, 16, 0, 16),
child: Container(
color: colorSeparator(),
height: 1,
),
),
if (scheduleEntry.details?.isEmpty ?? true) Container() else Text(scheduleEntry.details),
if (scheduleEntry.room?.isEmpty ?? true)
Container()
else
Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
child: Text(scheduleEntry.room.replaceAll(",", "\n")),
),
if (scheduleEntry.details?.isEmpty ?? true)
Container()
else
Padding(
padding: const EdgeInsets.fromLTRB(0, 16, 0, 16),
child: Container(
color: colorSeparator(),
height: 1,
),
),
if (scheduleEntry.details?.isEmpty ?? true)
Container()
else
Text(scheduleEntry.details),
],
),
),
Expand Down
6 changes: 4 additions & 2 deletions lib/schedule/ui/weeklyschedule/widgets/schedule_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class ScheduleWidget extends StatelessWidget {
colorScheduleGridGridLines(context),
),
Padding(
padding: const EdgeInsets.fromLTRB(timeLabelsWidth, dayLabelsHeight, 0, 0),
padding:
const EdgeInsets.fromLTRB(timeLabelsWidth, dayLabelsHeight, 0, 0),
child: Stack(
children: entryWidgets,
),
Expand All @@ -97,7 +98,8 @@ class ScheduleWidget extends StatelessWidget {
children: labelWidgets,
),
Padding(
padding: const EdgeInsets.fromLTRB(timeLabelsWidth, dayLabelsHeight, 0, 0),
padding:
const EdgeInsets.fromLTRB(timeLabelsWidth, dayLabelsHeight, 0, 0),
child: SchedulePastOverlay(
displayStartHour,
displayEndHour,
Expand Down
Loading

0 comments on commit 6b62df0

Please sign in to comment.