simple_line_chart 1.0.0 copy "simple_line_chart: ^1.0.0" to clipboard
simple_line_chart: ^1.0.0 copied to clipboard

outdated

A simple line chart widget.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'line_chart_content.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData.light(),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage();

  @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()));
              }))),
    );
  }
}