GithubHelp home page GithubHelp logo

dulumao / flutter-candlesticks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huobiapp/flutter-candlesticks

0.0 1.0 0.0 12.66 MB

Flutter candlesticks package

License: MIT License

Java 1.97% Objective-C 2.71% Dart 90.59% Ruby 4.72%

flutter-candlesticks's Introduction

flutter-candlesticks

基于Flutter实现k线功能

目前为测试版本,功能还在完善中

版本号

v0.1.0

demo示例

gif

主要功能

  • K线蜡烛图,交易量柱状图,MA5,MA10,MA30
  • 可滑动,可缩放
  • 基于rxDart,BLoC 状态管理,数据与视图分离

使用方法

在pubspec.yaml ependencies:下添加package

dependencies:
  candleline:
    path: ../../package path为package实际路径

引入candleline

import 'package:candleline/candleline.dart';

初始化bloc

class KlinePageBloc extends KlineBloc {
  @override
  //重写init方法
  void initData() {
      //...获取数据
      //处理成 List<KlineData> 格式
      List<KlineData> list = List<KlineData>();
      //数据返回后调用 updateDataList(list)传递数据
      this.updateDataList(list);
    });
    super.initData();
  }
}

初始化klineView

void _pushToKline() {
    KlinePageBloc bloc = KlinePageBloc();
    Navigator.push(context, MaterialPageRoute(builder: (context) {
      return Scaffold(
          appBar: AppBar(
            title: Text('klineDemo'),
          ),
          body: Container(
            margin: EdgeInsets.only(top: 10, bottom: 20),
            child: KlinePage(bloc: bloc))
          );
    }));
  }

flutter-candlesticks's People

Contributors

enoughpower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.