mirror of
https://github.com/hanskokx/arcane_helper_utils.git
synced 2026-05-14 02:19:09 +02:00
v1.1.0
Removed Unfocuser Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
+11
-12
@@ -1,37 +1,36 @@
|
||||
import "package:arcane_helper_utils/arcane_helper_utils.dart";
|
||||
import "package:flutter/foundation.dart";
|
||||
|
||||
void main() {
|
||||
// DateTime
|
||||
final DateTime dateTime = DateTime(2019, 1, 1, 13, 45);
|
||||
debugPrint(dateTime.toIso8601String()); // 2019-01-01T13:45:00.0
|
||||
debugPrint(dateTime.startOfHour.toIso8601String()); // 2019-01-01T13:00:00.0
|
||||
print(dateTime.toIso8601String()); // 2019-01-01T13:45:00.0
|
||||
print(dateTime.startOfHour.toIso8601String()); // 2019-01-01T13:00:00.0
|
||||
|
||||
final bool today = DateTime.now().isToday;
|
||||
final bool notToday = DateTime(2001, 12, 31).isToday;
|
||||
debugPrint("$today"); // true
|
||||
debugPrint("$notToday"); // false
|
||||
print("$today"); // true
|
||||
print("$notToday"); // false
|
||||
|
||||
final DateTime yesterday = DateTime(0).yesterday;
|
||||
final DateTime tomorrow = DateTime(0).tomorrow;
|
||||
|
||||
debugPrint("Yesterday: $yesterday");
|
||||
debugPrint("Tomorrow: $tomorrow");
|
||||
print("Yesterday: $yesterday");
|
||||
print("Tomorrow: $tomorrow");
|
||||
|
||||
// Strings
|
||||
const String? nullString = null;
|
||||
const String emptyString = " ";
|
||||
const String nonEmptyString = "Hello World!";
|
||||
|
||||
debugPrint("${nullString.isNullOrEmpty}"); // true
|
||||
debugPrint("${emptyString.isNullOrEmpty}"); // true
|
||||
debugPrint("${nonEmptyString.isNullOrEmpty}"); // false
|
||||
print("${nullString.isNullOrEmpty}"); // true
|
||||
print("${emptyString.isNullOrEmpty}"); // true
|
||||
print("${nonEmptyString.isNullOrEmpty}"); // false
|
||||
|
||||
const String text = "DartLang";
|
||||
final List<String> result = text.splitByLength(3);
|
||||
debugPrint("$result"); // ["Dar", "tLa", "ng"]
|
||||
print("$result"); // ["Dar", "tLa", "ng"]
|
||||
|
||||
const String lowercase = "hello";
|
||||
final String capitalized = lowercase.capitalize;
|
||||
debugPrint(capitalized); // "Hello"
|
||||
print(capitalized); // "Hello"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user