自从我问这个问题以来,扩展方法已经在Dart中发布了。我现在将实现选项1作为扩展方法:
extension DateonlyCompare on DateTime { bool isSameDate(DateTime other) { return this.year == other.year && this.month == other.month&& this.day == other.day; }}
自从我问这个问题以来,扩展方法已经在Dart中发布了。我现在将实现选项1作为扩展方法:
extension DateonlyCompare on DateTime { bool isSameDate(DateTime other) { return this.year == other.year && this.month == other.month&& this.day == other.day; }}