vehicle_keyboard 0.0.4

  • Readme
  • Changelog
  • Installing
  • 40

vehicle_keyboard #

Pub

专为提高中国车牌号码输入速度而定制开发的专用键盘组件。

欢迎大家提出宝贵的意见

Getting Started #

Add dependency #

dependencies:
    vehicle_keyboard: ^0.0.4 #latest version

Example #

img

import 'package:vehicle_keyboard/vehicle_keyboard.dart';

class SecondScreenState extends State<SecondScreen> {
  bool showKeyboard = false;

  TextEditingController controller = new TextEditingController();


  /// 键盘的整体回调,根据不同的按钮事件来进行相应的逻辑实现
  void _onKeyDown(KeyDownEvent data) {
    debugPrint("keyEvent:" + data.key);

    if (data.isClose() || data.isCommit()) {
      setState(() {
        showKeyboard = false;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    //设置适配尺寸 (填入设计稿中设备的屏幕尺寸)
    ScreenUtil.instance = ScreenUtil(width: 1080, height: 1920)..init(context);
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('车牌键盘'),
        backgroundColor: Colors.lightBlue,
      ),
      body: new Center(
          child: Column(
        children: <Widget>[
          TextField(
            decoration: InputDecoration(
              border: UnderlineInputBorder(),
              labelText: '请输入车牌',
            ),
            controller: controller,
            focusNode: FocusNode(canRequestFocus: false),
            onTap: () {
              setState(() {
                showKeyboard = true;
              });
            },
          ),
          RaisedButton(
            child: Text("隐藏/显示"),
            onPressed: () {
              setState(() {
                showKeyboard = !showKeyboard;
              });
            },
          )
        ],
      )),
      bottomNavigationBar: showKeyboard ? VehicleKeyboard(_onKeyDown,controller) : null,
    );
  }
}

To Do List #

[0.0.4] - 2019.9.27 #

  • 增加示例、升级依赖库版本

[0.0.3] - 2019.9.27 #

  • 增加示例

[0.0.2] - 2019.9.26 #

  • 增加示例代码

[0.0.1] - 2019.9.26 #

Use this package as a library

1. Depend on it

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


dependencies:
  vehicle_keyboard: ^0.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:vehicle_keyboard/vehicle_keyboard.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
4
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

We analyzed this package on Jul 8, 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

Analysis suggestions

Package not compatible with SDK dart

because of import path [vehicle_keyboard] that is in a package requiring null.

Health suggestions

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

Analysis of lib/vehicle_keyboard.dart reported 1 hint:

line 7 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: VehicleKeyboard.controller

Maintenance issues and suggestions

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

Support latest dependencies. (-10 points)

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

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and vehicle_keyboard.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_screenutil ^0.7.0 0.7.0 2.2.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test