v0.1.1
common_utilities
一個 Dart 語言的通用工具套件,讓您的程式碼更快、更簡單、更乾淨。包含大量對 Dart 原始類型有用的函數(支援所有 Flutter 平台)
39喜歡 42近 30 天下載140Pub 分數
AndroidiOSWeb
一個 Dart 語言的通用工具套件,讓您的程式碼更快、更簡單、更乾淨。包含大量對 Dart 原始類型有用的函數(支援所有 Flutter 平台)
{"sdk":"flutter"}^0.17.0{"sdk":"flutter"}^1.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
A Dart language Common Utility package, that makes your code faster,easier and cleaner. contains lots of useful functions for Dart primitive types (support all Flutter platforms)
version 0.1.1 Includes only String utils.
add this line to your pubspec.yaml :
dependencies:
common_utilities: ^0.1.1
or enter this to your command line:
flutter pub add common_utilities
Includes over 30 useful string functions such as :
import 'package:common_utilities/common_utilities.dart';
void main() {
String yourStr = 'If you want something you have never had you must do something you have never done';
String result = yourStr.stringUtils().subStringBetween('want', 'never');
// print(result) => 'something you have'
List<String> result2 = yourStr.stringUtils().subStringsBetween('you', 'never');
// print(result2) => ['something you have' , 'must do something you have']
String result3 = yourStr.stringUtils().subStringAfter('something');
// print(result3) => 'you have never had you must do something you have never done'
bool lastIndex = true; //This is optional & its false by default
String result4 = yourStr.stringUtils().subStringAfter('something', lastIndex);
// print(result4) => 'you have never done'
String str = CommonUtils.getRandomString(10);
// print(str) => 'btorklcvxw'
}