Thursday, 8 August 2019

A Flutter package to parse text and make them into linkified text widget


Flutter Parsed text

A Flutter package to parse text and extract parts using predefined types like url, phone and email and also supports Regex.

Usage 

To use this package, add flutter_parsed_text as a dependency in your pubspec.yaml file.
import 'package:flutter_parsed_text/flutter_parsed_text.dart';
Dart

Working ⚙️

ParsedText can receive this paramters & all the RichText parameters:
text: Text that will be parsed and rendered.
style: It takes a TextStyle object as it's property to style all the non links text objects.
parse: Array of MatchText object - used for defining structure for pattern matching .
Dart
A boolean that show a diffrent text and passes a diffrent text to the callback
eg: Your str is "Mention [@michel:5455345]" where 5455345 is ID of this user which will be passed as parameter to the callback funtion and @michel the value to display on interface. Your pattern for ID & username extraction : /\[(@[^:]+):([^\]]+)\]/i
Displayed text will be : Mention ^^@michel^^
MatchText(
  pattern: r"\[(@[^:]+):([^\]]+)\]",
  style: TextStyle(
    color: Colors.green,
    fontSize: 24,
  ),
  // you must return a map with two keys
  // [display] - the text you want to show to the user
  // [value] - the value underneath it
  renderText: ({String str, String pattern}) {
    Map<String, String> map = Map<String, String>();
    RegExp customRegExp = RegExp(pattern);
    Match match = customRegExp.firstMatch(str);
    map['display'] = match.group(1);
    map['value'] = match.group(2);
    return map;
  },
  onTap: (url) {
    // do something here with passed url
  },
),
Dart

Example

Find the complete example wiring in the Flutter_Parsed_Text example application.
A small example of the ParsedText widget.
ParsedText(
  text:
    "[@michael:51515151] Hello this is an example of the ParsedText, links like http://www.google.com or http://www.facebook.com are clickable and phone number 444-555-6666 can call too. But you can also do more with this package, for example Bob will change style and David too. foo@gmail.com And the magic number is 42! #react #react-native",
  parse: <MatchText>[
    MatchText(
      type: "email",
      style: TextStyle(
        color: Colors.red,
        fontSize: 24,
      ),
      onTap: (url) {
        launch("mailto:" + url);
      },
    ),
  ],
)
Dart

Found this project useful? 

If you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.

API details 

See the flutter_parsed_text.dart for more API details

GitHub

A Flutter package to parse text and make them into linkified text widget — Read More
Latest commit to the master branch on 8-7-2019
Download as zip


Flutter Speedometer widget package



flutter_speedometer

Flutter Speedometer widget package.

Getting Started

In order to use this package, do import
import 'package:flutter_speedometer/flutter_speedometer.dart';
Dart
Basic implementation can be done like below code:
import 'package:flutter/material.dart';
import 'package:flutter_speedometer/flutter_speedometer.dart';

void main() {
  runApp(
    Center(
      child: Speedometer(
        size: 250,
        minValue: 0,
        maxValue: 180,
        currentValue: 76,
        warningValue: 150,
        displayText: 'mph',
      ),
    ),
  );
}
Dart

Example App

You can find more examples from Example App

API

In this table, you can find all attributes provided by this package:
ATTRIBUTEDEFAULT VALUEDESCRIPTION
size200Min value to be displayed
minValue0Min value to be displayed
maxValue100Max value to be displayed
currentValue0Set the current value
warningValue80Set the current value

Objects

class Speedometer {

    final double size;
    final int minValue;
    final int maxValue;
    final int currentValue;
    final int warningValue;
    final Color backgroundColor;
    final Color meterColor;
    final Color warningColor;
    final Color kimColor;
    final TextStyle displayNumericStyle;
    final String displayText;
    final TextStyle displayTextStyle;
}
Dart

GitHub

Flutter Speedometer widget package — Read More
Latest commit to the master branch on 8-7-2019
Download as zip

A Flutter PageView Indicator has Worm animation



Worm Indicator

A pageview indicator.

Features

  • Use with PageView to display scroll progress

Getting Started

Make sure you add the lib dependency in your flutter project.
dependencies:
  worm_indicator: 0.1.1
Then you should run flutter packages get to update your packages in your IDE.

Example Project

Checkout the project inside example folder.
Screenshot:


Usage

WormIndicator(
  length: PAGE_VIEW_SIZE,
  controller: PAGE_VIEW_CONTROLLER,
  size: DOT_SIZE_IN_PT,
  spacing: DOT_SPACING_IN_PT,
),
Properties:
NAMEUSAGETYPE
lengthNumber of dotsint
controllerPageView controllerPageController
sizeSize of a dotint
spacingSpacing between dotsint
colorColor of normal dotsColor
indicatorColorColor of current active dotColor

Road map

This is the plan toward 1.0 release
  • [ ] Add more shape configuration of the dots
  • [ ] Add more transition animation with worm-style
  • [ ] Add more detail documentation
  • [ ] Write more specific example projects

Support

Email me at phuchuynh.strong@gmail.com for any support needed

GitHub

A Flutter PageView Indicator has Worm animation — Read More
Latest commit to the master branch on 8-6-2019
Download as zip

Wednesday, 7 August 2019

Organizing access to information on University of Toronto Food Options



UofT Foods

A Flutter Mobile App designed to aid UofT Students and Staff easily find food options across all campuses.

Features

  • Campus Selection Filters
  • Store Tags
  • Store hours
  • Open notifier
  • Search

Coming soon

  • Better Filtering
  • Sorting
  • "Nearby"
  • "Navigate"
  • Ratings
  • Favorites

App Development Progression

V1.0


V0.9

V0.3


GitHub

— Read More
Latest commit to the undefined branch on unknown
Download as zip