From c56e8f1369365164046f031b5b4a698bcc38e8b8 Mon Sep 17 00:00:00 2001 From: syedmouaazfarrukh Date: Mon, 30 Jan 2023 06:59:38 -0800 Subject: [PATCH] Adding content to 103-working-with-assets --- .../content/103-working-with-assets/100-fonts.md | 10 ++++++++-- .../103-working-with-assets/101-images.md | 9 ++++++++- .../102-other-file-types.md | 14 +++++++++++++- .../content/103-working-with-assets/index.md | 16 +++++++++++++++- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/roadmaps/flutter/content/103-working-with-assets/100-fonts.md b/src/roadmaps/flutter/content/103-working-with-assets/100-fonts.md index 97fc71fba..51729791a 100644 --- a/src/roadmaps/flutter/content/103-working-with-assets/100-fonts.md +++ b/src/roadmaps/flutter/content/103-working-with-assets/100-fonts.md @@ -1,7 +1,13 @@ # Fonts -Flutter works with custom fonts and you can apply a custom font across an entire app or to individual widgets. +You can use custom fonts in your app by including the font file in your app's assets and specifying the font in your app's styles. To use a custom font: + +- Add the font files to your app's assets folder. +- In your pubspec.yaml file, specify the fonts under the flutter section +- In your app's styles, specify the font family +- Use the font in a Text widget Visit the following resources to learn more: -- [Use a custom font](https://docs.flutter.dev/cookbook/design/fonts) +- [Font - Flutter](https://docs.flutter.dev/cookbook/design/fonts) +- [How to use custom fonts in Flutter](https://blog.logrocket.com/use-custom-fonts-flutter/) \ No newline at end of file diff --git a/src/roadmaps/flutter/content/103-working-with-assets/101-images.md b/src/roadmaps/flutter/content/103-working-with-assets/101-images.md index 4c5628db1..d9446124b 100644 --- a/src/roadmaps/flutter/content/103-working-with-assets/101-images.md +++ b/src/roadmaps/flutter/content/103-working-with-assets/101-images.md @@ -1,7 +1,14 @@ # Images -Apps can include both code and assets. Flutter uses the pubspec.yaml file, located at the root of your project, to identify assets required by an app. +In Flutter, you can display images using the `Image` widget. There are several ways to add an image to your app: + +- Asset: Add the image to your app's assets and specify the asset path in the `Image` widget. +- Network: Display an image from a URL by specifying the URL in the `Image` widget. +- File: Display an image from a file by specifying the file path in the `Image` widget. + +The `Image` widget also accepts additional parameters such as `fit`, `width`, and `height` to control the size and scaling of the image. Visit the following resources to learn more: - [Adding assets and images](https://docs.flutter.dev/development/ui/assets-and-images) +- [Images in Flutter](https://docs.flutter.dev/cookbook/images) \ No newline at end of file diff --git a/src/roadmaps/flutter/content/103-working-with-assets/102-other-file-types.md b/src/roadmaps/flutter/content/103-working-with-assets/102-other-file-types.md index 0f8d1f6f5..71aff4eb7 100644 --- a/src/roadmaps/flutter/content/103-working-with-assets/102-other-file-types.md +++ b/src/roadmaps/flutter/content/103-working-with-assets/102-other-file-types.md @@ -1 +1,13 @@ -# Other file types \ No newline at end of file +# Other File Types + +In Flutter, you can work with different file types besides images. Some common file types that you can use in Flutter include: + +1. Text files: You can read or write text files using the dart:io library. +2. JSON files: You can parse JSON data using the dart:convert library. +javascript +3. Audio and Video files: You can play audio and video files using the video_player and audioplayers packages. +4. PDF files: You can display PDF files using the pdf package. + +Learn more from the following links: + +- [File class](https://docs.flutter.dev/cookbook/lists/mixed-list) \ No newline at end of file diff --git a/src/roadmaps/flutter/content/103-working-with-assets/index.md b/src/roadmaps/flutter/content/103-working-with-assets/index.md index 5bb9fe8ec..bb9747b76 100644 --- a/src/roadmaps/flutter/content/103-working-with-assets/index.md +++ b/src/roadmaps/flutter/content/103-working-with-assets/index.md @@ -1 +1,15 @@ -# Working with assets \ No newline at end of file +# Working with Assets + +Assets are resources such as images, fonts, and other files that are included in your app. To use assets in Flutter, you need to specify them in your app's `pubspec.yaml` file and then access them in your code. + +Here's how to work with assets in Flutter: + +1. Add assets to your app's `pubspec.yaml` file: +2. Access assets in your code + +The `pubspec.yaml` file is used to manage dependencies, assets, and other settings in your Flutter app. The `flutter` section is used to specify assets that should be included with the app. The path specified in the `assets` section should be relative to the `pubspec.yaml` file. + +Learn more from the following links: + +- [Flutter Tutorial - Assets](https://www.youtube.com/watch?v=Hxh6nNHSUjo) +- [Adding Assets in Flutter](https://docs.flutter.dev/development/ui/assets-and-images) \ No newline at end of file