Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git-touch/file-icon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: braverhealth/file-icon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Oct 10, 2023

  1. upgrade dart and fix issues

    matehat committed Oct 10, 2023
    Copy the full SHA
    7c1aa57 View commit details
  2. allow overriding color

    matehat committed Oct 10, 2023
    Copy the full SHA
    17d17e0 View commit details

Commits on Oct 13, 2023

  1. fix build on web

    matehat committed Oct 13, 2023
    Copy the full SHA
    c2d74ec View commit details
Showing with 324 additions and 343 deletions.
  1. +1 −1 file_icon/example/lib/main.dart
  2. +3 −2 file_icon/example/pubspec.yaml
  3. +9 −9 file_icon/lib/file_icon.dart
  4. +309 −326 file_icon/lib/src/data.dart
  5. +2 −3 file_icon/pubspec.yaml
  6. +0 −2 file_icon/test/file_icon_test.dart
2 changes: 1 addition & 1 deletion file_icon/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ class _MyHomePageState extends State<MyHomePage> {
InkWell(
child: FileIcon('.html', size: 32),
onTap: () {
launch('https://github.com/pd4d10/file-icon');
launchUrl(Uri.parse('https://github.com/pd4d10/file-icon'));
},
)
],
5 changes: 3 additions & 2 deletions file_icon/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -12,14 +12,15 @@ description: A new Flutter project.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
flutter:
sdk: flutter
url_launcher: ^5.4.1
url_launcher: ^6.1.14
file_icon:
path: ..

18 changes: 9 additions & 9 deletions file_icon/lib/file_icon.dart
Original file line number Diff line number Diff line change
@@ -4,13 +4,17 @@ import 'src/data.dart';
class FileIcon extends StatelessWidget {
final String fileName;
final double size;
final Color? color;

FileIcon(String fileName, {this.size})
: this.fileName = fileName.toLowerCase();
FileIcon(
String fileName, {
required this.size,
this.color,
}) : this.fileName = fileName.toLowerCase();

@override
Widget build(BuildContext context) {
String key;
String? key;

if (iconSetMap.containsKey(fileName)) {
key = fileName;
@@ -31,12 +35,8 @@ class FileIcon extends StatelessWidget {
}

return Icon(
IconData(
iconSetMap[key].codePoint,
fontFamily: 'Seti',
fontPackage: 'file_icon',
),
color: Color(iconSetMap[key].color),
iconSetMap[key]!,
color: color ?? Color(0x00),
size: size,
);
}
Loading