super_string_utils 1.1.4
super_string_utils: ^1.1.4 copied to clipboard
A production-ready collection of String extension methods for Dart and Flutter. Features include validation, transformation, extraction, masking, and fuzzy matching.
example/lib/main.dart
import 'package:example/info.dart';
import 'package:example/security_webscreen.dart';
import 'package:example/text_analysis.dart';
import 'package:example/text_processing.dart';
import 'package:flutter/material.dart';
import 'advance_layout_screen.dart';
import 'collection_and_data.dart';
import 'core_string_ext.dart';
import 'fluent_ui.dart';
import 'numeric_and_time.dart';
import 'dart:html' as html;
void main() {
runApp(MaterialApp(home: HomeScreen(),debugShowCheckedModeBanner: false,));
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xfff8fafc),
body: Column(
children: [
// const _TopNavBar(),
Expanded(
child: LayoutBuilder(
builder: (context, constraints) {
int columns = 2;
if (constraints.maxWidth > 1300) {
columns = 4;
} else if (constraints.maxWidth > 1000) {
columns = 3;
}
return SingleChildScrollView(
child: Center(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: 1300),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 40, vertical: 60),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
const _HeroSection(),
const SizedBox(height: 70),
_SectionGrid(columns: columns),
const SizedBox(height: 80),
const _ViewAllExtensionsButton(),
const SizedBox(height: 70),
const _SupportSection(),
],
),
),
),
),
);
},
),
),
],
),
);
}
}
class _TopNavBar extends StatelessWidget {
const _TopNavBar();
@override
Widget build(BuildContext context) {
return Container(
height: 70,
padding: const EdgeInsets.symmetric(horizontal: 40),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.04),
blurRadius: 10,
)
],
),
child: Row(
children: [
const Text(
"Super String Utils",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const Spacer(),
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
const AllExtensionsListScreen()),
);
},
child: const Text("Full Index"),
),
],
),
);
}
}
class _HeroSection extends StatelessWidget {
const _HeroSection();
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text(
"Documentation",
style: TextStyle(
fontSize: 14,
letterSpacing: 2,
color: Colors.blueGrey,
),
),
SizedBox(height: 12),
Text(
"Super String Utils",
style: TextStyle(
fontSize: 48,
fontWeight: FontWeight.bold,
height: 1.1,
),
),
SizedBox(height: 16),
Text(
"A powerful and elegant collection of string utilities\nfor Flutter & Dart applications.",
style: TextStyle(
fontSize: 18,
color: Colors.black54,
height: 1.6,
),
),
],
);
}
}
class _ViewAllExtensionsButton extends StatefulWidget {
const _ViewAllExtensionsButton();
@override
State<_ViewAllExtensionsButton> createState() => _ViewAllExtensionsButtonState();
}
class _ViewAllExtensionsButtonState extends State<_ViewAllExtensionsButton> {
bool _hover = false;
@override
Widget build(BuildContext context) {
return Center(
child: MouseRegion(
cursor: SystemMouseCursors.click,
onEnter: (_) => setState(() => _hover = true),
onExit: (_) => setState(() => _hover = false),
child: AnimatedContainer(
duration: const Duration(milliseconds: 180),
curve: Curves.easeOut,
transform: _hover
? (Matrix4.identity()..translate(0.0, -3.0))
: Matrix4.identity(),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
gradient: const LinearGradient(
colors: [
Color(0xff4f46e5),
Color(0xff6366f1),
],
),
boxShadow: [
BoxShadow(
color: const Color(0xff6366f1)
.withOpacity(_hover ? 0.35 : 0.2),
blurRadius: _hover ? 25 : 15,
offset: const Offset(0, 10),
),
],
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(14),
onTap: () {
Navigator.push(
context,
PageRouteBuilder(
transitionDuration:
const Duration(milliseconds: 250),
pageBuilder: (_, __, ___) =>
const AllExtensionsListScreen(),
transitionsBuilder:
(_, animation, __, child) {
return FadeTransition(
opacity: animation,
child: child,
);
},
),
);
},
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 42, vertical: 20),
child: Row(
mainAxisSize: MainAxisSize.min,
children: const [
Text(
"Browse All Extensions",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.white,
letterSpacing: 0.4,
),
),
SizedBox(width: 12),
Icon(
Icons.arrow_forward,
size: 18,
color: Colors.white,
),
],
),
),
),
),
),
),
);
}
}
class _NavCard extends StatefulWidget {
final String title;
final IconData icon;
final Color color;
final String desc;
final VoidCallback onTap;
const _NavCard({
required this.title,
required this.icon,
required this.color,
required this.desc,
required this.onTap,
});
@override
State<_NavCard> createState() => _NavCardState();
}
class _NavCardState extends State<_NavCard> {
bool _hovering = false;
@override
Widget build(BuildContext context) {
return MouseRegion(
onEnter: (_) => setState(() => _hovering = true),
onExit: (_) => setState(() => _hovering = false),
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
transform: _hovering
? (Matrix4.identity()..scale(1.03))
: Matrix4.identity(),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(_hovering ? 0.12 : 0.06),
blurRadius: _hovering ? 20 : 10,
offset: const Offset(0, 8),
),
],
),
child: InkWell(
borderRadius: BorderRadius.circular(20),
onTap: widget.onTap,
child: Padding(
padding: const EdgeInsets.all(28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(widget.icon,
size: 40, color: widget.color),
const Spacer(),
Text(
widget.title,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 8),
Text(
widget.desc,
style: const TextStyle(
fontSize: 14,
color: Colors.black54,
),
),
],
),
),
),
),
);
}
}
class _SectionGrid extends StatelessWidget {
final int columns;
const _SectionGrid({required this.columns});
@override
Widget build(BuildContext context) {
final items = [
_SectionItem(
title: 'Core Basics',
desc: 'Validation, transforms & extraction utilities',
icon: Icons.text_fields,
color: Colors.blue,
screen: const CoreStringScreen(),
),
_SectionItem(
title: 'Fluent UI',
desc: 'Text builders & UI helpers',
icon: Icons.widgets,
color: Colors.purple,
screen: const FluentUiScreen(),
),
_SectionItem(
title: 'Layouts',
desc: 'Dynamic Row / Column controls',
icon: Icons.view_quilt,
color: Colors.orange,
screen: const AdvancedLayoutScreen(),
),
_SectionItem(
title: 'Security & Web',
desc: 'Hashing, Base64, URL & IPv4 tools',
icon: Icons.security,
color: Colors.teal,
screen: const SecurityWebScreen(),
),
_SectionItem(
title: 'Numeric & Time',
desc: 'Date, Duration, Bool, Int helpers',
icon: Icons.timer,
color: Colors.indigo,
screen: const NumericTimeScreen(),
),
_SectionItem(
title: 'Data & Lists',
desc: 'JSON, CSV, Maps & Chunks',
icon: Icons.data_array,
color: Colors.brown,
screen: const CollectionsDataScreen(),
),
_SectionItem(
title: 'Analysis',
desc: 'Reading time, frequency & stats',
icon: Icons.analytics,
color: Colors.pink,
screen: const TextAnalysisScreen(),
),
_SectionItem(
title: 'Text Magic',
desc: 'Fuzzy, indent, replacement, intl',
icon: Icons.auto_fix_high,
color: Colors.deepOrange,
screen: const TextProcessingScreen(),
),
];
return GridView.builder(
itemCount: items.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: columns,
mainAxisSpacing: 30,
crossAxisSpacing: 30,
childAspectRatio: 1.25,
),
itemBuilder: (context, index) {
return _SectionCard(item: items[index]);
},
);
}
}
class _SectionItem {
final String title;
final String desc;
final IconData icon;
final Color color;
final Widget screen;
const _SectionItem({
required this.title,
required this.desc,
required this.icon,
required this.color,
required this.screen,
});
}
class _SectionCard extends StatefulWidget {
final _SectionItem item;
const _SectionCard({required this.item});
@override
State<_SectionCard> createState() => _SectionCardState();
}
class _SectionCardState extends State<_SectionCard> {
bool _hover = false;
@override
Widget build(BuildContext context) {
return MouseRegion(
cursor: SystemMouseCursors.click,
onEnter: (_) => setState(() => _hover = true),
onExit: (_) => setState(() => _hover = false),
child: AnimatedContainer(
duration: const Duration(milliseconds: 160),
curve: Curves.easeOut,
decoration: BoxDecoration(
color: _hover
? const Color(0xfff9fbff)
: Colors.white,
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: _hover
? widget.item.color.withOpacity(0.4)
: Colors.grey.shade200,
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(
_hover ? 0.08 : 0.03),
blurRadius: _hover ? 18 : 8,
offset: const Offset(0, 6),
),
],
),
child: InkWell(
borderRadius: BorderRadius.circular(18),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => widget.item.screen,
),
);
},
child: Padding(
padding: const EdgeInsets.all(26),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(widget.item.icon,
size: 28,
color: widget.item.color),
const Spacer(),
Text(
widget.item.title,
style: const TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
widget.item.desc,
style: const TextStyle(
fontSize: 14,
height: 1.5,
color: Colors.black54,
),
),
],
),
),
),
),
);
}
}
class _SupportSection extends StatelessWidget {
const _SupportSection();
void _open(String url) {
html.window.open(url, '_blank');
}
@override
Widget build(BuildContext context) {
return Column(
children: [
const Divider(height: 80),
const Text(
"Support super_string_utils",
style: TextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 14),
const Text(
"If this package saves you time or improves your workflow,\nconsider supporting the project.",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.black54,
height: 1.6,
),
),
const SizedBox(height: 40),
Wrap(
spacing: 24,
runSpacing: 24,
alignment: WrapAlignment.center,
children: [
_SupportButton(
label: "⭐ Star on GitHub",
color: Colors.black,
onTap: () => _open(
"https://github.com/tharanitharan305/super_string_utils",
),
),
_SupportButton(
label: "📦 View on Pub.dev",
color: Colors.blue,
onTap: () => _open(
"https://pub.dev/packages/super_string_utils",
),
),
_SupportButton(
label: "☕ Buy Me A Coffee",
color: Colors.orange,
onTap: () => _open(
"https://buymeacoffee.com/tharanitharan",
),
),
],
),
const SizedBox(height: 60),
const Text(
"Built with 💙 for the Flutter community",
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
const SizedBox(height: 40),
],
);
}
}
class _SupportButton extends StatefulWidget {
final String label;
final Color color;
final VoidCallback onTap;
const _SupportButton({
required this.label,
required this.color,
required this.onTap,
});
@override
State<_SupportButton> createState() =>
_SupportButtonState();
}
class _SupportButtonState extends State<_SupportButton> {
bool _hover = false;
@override
Widget build(BuildContext context) {
return MouseRegion(
cursor: SystemMouseCursors.click,
onEnter: (_) => setState(() => _hover = true),
onExit: (_) => setState(() => _hover = false),
child: AnimatedContainer(
duration: const Duration(milliseconds: 150),
padding: const EdgeInsets.symmetric(
horizontal: 26, vertical: 16),
decoration: BoxDecoration(
color: _hover
? widget.color
: widget.color.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
),
child: InkWell(
onTap: widget.onTap,
child: Text(
widget.label,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color:
_hover ? Colors.white : widget.color,
),
),
),
),
);
}
}