68 lines
1.5 KiB
Dart
68 lines
1.5 KiB
Dart
import 'package:fl_chart/fl_chart.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'dart:math';
|
|
|
|
void main() {
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Flutter Demo',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
useMaterial3: true,
|
|
),
|
|
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
|
);
|
|
}
|
|
}
|
|
|
|
class MyHomePage extends StatefulWidget {
|
|
const MyHomePage({super.key, required this.title});
|
|
|
|
final String title;
|
|
|
|
@override
|
|
State<MyHomePage> createState() => _MyHomePageState();
|
|
}
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(20),
|
|
child: Center(
|
|
child: Text("Demo"),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ChartData {
|
|
ChartData({required this.name, required this.gpa, required this.year});
|
|
|
|
String name;
|
|
int gpa;
|
|
int year;
|
|
|
|
static List<ChartData> exampleData() {
|
|
return [
|
|
ChartData(name: "John", gpa: 2, year: 1),
|
|
ChartData(name: "Jane", gpa: 3, year: 2),
|
|
ChartData(name: "John Doe", gpa: 2, year: 1),
|
|
ChartData(name: "Jane Doe", gpa: 3, year: 2),
|
|
ChartData(name: "Doe", gpa: 4, year: 3),
|
|
];
|
|
}
|
|
}
|