diff --git a/file_icon/CHANGELOG.md b/file_icon/CHANGELOG.md index 280de80..83f94c4 100644 --- a/file_icon/CHANGELOG.md +++ b/file_icon/CHANGELOG.md @@ -1,12 +1,40 @@ -## [0.3.0] - 2020-02-10 +# [1.0.0](https://github.com/git-touch/file-icon/compare/v0.3.0...v1.0.0) (2021-03-07) -- Rename to `file_icon` -- update `seti-ui` from upstream +### Bug Fixes -## [0.2.0] - 2019-09-11 +- broken soft link ([3857ebb](https://github.com/git-touch/file-icon/commit/3857ebbbcc777106aae3c4c8fc1490d66cc7a502)) +- example file_icon deps ([3f6afe3](https://github.com/git-touch/file-icon/commit/3f6afe32d21bd379052178e6a6bca72cdb45afd7)) -- Refactor +### Features -## [0.1.0] - 2019-09-09 +- null safety ([10777eb](https://github.com/git-touch/file-icon/commit/10777eba5a97e4015ccdfe7b23798309c9e5c2b0)) -- First release +# [0.3.0](https://github.com/git-touch/file-icon/compare/v0.2.0...v0.3.0) (2020-02-10) + +### Bug Fixes + +- copy font dest ([3fe9b4f](https://github.com/git-touch/file-icon/commit/3fe9b4fddb185be276b13a3f750d503edee21d08)) +- drop generated code ([a25d8ed](https://github.com/git-touch/file-icon/commit/a25d8ed0d6a121799a7c434ebf12e16c300a1bf0)) +- font package ([92bc697](https://github.com/git-touch/file-icon/commit/92bc697ed836c69dbbddd660eb75932fc20143be)) + +# [0.2.0](https://github.com/git-touch/file-icon/compare/v0.1.0...v0.2.0) (2019-09-11) + +### Bug Fixes + +- extension match ([d546c0f](https://github.com/git-touch/file-icon/commit/d546c0f4c18843fcb543509a46a3c83ca20a994a)) +- remove font package for web ([15e97ea](https://github.com/git-touch/file-icon/commit/15e97eae5c56658cbe61b93d7791c0343258432d)) + +### Features + +- **gallery:** adjust name and size ([e5c2395](https://github.com/git-touch/file-icon/commit/e5c2395b0aa64826ff6740bed64e9da976d947f9)) + +# [0.1.0](https://github.com/git-touch/file-icon/compare/c9eab3ee12b57ea535badec60bbcff3456c0ebff...v0.1.0) (2019-09-09) + +### Bug Fixes + +- add default icon and color ([c66af33](https://github.com/git-touch/file-icon/commit/c66af3376b1062a9eed7951bd11f8a3f930760ae)) +- add font package field ([17a6495](https://github.com/git-touch/file-icon/commit/17a6495952795d1799b214612ccee596dedde902)) + +### Features + +- add widget to show icon by file name ([c9eab3e](https://github.com/git-touch/file-icon/commit/c9eab3ee12b57ea535badec60bbcff3456c0ebff)) diff --git a/file_icon/README.md b/file_icon/README.md index 691d0d5..8aef271 100644 --- a/file_icon/README.md +++ b/file_icon/README.md @@ -19,6 +19,9 @@ class MyWidget extends StatelessWidget { // Icon size size: 32, + + // Override icon color + color: Colors.black, ); } } diff --git a/file_icon/lib/file_icon.dart b/file_icon/lib/file_icon.dart index 6189426..f5ca72a 100644 --- a/file_icon/lib/file_icon.dart +++ b/file_icon/lib/file_icon.dart @@ -3,14 +3,15 @@ import 'src/data.dart'; class FileIcon extends StatelessWidget { final String fileName; - final double size; + final double? size; + final Color? color; - FileIcon(String fileName, {this.size}) + FileIcon(String fileName, {this.size, this.color}) : this.fileName = fileName.toLowerCase(); @override Widget build(BuildContext context) { - String key; + String? key; if (iconSetMap.containsKey(fileName)) { key = fileName; @@ -32,11 +33,11 @@ class FileIcon extends StatelessWidget { return Icon( IconData( - iconSetMap[key].codePoint, + iconSetMap[key]!.codePoint, fontFamily: 'Seti', fontPackage: 'file_icon', ), - color: Color(iconSetMap[key].color), + color: color ?? Color(iconSetMap[key]!.color), size: size, ); } diff --git a/file_icon/pubspec.yaml b/file_icon/pubspec.yaml index ddaa16e..5e74f00 100644 --- a/file_icon/pubspec.yaml +++ b/file_icon/pubspec.yaml @@ -1,11 +1,11 @@ name: file_icon description: File icons for different file types, auto detected by file name. -version: 0.3.0 +version: 1.0.0 author: Rongjian Zhang homepage: https://github.com/pd4d10/file-icon environment: - sdk: ">=2.3.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: