flutter_guid
Simuliert C# Guid. Generiert neue UUIDs und fügt Variablen des Typs Guid zu Klassen hinzu.
Ein Flutter-Paket, das den C#-Typ Guid nachahmt. Verwenden Sie dieses Paket, um neue UUIDs zu generieren, Variablen des Typs Guid zu Ihren Klassen hinzuzufügen und zwei 'Guid'-Variablen sicher miteinander zu vergleichen.
{"sdk":"flutter"}^3.0.7^3.0.0{"sdk":"flutter"}Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.
A flutter package that emulates the C# type Guid. Use this package to:
Install from https://pub.dev/packages/flutter_guid#-installing-tab- , "flutter_guid's installation page on pub.dev"
import 'package:flutter_guid/flutter_guid.dart';
class Employee{
final Guid id;
final Guid departmentId;
Employee({this.id, this.departmentId});
}
// initialize a guid from a string
final accountsDepartmentId = new Guid("41e879aa-859c-4bda-b77b-37b7e07c6674");
// Generate a guid on the fly (Uses the superb package 'https://pub.dev/packages/uuid').
final employeeId = Guid.newGuid;
// initialize a guid from a lowercase string
final accountsDepartmentIdLowerCase = new Guid("41e879aa-859c-4bda-b77b-37b7e07c6674");
// initialize a guid with same string, but UPPERCASE
final accountsDepartmentIdUpperCase = new Guid("41E879AA-859C-4BDA-B77B-37B7E07C6674");
// performs case-insensitive comparison and evaluates to 'true'
final equal = accountsDepartmentIdUpperCase == accountsDepartmentIdLowerCase;
final Guid accountsDepartmentIdLowerCase = new Guid("41e879aa-859c-4bda-b77b-37b7e07c6674");
// this works.
String uuidString = accountsDepartmentIdLowerCase.value;
// this also works.
uuidString = accountsDepartmentIdLowerCase.toString();
Clone the repo and run flutter test
chmod +x ./run-tests.sh)../run-tests.sh.It is unlikely that I'll be porting the run-tests.sh script to other systems, my reason mostly being that I don't frequently use any other OS and would not want to pick a sub-optimal tool for coverage generation (also laziness probably is a factor).
Anyhow, it should be fairly straight-forward to do the porting if you so wish.
The run-tests.sh consists of all of two lines:
The first line is platform independent and generates the file ./coverage/lcov.info (again relative to project root). On Linux, we can consume the coverage info contained in this file via the lcov tool. On Windows and other platforms, there exists also tools that would be able to similarly consume the coverage information and produce human friendly output.
In essense, port the script to desired platform by