Skip to content

Commit

Permalink
added cricket to logo list. and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyHers committed May 2, 2023
1 parent 43e4062 commit fd92fbb
Show file tree
Hide file tree
Showing 22 changed files with 137 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Check Logos PNG files
run: |
shopt -s nullglob
for file in $(find assets \( -path "assets/basketball/*" -o -path "assets/euroleague/*" -o -path "assets/fashion/*" -o -path "assets/daily/*" -o -path "assets/football/*" -o -path "assets/media/*" -o -path "assets/tech/*" -o -path "assets/nfl/*" \) -type f ! -name "*.png"); do
for file in $(find assets \( -path "assets/basketball/*" -o -path "assets/euroleague/*" -o -path "assets/fashion/*" -o -path "assets/daily/*" -o -path "assets/football/*" -o -path "assets/media/*" -o -path "assets/tech/*" -o -path "assets/nfl/*" -o -path "assets/cricket/*" \) -type f ! -name "*.png"); do
echo "ERROR: File '$file' is not a PNG file"
done
- name: Setup Flutter
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ import 'package:flutter_any_logo/flutter_any_logo.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
return Center(
child: GridView.count(
crossAxisCount: 5,
children: [
...AnyLogo.cricket.values.map((e) => e.image()).toList(),
...AnyLogo.nba.values.map((e) => e.image()).toList(),
...AnyLogo.fashion.values.map((e) => e.image()).toList(),
...AnyLogo.uefa.values.map((e) => e.image()).toList(),
Expand Down Expand Up @@ -149,6 +151,11 @@ AnyLogo.media.instagram
AnyLogo.media.tiktok
AnyLogo.media.facebook
// Cricket section contains social media and area like 🏏
AnyLogo.cricket.cscs
AnyLogo.cricket.gurajatLions
AnyLogo.cricket.mumbaiIndians
```

### Warning ⚠️
Expand Down
Binary file added assets/cricket/bangaloreRoyalChallengers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/chennaiSuperKings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/cscs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/deccanChargers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/dehliCapitals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/durhamCricket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/gurajatLions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/hpca.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/hubliTigers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/kolkataKnightRiders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/luckNowSuperGiants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/mumbaiIndians.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cricket/sunrisersHyderabad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: SizedBox(
width: 200,
child: ListView(
children: [
...AnyLogo.nba.values.map((e) => e.image()).toList(),
...AnyLogo.fashion.values.map((e) => e.image()).toList(),
...AnyLogo.uefa.values.map((e) => e.image()).toList(),
...AnyLogo.daily.values.map((e) => e.image()).toList(),
...AnyLogo.tech.values.map((e) => e.image()).toList(),
...AnyLogo.nfl.values.map((e) => e.image()).toList(),
],
),
child: GridView.count(
crossAxisCount: 5,
children: [
...AnyLogo.cricket.values.map((e) => e.image()).toList(),
...AnyLogo.nba.values.map((e) => e.image()).toList(),
...AnyLogo.fashion.values.map((e) => e.image()).toList(),
...AnyLogo.uefa.values.map((e) => e.image()).toList(),
...AnyLogo.daily.values.map((e) => e.image()).toList(),
...AnyLogo.tech.values.map((e) => e.image()).toList(),
...AnyLogo.nfl.values.map((e) => e.image()).toList(),
],
),
),
),
Expand Down
72 changes: 72 additions & 0 deletions lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/model/class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ class AnyLogo {
static const $AssetsTechGen tech = $AssetsTechGen();
static const $AssetsNflGen nfl = $AssetsNflGen();
static const $AssetsEuroleagueGen euroleague = $AssetsEuroleagueGen();
static const $AssetsCricketGen cricket = $AssetsCricketGen();
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ flutter:
- assets/euroleague/
- assets/football/
- assets/fashion/
- assets/cricket/
- assets/daily/
- assets/media/
- assets/tech/
Expand Down
30 changes: 30 additions & 0 deletions test/categories/cricket_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
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('Cricket List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.cricket);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.cricket);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.cricket);
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.cricket);
AnyLogoTest.testDisplayedLogos(tester, AnyLogo.cricket.values);
});
});
}
1 change: 1 addition & 0 deletions test/helpers/constants.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Const {
static const String cricket = './assets/cricket';
static const String nba = './assets/nba';
static const String nfl = './assets/nfl';
static const String football = './assets/football';
Expand Down
11 changes: 11 additions & 0 deletions test/helpers/pump_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,15 @@ class PumpWidget {
}),
),
);

// Launch all logos in Cricket folder
static Widget cricket = MaterialApp(
home: Scaffold(
body: ListView.builder(
itemCount: AnyLogo.cricket.values.length,
itemBuilder: (BuildContext context, int index) {
return AnyLogo.cricket.values[index].image();
}),
),
);
}

0 comments on commit fd92fbb

Please sign in to comment.