graphic_representation 0.0.6 graphic_representation: ^0.0.6 copied to clipboard
easy graphic representation, using classes likes DiscreteGraphic for example. You can easily adapt your graphic with your android or ios device screen.
import 'package:flutter/material.dart';
import 'package:graphic_representation/graphic_representation.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Graphic_Representation : example'),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
"PRECIPITATIONS (mm)",
style: TextStyle(fontWeight: FontWeight.bold),
textScaleFactor: 1.6,
)),
DiscreteGraphic(
size: Size(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height * 0.4),
nums: [1, 2, 5, 3, 7, 13, 7],
listGradX: [
"Lun",
"Mar",
"Mer",
"Jeu",
"Ven",
"Sam",
"Dim",
],
colorAxes: Colors.black,
nbGradY: 10,
colorPoint: Colors.blue,
colorLine: Colors.blue,
minY: 0,
maxY: 20,
),
DiscreteGraphic(
size: Size(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height * 0.4),
nums: [1, 2, 5, 3, 7, 13, 7],
listGradX: [
"Lun",
"Mar",
"Mer",
"Jeu",
"Ven",
"Sam",
"Dim",
],
colorAxes: Colors.black,
nbGradY: 10,
colorBox: Colors.red,
boxWidth: 15.0,
minY: 0,
maxY: 20,
),
],
),
);
}
}