simple_component_z 0.0.5

Flutter Android iOS

Flutter plugin component. Include singlerow selecto, button. just accelerate development efficiency.

simple_component_z #

A new Flutter component package project.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

可点击按钮 Example #

import 'package:simple_component_z/simple_button.dart';

SimpleButton(
    onTap: () => {print('点击')},
    child: Text('ZSimpleButton--》'),
),
参数类型描述
radiusdouble圆角
onTapFunction分页指示器与容器边框的距离
childWidget内部的控件
elevationdouble阴影"高度"
backgroundColorColor背景颜色
splashColorColor点击的水波纹颜色
onLongTapFunction长按回调

picker Example #

import 'package:simple_component_z/simple_picker.dart';
List<List> _cityList = [['杭州', '北京', '上海', '大连']];

 List _cityVal;

void handleConfirm(List selectedLabel, List<int> selecteds) {
  setState(() {
    this._cityVal = selectedLabel;
  });
}

new FlatButton(
  onPressed: () {
    new SimplePicker(
      selectItem: this._cityList,
      onConfirmFunc: handleConfirm,
    ).showModal(context);
  },
  child: new Text(this._cityVal != null && this._cityVal.length > 0 ?
    this._cityVal.join('') : '打开城市选择器' ),
  color: Colors.blue,
),
参数类型描述
selectItemList选择的内容
onChangeFuncPickerChangeCallback改变某列的回调函数
onConfirmFuncPickerConfirmCallback点击确定的回调函数

upload Example #

import 'package:simple_component_z/simple_upload.dart';

new SimpleUpload(
  takeWay: TakeWay.all,
  onSuccessFunc: (TakeWay type, File file) {
  },
).showModal(context);
参数类型描述
onSuccessFuncPickerChangeCallback上传内容选择成功回调 必填
labelStyleTextStyle上传文案样式
takeWayTakeWay上传图片 视频

ExpandText Example #

import 'package:simple_component_z/expandtext_panel.dart';
String longText = '超过最大行数三行的多ewqe行文本超过\n最大行数\n三行\n的多行文本超过最大行数三行的多行文本'
      '超过最大行数三行的多行文本超过最大行数三行的多行43132文本超过最大行数三行的多行文本超过最大行数三行的多行文本';

ExpandTextPanel(
  text: longText,
  maxLines: 3,
  expandItem: Row(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
      Text(
        '展开',
        style: TextStyle(
          fontSize: 24,
        ),
      ),
    ],
  ),
  putawayItem: Row(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
      Text(
        '收起',
        style: TextStyle(
          fontSize: 24,
        ),
      ),
    ],
  ),
  style:
      TextStyle(fontSize: 26),
),
参数类型描述
textString文本
maxLinesint显示几行
styleTextStyle文字样式
isExpandbool一开始是否展开
expandItemString/widget若是widget直接显示,展开部件
putawayItemString/widget若是widget直接显示,收起部件
1
likes
70
pub points
41%
popularity

Flutter plugin component. Include singlerow selecto, button. just accelerate development efficiency.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

tzzf0921@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, image_picker

More

Packages that depend on simple_component_z