A Flutter plugin that provides asset images for popular industry categories. It includes 5 main classes, Sports, Fashion, Tech, Daily, and Media, each extending their respective interface. This plugin can be useful for projects that require industry-related images. This plugin can be useful for various projects, such as Quiz app, Catalogs, eCommerce App, Templates, Websites, and more.
Logos 1 | Logos 2 |
---|---|
Add flutter_any_logo
as a dependency in your pubspec.yaml
file.
dependencies:
flutter_any_logo: <latest version>
Then, run flutter pub get
in your terminal to install the plugin.
Import the flutter_any_logo
package in your Dart code:
import 'package:flutter_any_logo/flutter_any_logo.dart';
You can now use the provided AnyLogo
widget to display the logos in your app. For example, to display the Google logo:
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(body: AnyLogo.tech.google.image()
),
);
}
}
import 'package:flutter_any_logo/flutter_any_logo.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
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(),
...AnyLogo.daily.values.map((e) => e.image()).toList(),
...AnyLogo.tech.values.map((e) => e.image()).toList(),
...AnyLogo.nfl.values.map((e) => e.image()).toList(),
...AnyLogo.media.values.map((e) => e.image()).toList(),
...AnyLogo.auto.values.map((e) => e.image()).toList(),
...AnyLogo.coding.values.map((e) => e.image()).toList(),
],
),
);
}
}
if you want to have access to a type a static method is available
// Single Assets
AnyLogo.daily.mcDonalds
//Access all values in a type
AnyLogo.nba.values
//Access the Image
AnyLogo.uefa.manchesterUnited.image()
// 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, width: 25, fit: BoxFit.contain);
//You can still pass just the asset image without calling [.image()]
Image(image: AssetImage(AnyLogo.nba.atlanta.path)),
These are the possible categories
// UEFA section contains football teams β½οΈ
AnyLogo.uefa.acMilan
AnyLogo.uefa.barcelona
AnyLogo.uefa.realMadrid
// 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.nutella
AnyLogo.daily.kellogs
AnyLogo.daily.lufthansa
// NFL section contains nfl teams π
AnyLogo.nfl.nflArizonaCardinals
AnyLogo.nfl.nflBuffaloBills
// Fashion section contains clothing / perfume / luxury / watches βοΈ
AnyLogo.fashion.louisVuitton
AnyLogo.fashion.gucci
AnyLogo.fashion.prada
// NBA section contains all nba teams π
AnyLogo.nba.miamiHeat
AnyLogo.nba.losAngelesClippers
AnyLogo.nba.goldenStateWarriors
// Tech contains all brands and tech companies πΉοΈ
AnyLogo.tech.playstation
AnyLogo.tech.siemens
AnyLogo.tech.visa
// Media section contains social media and area like π
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
// Car section contains car brands and makes ποΈ
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
/// Coding section contains programming and IDE related logos π¨πΎβπ»
AnyLogo.coding.vsCode
AnyLogo.coding.intellij
AnyLogo.coding.vim
π New Logos are constantly uploaded and we may have not uploaded a
logo you think should be part of the library. Feel free to open an Pull request to have your logo added.
PNG File Upload Validation
To ensure that only PNG files with a size of 100kb
or less are uploaded to the application.
This test strategy covers the validation of PNG file uploads in the application. Specifically, it covers the validation of PNG file types and size limits.
The testing approach for this test strategy will involve a combination of manual and automated testing techniques. The automated testing will be implemented as part of the continuous integration (CI) pipeline using GitHub Actions. The manual testing will be performed by the testing team. The Unit testing ensure the files are properly loaded
- Automated Testing:
- Static code analysis to enforce linting rules for file types and size limits.Automated testing will be performed as part of the CI pipeline for every code push or pull request
- Unit Testing:
- widget testing ensures the logos are properly loaded and rendered
- Manual Testing:
- Functional testing to verify that PNG files with a size of 400kb or less can be uploaded successfully
- Exploratory testing to identify any edge cases or potential issues related to PNG file uploads
- Manual testing will be performed on an as-needed basis during the testing phase of the development cycle.
- Development environment: Flutter framework
- Operating system: Windows, MacOS, Linux
- Test environment: Local and staging servers
- Verify that only PNG files with a size of 400kb or less can be uploaded.
- Verify that an error message is displayed when attempting to upload a non-PNG file.
- Verify that a success message is displayed when a PNG file with a size of 400kb or less is uploaded successfully.
- Verify that the application is able to handle edge cases, such as large or corrupted PNG files.
Contributions to flutter_any_logo
are welcome! If you find a bug or would like to suggest a new logo, please create an issue on the GitHub repository.
If you want to contribute to this open source project hosted on GitHub, follow these steps.
Here's a quick guide on how to get started.
To make changes to a project, you need to follow these steps
- Fork the project
- Locate the PNG file that you want to add to the project. add it to
assets/
- If you added a new sub directory update the
pubspec.yaml
file.
Once you have added the PNG file to your forked repository, you'll need to install the dependencies and build the project before you can see your changes.
Open a terminal window and navigate to the project directory.
Run the command make install
to install the dependencies.
this will install gnu-sed
using brew. Make sure HomeBrew is installed
On Windows, you can use the sed
command with the help of a tool called Cygwin,
which provides a collection of GNU and Open Source tools that provide functionality similar to a Linux distribution on Windows.
Here's how you can perform the same replacement using Cygwin:
- Install Cygwin by downloading and running the installer from the official website: https://www.cygwin.com/install.html
- During the installation, make sure to select the packages for
sed
andcoreutils
to have access to the necessary tools. - After installation, launch the "Cygwin Terminal" application.
The above command is similar to the one you provided for macOS, with the difference being that we
don't need the empty quotes (''
) after the -i
option in this case.
Run on mac: make deploy-mac
Run on windows: make deploy-windows
Update tests. Please go to tests and make sure you add tests. Just follow the present tests patterns if you have uploaded a new category.
Make sure you checkout and create a branch following this format:
<issueNumber> feat: implement <logoName> to the project
#34 feat: implement `kodak` logo to the project.
flutter_any_logo
is released under the MIT License.