regexpattern 2.6.0 copy "regexpattern: ^2.6.0" to clipboard
regexpattern: ^2.6.0 copied to clipboard

Flutter list of regex pattern with purpose for string validation

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:regexpattern/regexpattern.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Regex Pattern Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Regex Pattern Example Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    String text = 'https://google.com';
    bool isMatch = text.isUrl();
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'isUrl - $text: $isMatch',
            ),
          ],
        ),
      ),
    );
  }
}
126
likes
160
pub points
92%
popularity

Publisher

unverified uploader

Flutter list of regex pattern with purpose for string validation

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on regexpattern