Skip to content

Commit

Permalink
Merge pull request #66 from JordyHers/dev
Browse files Browse the repository at this point in the history
Merge dev to main
  • Loading branch information
JordyHers committed May 9, 2023
2 parents bce010e + dbb3331 commit 3d163cd
Show file tree
Hide file tree
Showing 14 changed files with 179 additions and 127 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Flutter Any Logo 馃挴




<p align="center">
<img align="center" src="https://github.com/JordyHers/flutter_any_logo/assets/49708438/59453e31-ce89-4e9a-878c-208715e52ed0">
</p>


# Flutter Any Logo 馃挴
[![Deploy Dev](https://github.com/JordyHers/flutter_any_logo/actions/workflows/deploy_dev.yml/badge.svg?branch=main)](https://github.com/JordyHers/flutter_any_logo/actions/workflows/deploy_dev.yml)

## Our aim is to implement 1000+ logos but keep the package as light as possible. 馃
### Our aim is to implement 1000+ logos but keep the package as light as possible. 馃


![logos](https://user-images.githubusercontent.com/49708438/235303282-3d0c03b9-39bc-475e-be86-33ef99305889.jpeg)

Expand Down Expand Up @@ -31,7 +39,7 @@ Add `flutter_any_logo` as a dependency in your `pubspec.yaml` file.

```
dependencies:
flutter_any_logo: ^1.0.0
flutter_any_logo: ^1.0.3
```

Then, run `flutter pub get` in your terminal to install the plugin.
Expand Down Expand Up @@ -116,7 +124,7 @@ AnyLogo.uefa.manchesterUnited.image()
// int? cacheWidth,
// int? cacheHeight,
// All the variables are sill available
AnyLogo.nba.atlantaHawks.image(height: 30, fit: BoxFit.contain);
AnyLogo.nba.atlantaHawks.image(height: 30, width: 25, fit: BoxFit.contain);
//You can still pass just the asset image without calling [.image()]
Expand Down Expand Up @@ -251,3 +259,6 @@ Make sure you checkout and create a branch following this format:
## License

`flutter_any_logo` is released under the [MIT License](https://github.com/example/flutter_any_logo/blob/main/LICENSE).



Binary file added images/anyLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions lib/src/model/class.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,108 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/gen/assets.gen.dart';

/// [AnyLogo] class will help ypu access any logo
/// you would like to display in your app; listed
/// in the corresponding category
class AnyLogo {
/// You can still pass just the asset image without calling [.image()]
/// Image(image: AssetImage(AnyLogo.nba.atlanta.path)),
///
///
/// - Variables -
/// Key? key,
/// AssetBundle? bundle,
/// Widget Function(BuildContext, Widget, int?, bool)? frameBuilder,
/// Widget Function(BuildContext, Object, StackTrace?)? errorBuilder,
/// String? semanticLabel,
/// bool excludeFromSemantics = false,
/// double? scale,
/// double? width,
/// double? height,
/// Color? color,
/// Animation<double>? opacity,
/// BlendMode? colorBlendMode,
/// BoxFit? fit,
/// AlignmentGeometry alignment = Alignment.center,
/// ImageRepeat repeat = ImageRepeat.noRepeat,
/// Rect? centerSlice,
/// bool matchTextDirection = false,
/// bool gaplessPlayback = false,
/// bool isAntiAlias = false,
/// String? package,
/// FilterQuality filterQuality = FilterQuality.low,
/// int? cacheWidth,
/// int? cacheHeight,
/// All the variables are sill available
/// AnyLogo.nba.atlantaHawks.image(height: 30, fit: BoxFit.contain);
///
///
/// - Single Assets Image NBA -
/// AnyLogo.daily.mcDonalds
///
/// - Access all values in a type -
/// AnyLogo.nba.values
/// Access the Image
/// AnyLogo.uefa.manchesterUnited.image()
AnyLogo._();

/// Fashion section contains clothing / perfume / luxury / watches
/// AnyLogo.fashion.louisVuitton
/// AnyLogo.fashion.gucci
/// AnyLogo.fashion.prada
static const $AssetsFashionGen fashion = $AssetsFashionGen();

/// Daily section contains everyday brands food / travel /
/// plane / agencies related etc.. Basically if you don't
/// find a brand it could be in daily.
/// AnyLogo.daily.gillette
/// AnyLogo.daily.kellogs
/// AnyLogo.daily.lufthansa
static const $AssetsDailyGen daily = $AssetsDailyGen();

/// UEFA section contains football teams
/// AnyLogo.uefa.acMilan
/// AnyLogo.uefa.barcelona
static const $AssetsFootballGen uefa = $AssetsFootballGen();

/// Media section contains social media and area like
/// AnyLogo.media.instagram
/// AnyLogo.media.tiktok
/// AnyLogo.media.facebook
static const $AssetsMediaGen media = $AssetsMediaGen();

/// NBA section contains all nba teams
/// AnyLogo.nba.miamiHeat
/// AnyLogo.nba.losAngelesClippers
/// AnyLogo.nba.goldenStateWarriors
static const $AssetsNbaGen nba = $AssetsNbaGen();

/// Tech contains all brands and tech companies
/// AnyLogo.tech.playstation
/// AnyLogo.tech.siemens
/// AnyLogo.tech.visa
static const $AssetsTechGen tech = $AssetsTechGen();

/// NFL section contains nfl teams
/// AnyLogo.nfl.nflArizonaCardinals
/// AnyLogo.nfl.nflBuffaloBills
static const $AssetsNflGen nfl = $AssetsNflGen();

/// Cricket section contains social media and area like
/// AnyLogo.cricket.cscs
/// AnyLogo.cricket.gurajatLions
/// AnyLogo.cricket.mumbaiIndians
static const $AssetsCricketGen cricket = $AssetsCricketGen();

/// Auto section contains car brands and makes
/// AnyLogo.auto.bugatti
/// AnyLogo.auto.bmw
/// AnyLogo.auto.mercedesBenz
static const $AssetsAutoGen auto = $AssetsAutoGen();

/// This values variable can be accessed to display all logos
/// available in the plugin package.
static List<dynamic> values = <Widget>[
...AnyLogo.cricket.values.map((AssetGenImage e) => e.image()).toList(),
...AnyLogo.nba.values.map((AssetGenImage e) => e.image()).toList(),
Expand Down
9 changes: 3 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ environment:

#screenshots
screenshots:
- description: ' All logos intro '
path: images/logos.jpeg
- description: 'First part of demo'
path: images/demo1.png
- description: 'Last part of demo'
path: images/demo2.png
- description: ' Any Logo '
path: images/anyLogo.png



# dependencies
Expand Down
5 changes: 1 addition & 4 deletions test/categories/automobile_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Automobile List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.auto);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.auto);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.auto);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/basketball_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Nba List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.nba);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.nba);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.nba);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/cricket_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ 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));
AnyLogoTest.testLogosRendered(Const.cricket);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/fashion_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Fashion List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.fashion);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.fashion);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.fashion);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/football_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Football List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.football);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.football);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.football);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/media_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Media Logos Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.media);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.media);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.media);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/nfl_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('NFL List Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.nfl);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.nfl);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.nfl);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
5 changes: 1 addition & 4 deletions test/categories/tech_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_any_logo/src/model/class.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -10,9 +9,7 @@ void main() {
group('Tech logos Tests', () {
testWidgets('Verify All Logos Should load', (WidgetTester tester) async {
await tester.pumpWidget(PumpWidget.tech);
// Verify that all logo launch
final int number = AnyLogoTest.numberOfLogos(Const.tech);
expect(find.byType(Image, skipOffstage: false), findsNWidgets(number));
AnyLogoTest.testLogosRendered(Const.tech);
});

testWidgets('Verify no exception is thrown', (WidgetTester tester) async {
Expand Down
Loading

0 comments on commit 3d163cd

Please sign in to comment.