diff --git a/CHANGELOG.md b/CHANGELOG.md index bb679e6..fea4438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,3 +28,12 @@ * Update readme for Windows users contributors * Add few new logos + +## 1.0.5 + +* Add crypto logos +* Improve tests +* add badges +* Fix minor bug and enhancements + + diff --git a/README.md b/README.md index 305c56d..ab86af0 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Add `flutter_any_logo` as a dependency in your `pubspec.yaml` file. ``` dependencies: - flutter_any_logo: ^1.0.4 + flutter_any_logo: ^1.0.5 ``` Then, run `flutter pub get` in your terminal to install the plugin. @@ -191,6 +191,17 @@ AnyLogo.auto.bugatti AnyLogo.auto.bmw AnyLogo.auto.mercedesBenz +/// Crypto section contains crypto related logos 💰 +AnyLogo.crypto.bitcoin +AnyLogo.crypto.iota +AnyLogo.crypto.cardano + +/// Badges section contains badges related logos ⬇️ +AnyLogo.badges.playstoreDownload +AnyLogo.badges.appstoreDownload +AnyLogo.badges.amazonDownload + + ``` ### Warning ⚠️ diff --git a/assets/badges/amazonDownload.png b/assets/badges/amazonDownload.png new file mode 100644 index 0000000..ed28425 Binary files /dev/null and b/assets/badges/amazonDownload.png differ diff --git a/assets/badges/appstoreDownload.png b/assets/badges/appstoreDownload.png new file mode 100644 index 0000000..8e91eb3 Binary files /dev/null and b/assets/badges/appstoreDownload.png differ diff --git a/assets/badges/microsoftDownload.png b/assets/badges/microsoftDownload.png new file mode 100644 index 0000000..4491948 Binary files /dev/null and b/assets/badges/microsoftDownload.png differ diff --git a/assets/badges/playstoreDownload.png b/assets/badges/playstoreDownload.png new file mode 100644 index 0000000..5d448e5 Binary files /dev/null and b/assets/badges/playstoreDownload.png differ diff --git a/assets/badges/windowsDownload.png b/assets/badges/windowsDownload.png new file mode 100644 index 0000000..84792e4 Binary files /dev/null and b/assets/badges/windowsDownload.png differ diff --git a/assets/crypto/bitbay.png b/assets/crypto/bitbay.png new file mode 100644 index 0000000..6732721 Binary files /dev/null and b/assets/crypto/bitbay.png differ diff --git a/assets/crypto/bitcoin.png b/assets/crypto/bitcoin.png new file mode 100644 index 0000000..19a98ee Binary files /dev/null and b/assets/crypto/bitcoin.png differ diff --git a/assets/crypto/bitcoinIcon.png b/assets/crypto/bitcoinIcon.png new file mode 100644 index 0000000..05da251 Binary files /dev/null and b/assets/crypto/bitcoinIcon.png differ diff --git a/assets/crypto/bitmex.png b/assets/crypto/bitmex.png new file mode 100644 index 0000000..01683e8 Binary files /dev/null and b/assets/crypto/bitmex.png differ diff --git a/assets/crypto/bitquick.png b/assets/crypto/bitquick.png new file mode 100644 index 0000000..0881f6a Binary files /dev/null and b/assets/crypto/bitquick.png differ diff --git a/assets/crypto/bitstamp.png b/assets/crypto/bitstamp.png new file mode 100644 index 0000000..a0c8f12 Binary files /dev/null and b/assets/crypto/bitstamp.png differ diff --git a/assets/crypto/bitt.png b/assets/crypto/bitt.png new file mode 100644 index 0000000..e39e4d6 Binary files /dev/null and b/assets/crypto/bitt.png differ diff --git a/assets/crypto/cardano.png b/assets/crypto/cardano.png new file mode 100644 index 0000000..dc41503 Binary files /dev/null and b/assets/crypto/cardano.png differ diff --git a/assets/crypto/coinMama.png b/assets/crypto/coinMama.png new file mode 100644 index 0000000..3cbf42d Binary files /dev/null and b/assets/crypto/coinMama.png differ diff --git a/assets/crypto/coinbase.png b/assets/crypto/coinbase.png new file mode 100644 index 0000000..73e8845 Binary files /dev/null and b/assets/crypto/coinbase.png differ diff --git a/assets/crypto/coinspot.png b/assets/crypto/coinspot.png new file mode 100644 index 0000000..7013a87 Binary files /dev/null and b/assets/crypto/coinspot.png differ diff --git a/assets/crypto/crypterium.png b/assets/crypto/crypterium.png new file mode 100644 index 0000000..0577719 Binary files /dev/null and b/assets/crypto/crypterium.png differ diff --git a/assets/crypto/cryptoStix.png b/assets/crypto/cryptoStix.png new file mode 100644 index 0000000..b51e2a1 Binary files /dev/null and b/assets/crypto/cryptoStix.png differ diff --git a/assets/crypto/cryptosumer.png b/assets/crypto/cryptosumer.png new file mode 100644 index 0000000..c953b59 Binary files /dev/null and b/assets/crypto/cryptosumer.png differ diff --git a/assets/crypto/dogecoin.png b/assets/crypto/dogecoin.png new file mode 100644 index 0000000..f10f500 Binary files /dev/null and b/assets/crypto/dogecoin.png differ diff --git a/assets/crypto/ethereum.png b/assets/crypto/ethereum.png new file mode 100644 index 0000000..35d608e Binary files /dev/null and b/assets/crypto/ethereum.png differ diff --git a/assets/crypto/ethereumIcon.png b/assets/crypto/ethereumIcon.png new file mode 100644 index 0000000..9d7b6b7 Binary files /dev/null and b/assets/crypto/ethereumIcon.png differ diff --git a/assets/crypto/iota.png b/assets/crypto/iota.png new file mode 100644 index 0000000..b3952d1 Binary files /dev/null and b/assets/crypto/iota.png differ diff --git a/assets/crypto/kraken.png b/assets/crypto/kraken.png new file mode 100644 index 0000000..63b9290 Binary files /dev/null and b/assets/crypto/kraken.png differ diff --git a/assets/crypto/litecoin.png b/assets/crypto/litecoin.png new file mode 100644 index 0000000..1a60c8e Binary files /dev/null and b/assets/crypto/litecoin.png differ diff --git a/assets/crypto/monero.png b/assets/crypto/monero.png new file mode 100644 index 0000000..c0e34d1 Binary files /dev/null and b/assets/crypto/monero.png differ diff --git a/assets/crypto/ripple.png b/assets/crypto/ripple.png new file mode 100644 index 0000000..ae5d543 Binary files /dev/null and b/assets/crypto/ripple.png differ diff --git a/assets/crypto/rippleIcon.png b/assets/crypto/rippleIcon.png new file mode 100644 index 0000000..7c5da90 Binary files /dev/null and b/assets/crypto/rippleIcon.png differ diff --git a/assets/crypto/spectroCoin.png b/assets/crypto/spectroCoin.png new file mode 100644 index 0000000..33d8e19 Binary files /dev/null and b/assets/crypto/spectroCoin.png differ diff --git a/assets/crypto/steem.png b/assets/crypto/steem.png new file mode 100644 index 0000000..7177392 Binary files /dev/null and b/assets/crypto/steem.png differ diff --git a/assets/crypto/stellar.png b/assets/crypto/stellar.png new file mode 100644 index 0000000..28c273d Binary files /dev/null and b/assets/crypto/stellar.png differ diff --git a/assets/crypto/tron.png b/assets/crypto/tron.png new file mode 100644 index 0000000..1291252 Binary files /dev/null and b/assets/crypto/tron.png differ diff --git a/assets/crypto/xapo.png b/assets/crypto/xapo.png new file mode 100644 index 0000000..3aef7f1 Binary files /dev/null and b/assets/crypto/xapo.png differ diff --git a/example/android/build.gradle b/example/android/build.gradle index 58a8c74..713d7f6 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/lib/main.dart b/example/lib/main.dart index b03c274..edfb027 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_any_logo/flutter_logo.dart'; -import 'package:flutter_any_logo/gen/assets.gen.dart'; void main() { runApp(const MyApp()); @@ -23,9 +22,7 @@ class _MyAppState extends State { child: GridView.count( crossAxisCount: 5, children: [ - ...AnyLogo.daily.values - .map((AssetGenImage e) => e.image()) - .toList(), + ...AnyLogo.values, ], ), ), diff --git a/example/pubspec.lock b/example/pubspec.lock index b50a383..8ff8f19 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: @@ -68,7 +68,7 @@ packages: path: ".." relative: true source: path - version: "1.0.3" + version: "1.0.4" flutter_lints: dependency: "direct dev" description: @@ -91,10 +91,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" lints: dependency: transitive description: @@ -107,10 +107,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -123,18 +123,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" plugin_platform_interface: dependency: transitive description: @@ -192,10 +192,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" vector_math: dependency: transitive description: @@ -205,5 +205,5 @@ packages: source: hosted version: "2.1.4" sdks: - dart: ">=2.19.2 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=2.5.0" diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 99182ce..cde605e 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -176,6 +176,39 @@ class $AssetsAutoGen { ]; } +class $AssetsBadgesGen { + const $AssetsBadgesGen(); + + /// File path: packages/flutter_any_logo/assets/badges/amazonDownload.png + AssetGenImage get amazonDownload => + const AssetGenImage('packages/flutter_any_logo/assets/badges/amazonDownload.png'); + + /// File path: packages/flutter_any_logo/assets/badges/appstoreDownload.png + AssetGenImage get appstoreDownload => + const AssetGenImage('packages/flutter_any_logo/assets/badges/appstoreDownload.png'); + + /// File path: packages/flutter_any_logo/assets/badges/microsoftDownload.png + AssetGenImage get microsoftDownload => + const AssetGenImage('packages/flutter_any_logo/assets/badges/microsoftDownload.png'); + + /// File path: packages/flutter_any_logo/assets/badges/playstoreDownload.png + AssetGenImage get playstoreDownload => + const AssetGenImage('packages/flutter_any_logo/assets/badges/playstoreDownload.png'); + + /// File path: packages/flutter_any_logo/assets/badges/windowsDownload.png + AssetGenImage get windowsDownload => + const AssetGenImage('packages/flutter_any_logo/assets/badges/windowsDownload.png'); + + /// List of all assets + List get values => [ + amazonDownload, + appstoreDownload, + microsoftDownload, + playstoreDownload, + windowsDownload + ]; +} + class $AssetsCricketGen { const $AssetsCricketGen(); @@ -247,6 +280,141 @@ class $AssetsCricketGen { ]; } +class $AssetsCryptoGen { + const $AssetsCryptoGen(); + + /// File path: packages/flutter_any_logo/assets/crypto/bitbay.png + AssetGenImage get bitbay => const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitbay.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitcoin.png + AssetGenImage get bitcoin => const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitcoin.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitcoinIcon.png + AssetGenImage get bitcoinIcon => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitcoinIcon.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitmex.png + AssetGenImage get bitmex => const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitmex.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitquick.png + AssetGenImage get bitquick => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitquick.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitstamp.png + AssetGenImage get bitstamp => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitstamp.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/bitt.png + AssetGenImage get bitt => const AssetGenImage('packages/flutter_any_logo/assets/crypto/bitt.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/cardano.png + AssetGenImage get cardano => const AssetGenImage('packages/flutter_any_logo/assets/crypto/cardano.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/coinMama.png + AssetGenImage get coinMama => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/coinMama.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/coinbase.png + AssetGenImage get coinbase => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/coinbase.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/coinspot.png + AssetGenImage get coinspot => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/coinspot.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/crypterium.png + AssetGenImage get crypterium => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/crypterium.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/cryptoStix.png + AssetGenImage get cryptoStix => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/cryptoStix.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/cryptosumer.png + AssetGenImage get cryptosumer => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/cryptosumer.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/dogecoin.png + AssetGenImage get dogecoin => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/dogecoin.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/ethereum.png + AssetGenImage get ethereum => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/ethereum.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/ethereumIcon.png + AssetGenImage get ethereumIcon => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/ethereumIcon.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/iota.png + AssetGenImage get iota => const AssetGenImage('packages/flutter_any_logo/assets/crypto/iota.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/kraken.png + AssetGenImage get kraken => const AssetGenImage('packages/flutter_any_logo/assets/crypto/kraken.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/litecoin.png + AssetGenImage get litecoin => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/litecoin.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/monero.png + AssetGenImage get monero => const AssetGenImage('packages/flutter_any_logo/assets/crypto/monero.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/ripple.png + AssetGenImage get ripple => const AssetGenImage('packages/flutter_any_logo/assets/crypto/ripple.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/rippleIcon.png + AssetGenImage get rippleIcon => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/rippleIcon.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/spectroCoin.png + AssetGenImage get spectroCoin => + const AssetGenImage('packages/flutter_any_logo/assets/crypto/spectroCoin.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/steem.png + AssetGenImage get steem => const AssetGenImage('packages/flutter_any_logo/assets/crypto/steem.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/stellar.png + AssetGenImage get stellar => const AssetGenImage('packages/flutter_any_logo/assets/crypto/stellar.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/tron.png + AssetGenImage get tron => const AssetGenImage('packages/flutter_any_logo/assets/crypto/tron.png'); + + /// File path: packages/flutter_any_logo/assets/crypto/xapo.png + AssetGenImage get xapo => const AssetGenImage('packages/flutter_any_logo/assets/crypto/xapo.png'); + + /// List of all assets + List get values => [ + bitbay, + bitcoin, + bitcoinIcon, + bitmex, + bitquick, + bitstamp, + bitt, + cardano, + coinMama, + coinbase, + coinspot, + crypterium, + cryptoStix, + cryptosumer, + dogecoin, + ethereum, + ethereumIcon, + iota, + kraken, + litecoin, + monero, + ripple, + rippleIcon, + spectroCoin, + steem, + stellar, + tron, + xapo + ]; +} + class $AssetsDailyGen { const $AssetsDailyGen(); @@ -1469,7 +1637,9 @@ class Assets { Assets._(); static const $AssetsAutoGen auto = $AssetsAutoGen(); + static const $AssetsBadgesGen badges = $AssetsBadgesGen(); static const $AssetsCricketGen cricket = $AssetsCricketGen(); + static const $AssetsCryptoGen crypto = $AssetsCryptoGen(); static const $AssetsDailyGen daily = $AssetsDailyGen(); static const $AssetsFashionGen fashion = $AssetsFashionGen(); static const $AssetsFootballGen football = $AssetsFootballGen(); diff --git a/lib/src/model/class.dart b/lib/src/model/class.dart index 66ca7ff..8b3637c 100644 --- a/lib/src/model/class.dart +++ b/lib/src/model/class.dart @@ -101,9 +101,21 @@ class AnyLogo { /// AnyLogo.auto.mercedesBenz static const $AssetsAutoGen auto = $AssetsAutoGen(); + /// Crypto section contains crypto related logos + /// AnyLogo.crypto.bitcoin + /// AnyLogo.crypto.iota + /// AnyLogo.crypto.cardano + static const $AssetsCryptoGen crypto = $AssetsCryptoGen(); + + /// Badges section contains badges related logos + /// AnyLogo.badges.playstoreDownload + /// AnyLogo.crypto.appstoreDownload + /// AnyLogo.crypto.amazonDownload + static const $AssetsBadgesGen badges = $AssetsBadgesGen(); + /// This values variable can be accessed to display all logos /// available in the plugin package. - static List values = [ + static List values = [ ...AnyLogo.cricket.values.map((AssetGenImage e) => e.image()).toList(), ...AnyLogo.nba.values.map((AssetGenImage e) => e.image()).toList(), ...AnyLogo.nfl.values.map((AssetGenImage e) => e.image()).toList(), @@ -113,5 +125,7 @@ class AnyLogo { ...AnyLogo.tech.values.map((AssetGenImage e) => e.image()).toList(), ...AnyLogo.media.values.map((AssetGenImage e) => e.image()).toList(), ...AnyLogo.auto.values.map((AssetGenImage e) => e.image()).toList(), + ...AnyLogo.crypto.values.map((AssetGenImage e) => e.image()).toList(), + ...AnyLogo.badges.values.map((AssetGenImage e) => e.image()).toList(), ]; } diff --git a/pubspec.yaml b/pubspec.yaml index 4a6e7e3..e0234f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: >- It covers, fashion. Sports, Entertainment, SocialMedia etc... #Version to be released -version: 1.0.4 +version: 1.0.5 #package homepage: homepage: https://github.com/JordyHers/flutter_any_logo @@ -47,10 +47,12 @@ dev_dependencies: flutter: assets: - assets/nba/ + - assets/badges/ - assets/auto/ - assets/football/ - assets/fashion/ - assets/cricket/ + - assets/crypto/ - assets/daily/ - assets/media/ - assets/tech/ diff --git a/test/categories/badges_test.dart b/test/categories/badges_test.dart new file mode 100644 index 0000000..bf4e4a6 --- /dev/null +++ b/test/categories/badges_test.dart @@ -0,0 +1,27 @@ +import 'package:flutter_any_logo/src/model/class.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../helpers/constants.dart'; +import '../helpers/helpers.dart'; +import '../helpers/pump_widget.dart'; + +void main() { + group('Badges List Tests', () { + testWidgets('Verify All Logos Should load', (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.badges); + AnyLogoTest.testLogosRendered(Const.badges); + }); + + testWidgets('Verify no exception is thrown', (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.badges); + AnyLogoTest.testException(tester); + }); + + testWidgets( + 'Verify the last item displayed is the same as the last in the list', + (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.badges); + AnyLogoTest.testDisplayedLogos(tester, AnyLogo.badges.values); + }); + }); +} diff --git a/test/categories/crypto_test.dart b/test/categories/crypto_test.dart new file mode 100644 index 0000000..477e982 --- /dev/null +++ b/test/categories/crypto_test.dart @@ -0,0 +1,27 @@ +import 'package:flutter_any_logo/src/model/class.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../helpers/constants.dart'; +import '../helpers/helpers.dart'; +import '../helpers/pump_widget.dart'; + +void main() { + group('Crypto List Tests', () { + testWidgets('Verify All Logos Should load', (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.crypto); + AnyLogoTest.testLogosRendered(Const.crypto); + }); + + testWidgets('Verify no exception is thrown', (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.crypto); + AnyLogoTest.testException(tester); + }); + + testWidgets( + 'Verify the last item displayed is the same as the last in the list', + (WidgetTester tester) async { + await tester.pumpWidget(PumpWidget.crypto); + AnyLogoTest.testDisplayedLogos(tester, AnyLogo.crypto.values); + }); + }); +} diff --git a/test/helpers/constants.dart b/test/helpers/constants.dart index 31ddbfa..df10f06 100644 --- a/test/helpers/constants.dart +++ b/test/helpers/constants.dart @@ -1,5 +1,7 @@ class Const { + static const String badges = './assets/badges'; static const String cricket = './assets/cricket'; + static const String crypto = './assets/crypto'; static const String nba = './assets/nba'; static const String nfl = './assets/nfl'; static const String football = './assets/football'; diff --git a/test/helpers/pump_widget.dart b/test/helpers/pump_widget.dart index cc9debe..698c2d1 100644 --- a/test/helpers/pump_widget.dart +++ b/test/helpers/pump_widget.dart @@ -89,4 +89,26 @@ class PumpWidget { }), ), ); + + // Launch all logos in Crypto folder + static Widget crypto = MaterialApp( + home: Scaffold( + body: ListView.builder( + itemCount: AnyLogo.crypto.values.length, + itemBuilder: (BuildContext context, int index) { + return AnyLogo.crypto.values[index].image(); + }), + ), + ); + + // Launch all logos in Crypto folder + static Widget badges = MaterialApp( + home: Scaffold( + body: ListView.builder( + itemCount: AnyLogo.badges.values.length, + itemBuilder: (BuildContext context, int index) { + return AnyLogo.badges.values[index].image(); + }), + ), + ); }