char limit formatter
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -29,6 +31,11 @@ extension StringFormatUtils on String {
|
||||
var document = parse(htmlString);
|
||||
return document.body?.text.trim() ?? "";
|
||||
}
|
||||
|
||||
String limit(int max) {
|
||||
if (length <= max) return this;
|
||||
return '${substring(0, min(length, 14))}…';
|
||||
}
|
||||
}
|
||||
|
||||
extension DateFormatUtils on DateTime {
|
||||
|
||||
Submodule filcnaplo_kreta_api updated: b27a8b3a40...c453fca659
Submodule filcnaplo_mobile_ui updated: ee88bde427...f6cc4a0ace
Reference in New Issue
Block a user