simple_line_chart 1.5.1 simple_line_chart: ^1.5.1 copied to clipboard
Provides a simple line chart. An opinionated library that focuses on API simplicity.
import 'package:flutter/material.dart';
import 'line_chart_content.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData.light(),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Line Chart Example"),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.only(left: 16, right: 16),
child: LayoutBuilder(builder:
(BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewportConstraints.maxHeight,
),
child: LineChartContent()));
}))),
);
}
}