Sunday, 4 August 2019

PIN input field widget for Flutter with paste from clipboard functionality



PinPut

This widget keeps whole width of parent widget and layouts textfields in a way to create PIN code input field look it accepts string of any length and calls the onSubmit method when all fields are filled.



Properties

PROPERTYDEFAULT/MEANING
onSubmit@required Function
fieldsCount@required number
isTextObscurefalse
textStyleTextStyle(fontSize: 30)
spaceBetweenspace between fields Default: 10.0
clearButtonIconIcon(Icons.backspace, size: 30)
pasteButtonIconIcon(Icons.content_paste, size: 30)
unFocusWhenDefault is False, True to hide keyboard
inputDecorationAbility to style field's border, padding etc...
keybaordTypenumber
keyboardActionnext
actionButtonEnabledtrue
autoFocustrue
textCapitalizationTextCapitalization.none

Example

Import the package:

import 'package:flutter/material.dart';
import 'package:pinput/pin_put/pin_put.dart';

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

class PinPutTest extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(
          primaryColor: Colors.green,
          hintColor: Colors.green,
        ),
        home: Scaffold(
            body: Builder(
          builder: (context) => Padding(
                padding: const EdgeInsets.all(40.0),
                child: Center(
                  child: PinPut(
                    fieldsCount: 4,
                    onSubmit: (String pin) => _showSnackBar(pin, context),
                  ),
                ),
              ),
        )));
  }

  void _showSnackBar(String pin, BuildContext context) {
    final snackBar = SnackBar(
      duration: Duration(seconds: 5),
      content: Container(
          height: 80.0,
          child: Center(
            child: Text(
              'Pin Submitted. Value: $pin',
              style: TextStyle(fontSize: 25.0),
            ),
          )),
      backgroundColor: Colors.greenAccent,
    );
    Scaffold.of(context).showSnackBar(snackBar);
  }
}
Dart

GitHub

PIN input field widget for flutter — Read More
Latest commit to the master branch on 8-2-2019
Download as zip

Flutter implementation of WykopMobilny



Wykop Mobilny (Hybird)

Flutter implementation of WykopMobilny.

Setting up

  1. Requirements:
    • For this app you need to install flutter.
  2. Setup:
    • Enter /assets/ folder and create file named secrets.json.
    • Copy code from secrets.example.json.
    • Replace wykop_key and wykop_secret with your keys.
      you can generate keys here
      Keep in mind, that application uses API version 2. Version 1 keys are not supported and will not work.
  3. Install all depedencies:
    • flutter packages get
  4. After successful installation, you can run the app by typing in terminal:
    • flutter run
      if you want to run production version just type
    • flutter run --release
If you have any issues join Polish Flutter server on discord or Otwarty Wykop Mobilnydiscord.
Flutter developers server on discord.

GitHub

Flutter implementation of WykopMobilny — Read More
Latest commit to the master branch on 8-1-2019
Download as zip

A flutter app to display the movies list using themoviedb



MoviePedia

This project is a test application using Flutter and TheMovieDB. TheMovieDB is used for the movies api like popular movies, upcoming movies, now playing movies and their details.



GitHub

A flutter app to display the movies list (now playing, upcoming and the popular) using themoviedb — Read More
Latest commit to the master branch on 7-17-2019
Download as zip

Geometric Patterns for Flutter using CustomPainter



geopattern_flutter

Geometric Patterns for Flutter using CustomPainters.



Simple Example

import 'dart:convert';

import 'package:crypto/crypto.dart';
import 'package:flutter/material.dart';
import 'package:geopattern_flutter/geopattern_flutter.dart';
import 'package:geopattern_flutter/patterns/mosaic_squares.dart';

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

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final hash = sha1.convert(utf8.encode("flutter")).toString();
    return LayoutBuilder(builder: (context, constraints) {
      final pattern = MosaicSquares.fromHash(hash);
      return CustomPaint(
          size: Size(constraints.maxWidth, constraints.maxHeight),
          painter: FullPainter(pattern: pattern, background: Colors.blueGrey));
    });
  }
}
Dart
creates :


Patterns are fully customizable, for example a pattern created as
final pattern = ConcentricCircles(
  radius: 40,
  strokeWidth: 8,
  nx: 6,
  ny: 6,
  strokeColors: List.generate(
      36,
      (int i) => Color.fromARGB(
          10 + (gen.nextDouble() * 100).round(),
          50 + gen.nextInt(2) * 150,
          50 + gen.nextInt(2) * 150,
          50 + gen.nextInt(2) * 150)),
  fillColors: List.generate(
      36,
      (int i) => Color.fromARGB(
          10 + (gen.nextDouble() * 100).round(),
          50 + gen.nextInt(2) * 150,
          50 + gen.nextInt(2) * 150,
          50 + gen.nextInt(2) * 150)));
Dart
renders :


Each pattern has an associated size. The FillPainter class implements CustomPainter such that the pattern is repetitively painted across the entire width and height of the canvas. However, each Pattern has a paint(Canvas, Offset) method that can be used to paint on its own.
There is an example for using a pattern as a background for SliverAppBar in example/appbar.dart

TODO

  • Tesselation
  • Xes

GitHub

geometric patterns for flutter — Read More
Latest commit to the master branch on 7-17-2019
Download as zip