Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

EcommerceMarket

style: very good analysis

An application that imitates ecommerce.


Getting Started 🚀

Assets 🎨

The assets directory houses images, fonts, and any other files you want to include with your application.

The assets/images directory contains resolution-aware images.

Generating assets 🖼

We use flutter_gen to generate asset classes like Assets and FontFamily. This helps us avoid commiting typos when writing an asset file name and to access additional properities like height of images.

The configuration for this tool is already on your pubspec. Also the flutter_gen_runner is packed, so your asset classes are generated when you run:

dart run build_runner build --delete-conflicting-outputs

Then, to reference the asset you can call:

Assets.images.noScopeLogo.image(height: 42),

*Note: Remember to add your asset directories to your pubspec too.

Localization 🌎

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

It generates localized messages based on arb files found in the lib/src/l10n directory.

Adding Strings 🪢

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "hello": "Hello!",
    "@hello": {
        "description": "Hello message"
    }
}
  1. Then add a new key/value and description.
{
    "@@locale": "en",
    "hello": "Hello!",
    "@hello": {
        "description": "Hello message"
    },
    "goodbye": "Good-bye!",
    "@goodbye": {
        "description": "Good-bye message"
    }
}
  1. Use the new string.
import 'package:crypto_stats/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.hello);
}

Adding Supported Locales 📍

Update the CFBundleLocalizations array in the Info.plist at ios/Runner/Info.plist to include the new locale.

    ...

    <key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>es</string>
	</array>

    ...

Adding Translations 🔄

To support additional languages, please visit the tutorial on Internationalizing Flutter apps.

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
├── l10n
│   ├── arb
│   │   ├── app_en.arb
│   │   └── app_es.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
    "@@locale": "en",
    "hello": "Hello!",
    "@hello": {
        "description": "Hello message"
    }
}

app_es.arb

{
    "@@locale": "es",
    "hello": "¡Hola!",
    "@hello": {
        "description": "Mensaje de hola"
    }
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages