updated project style guidelines
This commit is contained in:
analysis_options.yamloverhang.dart
lib
api
apiError.dartapiParams.dartapiRequest.dartapiResponse.dartmhslApi.dartrequestCache.dart
app.dartholidays
marianumcloud
autocomplete
files-sharing
talk
chat
createRoom
deleteMessage
deleteReactMessage
getParticipants
getReactions
leaveRoom
reactMessage
room
sendMessage
setFavorite
setReadMarker
talkApi.darttalkError.dartwebdav
mhsl
breaker
customTimetableEvent
add
customTimetableEvent.dartget
getCustomTimetableEvent.dartgetCustomTimetableEventCache.dartgetCustomTimetableEventParams.dartgetCustomTimetableEventResponse.dart
remove
update
message
getMessages
notify
server
feedback
userIndex
webuntis
extensions
main.dartmodel
accountData.dartaccountModel.dart
breakers
chatList
dataCleaner.dartdataHolder.dartendpointData.dartfiles
holidays
message
timetable
notification
storage
base
devTools
file
fileView
gradeAverages
holidays
notification
talk
timetable
theming
view
login
pages
files
more
feedback
holidays
message
roomplan
share
talk
chatDetails
chatList.dartchatView.dartcomponents
joinChat.dartmessageReactions.dartsearchChat.darttalkNavigator.darttimetable
settings
widget
@ -1,30 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension IsSameDay on DateTime {
|
||||
bool isSameDay(DateTime other) {
|
||||
return year == other.year && month == other.month && day == other.day;
|
||||
}
|
||||
bool isSameDay(DateTime other) => year == other.year && month == other.month && day == other.day;
|
||||
|
||||
DateTime nextWeekday(int day) {
|
||||
return add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
|
||||
}
|
||||
DateTime nextWeekday(int day) => add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
|
||||
|
||||
DateTime withTime(TimeOfDay time) {
|
||||
return copyWith(hour: time.hour, minute: time.minute);
|
||||
}
|
||||
DateTime withTime(TimeOfDay time) => copyWith(hour: time.hour, minute: time.minute);
|
||||
|
||||
TimeOfDay toTimeOfDay() {
|
||||
return TimeOfDay(hour: hour, minute: minute);
|
||||
}
|
||||
TimeOfDay toTimeOfDay() => TimeOfDay(hour: hour, minute: minute);
|
||||
|
||||
bool isSameDateTime(DateTime other) {
|
||||
bool isSameDay = this.isSameDay(other);
|
||||
bool isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
|
||||
var isSameDay = this.isSameDay(other);
|
||||
var isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
|
||||
|
||||
return isSameDay && isSameTimeOfDay;
|
||||
}
|
||||
|
||||
bool isSameOrAfter(DateTime other) {
|
||||
return isSameDateTime(other) || isAfter(other);
|
||||
}
|
||||
}
|
||||
bool isSameOrAfter(DateTime other) => isSameDateTime(other) || isAfter(other);
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
extension RenderNotNullExt<T> on T? {
|
||||
R? wrapNullable<R>(R Function(T data) defaultValueCallback) {
|
||||
return this != null ? defaultValueCallback(this as T) : null;
|
||||
}
|
||||
}
|
||||
R? wrapNullable<R>(R Function(T data) defaultValueCallback) => this != null ? defaultValueCallback(this as T) : null;
|
||||
}
|
||||
|
@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
|
||||
|
||||
extension TextExt on Text {
|
||||
Size get size {
|
||||
final TextPainter textPainter = TextPainter(
|
||||
final textPainter = TextPainter(
|
||||
text: TextSpan(text: data, style: style),
|
||||
maxLines: 1,
|
||||
textDirection: TextDirection.ltr
|
||||
)..layout(minWidth: 0, maxWidth: double.infinity);
|
||||
return textPainter.size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension TimeOfDayExt on TimeOfDay {
|
||||
bool isBefore(TimeOfDay other) {
|
||||
return hour < other.hour && minute < other.minute;
|
||||
}
|
||||
bool isBefore(TimeOfDay other) => hour < other.hour && minute < other.minute;
|
||||
|
||||
bool isAfter(TimeOfDay other) {
|
||||
return hour > other.hour && minute > other.minute;
|
||||
}
|
||||
bool isAfter(TimeOfDay other) => hour > other.hour && minute > other.minute;
|
||||
|
||||
TimeOfDay add({int hours = 0, int minutes = 0}) {
|
||||
return replacing(hour: hour + hours, minute: minute + minutes);
|
||||
}
|
||||
}
|
||||
TimeOfDay add({int hours = 0, int minutes = 0}) => replacing(hour: hour + hours, minute: minute + minutes);
|
||||
}
|
||||
|
Reference in New Issue
Block a user