Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom scrollview refactor #17

Merged
merged 25 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8ad9f62
Label column
lpickford-pixelbeard Feb 20, 2024
7be76a9
Implemented grids
lpickford-pixelbeard Feb 20, 2024
b4c5e68
cellWidth
lpickford-pixelbeard Feb 20, 2024
fc873c4
dates
lpickford-pixelbeard Feb 20, 2024
0acd8b4
Cells now rendered on a canvas again
lpickford-pixelbeard Feb 21, 2024
3bd47c8
taskBar height
lpickford-pixelbeard Feb 21, 2024
776e19d
max height on taskBar
lpickford-pixelbeard Feb 21, 2024
8806b80
Scroll listeners
lpickford-pixelbeard Feb 21, 2024
0b9e6b0
Simplified tree
lpickford-pixelbeard Feb 21, 2024
2260f1a
Grid Rows and Tooltips reimplemented
lpickford-pixelbeard Feb 21, 2024
e993ba3
Render area fix
lpickford-pixelbeard Feb 22, 2024
697332d
Controller simplified
lpickford-pixelbeard Feb 22, 2024
1bff629
Controller moved down the tree
lpickford-pixelbeard Feb 22, 2024
0ec76c0
Label grid
lpickford-pixelbeard Feb 22, 2024
78d7890
Styling fixes
lpickford-pixelbeard Feb 22, 2024
cef280e
Axes dividers
lpickford-pixelbeard Feb 22, 2024
26bc789
tooltip position fix
lpickford-pixelbeard Feb 22, 2024
4a540fb
Content split into separate files
lpickford-pixelbeard Feb 22, 2024
652e127
dataHeight fix
lpickford-pixelbeard Feb 22, 2024
705e78d
Cleanup
lpickford-pixelbeard Feb 22, 2024
845f32d
Date labels are now fully customisable
lpickford-pixelbeard Feb 22, 2024
123ad38
Redundant tests removed
lpickford-pixelbeard Feb 22, 2024
edc9682
Cleanup
lpickford-pixelbeard Feb 22, 2024
d1c647f
Readme updates
lpickford-pixelbeard Feb 22, 2024
9f6b5dd
Dispose controllers
lpickford-pixelbeard Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cellWidth
  • Loading branch information
lpickford-pixelbeard committed Feb 20, 2024
commit b4c5e681b5877ae5da7949a46dcdbd7ea92c82bf
39 changes: 21 additions & 18 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const MaterialApp(
home: MyHomePage(),
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
),
home: const MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
Expand Down Expand Up @@ -70,7 +73,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: GanttChart(
controller: _controller,
grid: const GanttGrid(
columnWidth: 40,
columnWidth: 100,
rowSpacing: 0,
timelineAxisType: TimelineAxisType.daily,
tooltipType: TooltipType.tap,
Expand All @@ -79,24 +82,24 @@ class _MyHomePageState extends State<MyHomePage> {
taskBarColor: Colors.blue.shade400,
activityLabelColor: Colors.blue.shade100,
taskLabelColor: Colors.blue.shade900,
// taskLabelBuilder: (task) => Container(
// padding: const EdgeInsets.all(8),
// child: Text(task.label),
// ),
taskLabelBuilder: (task) => Container(
padding: const EdgeInsets.all(8),
child: Text(task.label),
),
gridColor: Colors.grey.shade300,
taskBarRadius: 6,
activityLabelStyle: Theme.of(context).textTheme.labelLarge,
// activityLabelBuilder: (activity) => Container(
// padding: const EdgeInsets.all(8),
// color: Colors.blue,
// child: Text(
// activity.label,
// style: const TextStyle(
// fontWeight: FontWeight.bold,
// color: Colors.white,
// ),
// ),
// ),
activityLabelBuilder: (activity) => Container(
padding: const EdgeInsets.all(8),
color: Colors.blue,
child: Text(
activity.label,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
titleStyle: Theme.of(context).textTheme.titleLarge,
titlePadding: const EdgeInsets.only(
left: 8,
Expand Down
8 changes: 5 additions & 3 deletions lib/src/gantt_chart_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class GanttChartContentState<T> extends State<GanttChartContent<T>> {
labelColumnWidth: widget.config.labelColumnWidth,
title: widget.config.style.chartTitleBuilder?.call(),
timelineHeight: widget.config.timelineHeight,
itemBuilder: (context, index) => widget.config.style
.dateLabelBuilder(
widget.controller.startDate.add(Duration(days: index))),
itemBuilder: (context, index) => SizedBox(
width: widget.config.cellWidth,
child: widget.config.style.dateLabelBuilder(
widget.controller.startDate.add(Duration(days: index))),
),
dateScrollController: _dateScrollController,
columnCount: widget.controller.columnCount,
),
Expand Down