likewallet_connection 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 16

likewallet_connection #

A new Flutter package.

This package is use for integrate account with Likewallet project your can use for your application phoneNumber sync with Likewallet.

Getting Started #

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


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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {

    //ข้อมูลส่วนนี้ต้องกรอกให้ครบตามนี้
    Navigator.push(context,
    MaterialPageRoute(
      builder: (context) => RegisterLike(
        phoneNumber: '+66808349125',
        apiKey: 'apikey',
        secretKey: 'secret key',
        lastName: 'Polchan',
        firstName: 'Prapat',
        exitPath: MyHomePage(title: 'Flutter Demo Home Page'),
        idcard: '122990046xxxx',
        application: 'example',
      )
    )
    );
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

วิธีเรียกใช้งาน uid #

//import 'package:shared_preferences/shared_preferences.dart';

SharedPreferences prefs = await SharedPreferences.getInstance();
String uid = prefs.getString('uid-likewallet');

[0.0.2] - TODO: Add release date. #

  • can register and sign in with phoneNumber

[0.0.1] - TODO: Add release date. #

  • TODO: Describe initial release.

example/lib/main.dart

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


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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    Navigator.push(context,
    MaterialPageRoute(
      builder: (context) => RegisterLike(
        phoneNumber: '+66808349122',
        apiKey: '61da7951-8ffb-494d-98b2-37994652fcfc',
        secretKey: 'b6a45dc2-4467-45be-b1e1-0611395e64fc',
        lastName: 'Polchan',
        firstName: 'Prapat',
        exitPath: MyHomePage(title: 'Flutter Demo Home Page'),
        idcard: '1229900468712',
        application: 'example',
      )
    )
    );
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  likewallet_connection: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:likewallet_connection/likewallet_connection.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
28
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
16
Learn more about scoring.

We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Health issues and suggestions

Fix lib/confirm_otp.dart. (-71.12 points)

Analysis of lib/confirm_otp.dart failed with 4 errors, 1 warning, 8 hints, including:

line 509 col 19: This requires the 'control-flow-collections' experiment to be enabled.

line 558 col 32: This requires the 'control-flow-collections' experiment to be enabled.

line 771 col 23: This requires the 'control-flow-collections' experiment to be enabled.

line 800 col 36: This requires the 'control-flow-collections' experiment to be enabled.

line 288 col 33: The parameter 'onPressed' is required.

Fix lib/likewallet_connection.dart. (-1.49 points)

Analysis of lib/likewallet_connection.dart reported 3 hints:

line 168 col 16: This function has a return type of 'Future

line 217 col 3: Name non-constant identifiers using lowerCamelCase.

line 345 col 10: Name non-constant identifiers using lowerCamelCase.

Fix lib/complete.dart. (-0.50 points)

Analysis of lib/complete.dart reported 1 hint:

line 78 col 39: Set literals weren't supported until version 2.2, but this code is required to be able to run on earlier versions.

Format lib/animationPage.dart.

Run flutter format to format lib/animationPage.dart.

Format lib/otp_send.dart.

Run flutter format to format lib/otp_send.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/ags-21ct/likewallet_connection was unreachable.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (fluttertoast).

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
encrypt ^4.0.0 4.0.2
flutter 0.0.0
flutter_localizations 0.0.0
fluttertoast ^3.1.3 3.1.3 6.0.1
http ^0.12.0+4 0.12.1
modal_progress_hud ^0.1.3 0.1.3
native_widgets ^1.3.5 1.3.7+1
shared_preferences ^0.5.7 0.5.8
Transitive dependencies
args 1.6.0
asn1lib 0.6.5
charcode 1.1.3
clock 1.0.1
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.5
cupertino_icons 0.1.3
file 5.2.1
flutter_list_drag_and_drop 0.1.6
flutter_platform_widgets 0.32.5 0.51.0
flutter_slidable 0.5.4
flutter_sticky_header 0.4.2
flutter_web_plugins 0.0.0
http_parser 3.1.4
intl 0.16.1
meta 1.1.8 1.2.2
path 1.6.4 1.7.0
path_provider_linux 0.0.1+2
path_provider_platform_interface 1.0.2
pedantic 1.9.0 1.9.2
platform 2.2.1
plugin_platform_interface 1.0.2
pointycastle 1.0.2
process 3.0.13
shared_preferences_linux 0.0.2+1
shared_preferences_macos 0.0.1+10
shared_preferences_platform_interface 1.0.4
shared_preferences_web 0.1.2+7
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
uuid 2.2.0
vector_math 2.0.8 2.1.0-nullsafety
xdg_directories 0.1.0
Dev dependencies
flutter_test