char limit formatter

This commit is contained in:
55nknown 2022-10-03 11:39:30 +02:00
parent 4a81722747
commit 75eba2c83f
3 changed files with 9 additions and 2 deletions

View File

@ -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 {

@ -1 +1 @@
Subproject commit b27a8b3a400f2566090947a42ced956134636021
Subproject commit c453fca659c8bd200cd563a5fac4d5eaa6ed34ea

@ -1 +1 @@
Subproject commit ee88bde42727eb2e9cac5720acc1a01e2de25ede
Subproject commit f6cc4a0ace62f3c5b3de8e86bfc7005d33faa2b5