Skip to content

Useful primitive utilities and extension methods from the clever people at Saropa

License

Notifications You must be signed in to change notification settings

saropa/saropa_dart_utils

Repository files navigation

Saropa Dart Utils

saropa company logo



Boilerplate reduction tools 🚀 and human readable extension methods 🤖 by Saropa 🎈

pub.dev linter: very good analysis style: very good analysis

slack: saropa Google Play: saropa AppStore: saropa

github home stars likes Open Issues Open PRs

We encourage your to review our public Code of Conduct.

Contents

Useful methods and extensions

String text = 'www.saropa.com';
print(text.removeStart('www.')); // Output: saropa.com

String text = 'https://www.saropa.com';
print(text.removeStart('www.')); // Output: https://www.saropa.com

String? text;
print(text.isNullOrEmpty); // Output: true

text = "";
print(text.isNullOrEmpty); // Output: true

text = "Hello";
print(text.isNullOrEmpty); // Output: false


String? text;
print(text.notNullOrEmpty); // Output: false

text = "";
print(text.notNullOrEmpty); // Output: false

text = "Hello";
print(text.notNullOrEmpty); // Output: true

String? text = "Saropa";
print(text.encloseInParentheses()); // Output: (Saropa)

text = "";
print(text.encloseInParentheses(wrapEmpty: true)); // Output: ()

text = null;
print(text.encloseInParentheses()); // Output: null


String? text = "Saropa";
print(text.wrapWith(before: "(", after: ")")); // Output: (Saropa)
print(text.wrapWith(before: "Prefix-")); // Output: Prefix-Saropa
print(text.wrapWith(after: "-Suffix")); // Output: Saropa-Suffix

String text = "  Saropa   has   multiple   spaces  ";
print(text.removeConsecutiveSpaces()); // Output: "Saropa has multiple spaces"
print(text.removeConsecutiveSpaces(trim: false)); // Output: " Saropa has multiple spaces "

String text = "  Saropa   has   multiple   spaces  ";
print(text.compressSpaces()); // Output: "Saropa has multiple spaces"
print(text.compressSpaces(trim: false)); // Output: " Saropa has multiple spaces "

Extensions

String Extensions

String text = 'www.saropa.com';
print(text.removeStart('www.')); // Output: saropa.com

String? text;
print(text.isNullOrEmpty); // Output: true

text = "";
print(text.isNullOrEmpty); // Output: true

text = "Hello";
print(text.isNullOrEmpty); // Output: false


String? text;
print(text.notNullOrEmpty); // Output: false

text = "";
print(text.notNullOrEmpty); // Output: false

text = "Hello";
print(text.notNullOrEmpty); // Output: true

String? text = "Saropa";
print(text.encloseInParentheses()); // Output: (Saropa)

text = "";
print(text.encloseInParentheses(wrapEmpty: true)); // Output: ()

text = null;
print(text.encloseInParentheses()); // Output: null


String? text = "Saropa";
print(text.wrapWith(before: "(", after: ")")); // Output: (Saropa)
print(text.wrapWith(before: "Prefix-")); // Output: Prefix-Saropa
print(text.wrapWith(after: "-Suffix")); // Output: Saropa-Suffix

String text = "  Saropa   has   multiple   spaces  ";
print(text.removeConsecutiveSpaces()); // Output: "Saropa has multiple spaces"
print(text.removeConsecutiveSpaces(trim: false)); // Output: " Saropa has multiple spaces "

String text = "  Saropa   has   multiple   spaces  ";
print(text.compressSpaces()); // Output: "Saropa has multiple spaces"
print(text.compressSpaces(trim: false)); // Output: " Saropa has multiple spaces "

Deployment Guide For Developers

1.⁠ ⁠Update CHANGELOG.md

2.⁠ Format ⁠dart format .     (note the trailing period ".")

3.⁠ ⁠Test flutter test

4.⁠ ⁠Execute ⁠dart doc

5.⁠ ⁠Deploy ⁠flutter pub publish


🌐 📖 👥 🏢 🚨 🔒 🤝 🎯 🛡️ 📉 🆘 ⏱️ 🚑 📞 🌍 🔄 📲 💼

About Saropa

Saropa®️ is a technology company established in 2010. We have a strong background in financial services, online security and secure web communications.

Our team has extensive experience in top-tier financial technology and we are passionate believers in personal risk management. We are engaged and excited about our vision for family security and this encourages our culture of innovation.

Saropa Contacts is a private, cloud-connected address book that links real people, companies, and emergency groups. It is primarily focused on your trusted emergency groups. Our mission is to reduce the impact of crises everywhere.

In an emergency, get real-time access to all the important people, companies, and services you need - even if you don't know them personally, or if they're not where you expect them to be.

Visit the Saropa Contacts project here: app.saropa.com

PRs, ideas and issues are always welcome! Email for any questions [email protected] or find us on Slack Saropa

💙 Saropa

About

Useful primitive utilities and extension methods from the clever people at Saropa

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •