graph_package 0.0.6 copy "graph_package: ^0.0.6" to clipboard
graph_package: ^0.0.6 copied to clipboard

HR Zones Graph by passing required data through json file you can give your own title through same json file

example/example.md

Example #

import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:graph_package/graph_package.dart';

void main() => runApp(const MaterialApp(
  home: Mygraph(),
  debugShowCheckedModeBanner: false,
));

class Mygraph extends StatefulWidget {
  const Mygraph({Key? key}) : super(key: key);
  @override
  State<Mygraph> createState() => _MygraphState();
}

class _MygraphState extends State<Mygraph> {
  Map<String, dynamic>? myData;
  @override
  void initState() {
    readjs();
    super.initState();
  }
  void readjs() async {
    myData = json.decode(await rootBundle.loadString('chart_data.json'));
  }
  @override
  Widget build(BuildContext context) {
    var scrsize=MediaQuery.of(context).size;
    if(myData != null){
      return Scaffold(
        body: CustomPaint(
          painter:Graphcls(myData!),
          // ignore: sized_box_for_whitespace
          child: Container(width: scrsize.width,height: scrsize.height),
        ),
      );
    }
    return const Scaffold(body: Center(child: SizedBox(height: 50, width: 50,child: CircularProgressIndicator(),),),);
  }
}
0
likes
160
points
40
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

HR Zones Graph by passing required data through json file you can give your own title through same json file

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on graph_package