flutter_agenda 1.0.0 flutter_agenda: ^1.0.0 copied to clipboard
Beautiful Agenda Widget Package for Flutter
import 'package:flutter/material.dart';
import 'package:flutter_agenda/flutter_agenda.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: AgendaView(
pillarList: _buildPillar(),
agendaStyle: AgendaStyle(),
),
),
);
}
List<Pillar> _buildPillar() {
return [
Pillar(
head: PillarHead(name: 'Pillar 1'.toUpperCase()),
events: [
AgendaEvent(
title: 'Event D',
subtitle: 'CC',
start: EventTime(hour: 8, minute: 0),
end: EventTime(hour: 10, minute: 0),
),
AgendaEvent(
title: 'Event Z',
subtitle: 'SV',
start: EventTime(hour: 12, minute: 0),
end: EventTime(hour: 13, minute: 20),
),
],
),
Pillar(
head: PillarHead(name: 'Pillar 2'.toUpperCase()),
events: [
AgendaEvent(
title: 'Event G',
subtitle: 'FE',
start: EventTime(hour: 9, minute: 10),
end: EventTime(hour: 11, minute: 45),
),
],
),
Pillar(
head: PillarHead(name: 'Pillar 3'.toUpperCase(), textColor: Colors.red),
events: [
AgendaEvent(
title: 'Event A',
subtitle: 'DE',
start: EventTime(hour: 10, minute: 10),
end: EventTime(hour: 11, minute: 45),
),
],
),
];
}
}