copyWithTimeFragment method

Locations copyWithTimeFragment(
  1. TimeFragment? fragment
)

Implementation

Locations copyWithTimeFragment(final TimeFragment? fragment) {
  final newFragments = [
    ...fragments.where((final e) => TimeFragment.fromFragment(e) == null),
    if (fragment != null) fragment.fragment,
  ];

  return copyWith(fragments: newFragments.isEmpty ? null : newFragments);
}