-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,855 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
channel: unknown | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
- platform: macos | ||
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks that | ||
# you configure in VS Code that you might want include in version control, | ||
# so this line is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
macos/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
.fvm/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio places build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
channel: unknown | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
- platform: macos | ||
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# example | ||
|
||
A new Flutter project. | ||
|
||
## Getting Started | ||
|
||
This project is a starting point for a Flutter application. | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
|
||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) | ||
|
||
For help getting started with Flutter development, view the | ||
[online documentation](https://docs.flutter.dev/), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include: package:flutter_lints/flutter.yaml | ||
linter: | ||
rules: | ||
camel_case_types: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extension String_Extension on String { | ||
String addX() { | ||
return this + "x"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:atreeon_datagrid_responsive/ReusableDataGridW.dart'; | ||
import 'package:atreeon_datagrid_responsive/common.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:intl/intl.dart'; | ||
|
||
final data = { | ||
DateTime(2022, 12, 20): 1, | ||
DateTime(2022, 12, 12): 2, | ||
DateTime(2022, 11, 15): 3, | ||
DateTime(2022, 11, 3): 4, | ||
DateTime(2022, 11, 01): 5, | ||
DateTime(2022, 10, 24): 6, | ||
}.entries.map((e) => MapEntry(e.key, e.value)).toList(); | ||
|
||
class DataGridDateDemo extends StatefulWidget { | ||
@override | ||
_DataGridDateDemoState createState() => _DataGridDateDemoState(); | ||
} | ||
|
||
class _DataGridDateDemoState extends State<DataGridDateDemo> { | ||
var dateUpdated = DateTime.now(); | ||
|
||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Column( | ||
children: [ | ||
ResusableDatagridW<MapEntry<DateTime, int>>( | ||
maxHeight: 300, | ||
data: data, | ||
fields: [ | ||
Field((x) => x.key, "key", FilterFieldString(), format: (x) => DateFormat('dd MMM yy').format(x.key)), | ||
Field((x) => x.value, "value", FilterFieldString()), | ||
], | ||
onRowClick: (x) => print(x.toString()), | ||
lastSaveDate: dateUpdated, | ||
onSelect: (x) => // | ||
print(x.toString()), | ||
selectName: "Delete", | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
example/lib/datagrid/DataGridFilterSelectableItemsDemo.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import 'package:atreeon_datagrid_responsive/ReusableDataGridW.dart'; | ||
import 'package:atreeon_datagrid_responsive/common.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// Class of Items | ||
class Item { | ||
int id; | ||
String name; | ||
|
||
Item(this.id, this.name); | ||
} | ||
|
||
enum Item$ { name, ram } | ||
|
||
var originalData = <Item>[ | ||
Item(1, "Adrian"), | ||
Item(2, "B"), | ||
Item(3, "CX"), | ||
Item(4, "C"), | ||
Item(5, "D"), | ||
Item(6, "E"), | ||
Item(7, "F"), | ||
Item(11, "Adrian"), | ||
Item(12, "B"), | ||
Item(13, "CX"), | ||
Item(14, "C"), | ||
Item(15, "D"), | ||
Item(16, "E"), | ||
Item(17, "F"), | ||
Item(21, "Adrian"), | ||
Item(22, "B"), | ||
Item(23, "CX"), | ||
Item(24, "C"), | ||
Item(25, "D"), | ||
Item(26, "E"), | ||
Item(27, "F"), | ||
Item(31, "Adrian"), | ||
Item(32, "B"), | ||
Item(33, "CX"), | ||
Item(34, "C"), | ||
Item(35, "D"), | ||
Item(36, "E"), | ||
Item(37, "F"), | ||
]; | ||
|
||
var ramLookup = {64: "sixtyfour", 1: "one", 128: "1two8"}; | ||
|
||
class DataGridFilterSelectableItemsDemo extends StatelessWidget { | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Column( | ||
children: [ | ||
Expanded( | ||
child: ResusableDatagridW<Item>( | ||
data: originalData, | ||
fields: [ | ||
Field((x) => x.id, "id", FilterFieldNum()), | ||
Field((x) => x.name, "name", FilterFieldString()), | ||
], | ||
onRowClick: (x) => print(x.toString()), | ||
lastSaveDate: null, | ||
identityFieldId: Field((x) => x.id, "id", FilterFieldNum()), | ||
onSelect: (x) => // | ||
print(x.toString()), | ||
selectName: "Delete", | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:atreeon_datagrid_responsive/ReusableDataGridW.dart'; | ||
import 'package:atreeon_datagrid_responsive/common.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// Class of Items | ||
class Item { | ||
String name; | ||
int ram; | ||
int price; | ||
int storage; | ||
|
||
Item(this.name, this.ram, this.price, this.storage); | ||
} | ||
|
||
enum Item$ { name, ram, price, storage } | ||
|
||
var originalData = List<Item>.generate( | ||
2000, | ||
(i) => // | ||
Item("id: $i", i * 2, i ~/ 2, i + 500)); | ||
|
||
var ramLookup = {64: "sixtyfour", 1: "one", 128: "1two8"}; | ||
|
||
class DataGridFilterSortSetDemo extends StatelessWidget { | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Column( | ||
children: [ | ||
Expanded( | ||
child: ResusableDatagridW<Item>( | ||
data: originalData, | ||
fields: [ | ||
Field<Item>((x) => x.name, "name", FilterFieldString(searchText: "1")), | ||
Field<Item>( | ||
(x) => (ramLookup[x.ram] ?? x.ram.toString()) + "x", | ||
"ram", | ||
FilterFieldNum(), | ||
fieldDefForSortFilter: (x) => x.ram, | ||
), | ||
Field<Item>((x) => x.price, "price", FilterFieldNum()), | ||
Field<Item>((x) => x.storage, "storage", FilterFieldNum()), | ||
], | ||
onRowClick: (x) => print(x.toString()), | ||
lastSaveDate: null, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:atreeon_datagrid_responsive/ReusableDataGridW.dart'; | ||
import 'package:atreeon_datagrid_responsive/common.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/* | ||
This proved too difficult and fiddly and not worth it | ||
*/ | ||
|
||
/// Class of Items | ||
class Item { | ||
String name; | ||
int ram; | ||
int price; | ||
int storage; | ||
|
||
Item(this.name, this.ram, this.price, this.storage); | ||
} | ||
|
||
enum Item$ { name, ram, price, storage } | ||
|
||
var originalData = List<Item>.generate( | ||
4, | ||
(i) => // | ||
Item("id: $i", i * 2, i ~/ 2, i + 500)); | ||
|
||
var ramLookup = {64: "sixtyfour", 1: "one", 128: "1two8"}; | ||
|
||
class DataGridHidePaginationDemo extends StatelessWidget { | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: ResusableDatagridW<Item>( | ||
data: originalData, | ||
fields: [ | ||
Field<Item>((x) => x.name, "name", FilterFieldString()), | ||
Field<Item>((x) => ramLookup[x.ram] ?? x.ram.toString(), "ram", FilterFieldNum()), | ||
Field<Item>((x) => x.price, "price", FilterFieldNum()), | ||
Field<Item>((x) => x.storage, "storage", FilterFieldNum()), | ||
], | ||
onRowClick: (x) => print(x.toString()), | ||
lastSaveDate: null, | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.