Giter VIP home page Giter VIP logo

flutter-boilerplate's Introduction

Flutter Boilerplate

License: MIT

A Template Project for Flutter.


Running Tests πŸ§ͺ

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Working with Translations 🌐

This project relies on [flutter_localizations][flutter_localizations_link] and follows the [official internationalization guide for Flutter][internationalization_link].

Adding Strings

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}
  1. Then add a new key/value and description
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    },
    "helloWorld": "Hello World",
    "@helloWorld": {
        "description": "Hello World Text"
    }
}
  1. Use the new string
import 'package:flutter_boilerplate/l10n/l10n.dart';

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

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

  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",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}

app_es.arb

{
    "@@locale": "es",
    "counterAppBarTitle": "Contador",
    "@counterAppBarTitle": {
        "description": "Texto mostrado en la AppBar de la pΓ‘gina del contador"
    }
}

flutter-boilerplate's People

Contributors

renovate[bot] avatar

Stargazers

 avatar Roman avatar Hau Nguyen avatar Kimmy Wang avatar

Watchers

Kimmy Wang avatar

flutter-boilerplate's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-java action to v4
  • chore(deps): update dependency dart to v3
  • chore(deps): update dependency very_good_analysis to v6
  • chore(deps): update github artifact actions to v4 (major) (actions/download-artifact, actions/upload-artifact)
  • chore(deps): update peaceiris/actions-gh-pages action to v4
  • fix(deps): update dependency adaptive_dialog to v2
  • fix(deps): update dependency connectivity_plus to v6
  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2
  • fix(deps): update dependency sentry_flutter to v8
  • πŸ” Create all rate-limited PRs at once πŸ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cocoapods
ios/Podfile
macos/Podfile
github-actions
.github/workflows/release-web.yml
  • actions/checkout v3
  • subosito/flutter-action v2
  • peaceiris/actions-gh-pages v3
.github/workflows/release.yml
  • actions/download-artifact v3
  • ncipollo/release-action v1
  • actions/checkout v3
  • actions/setup-java v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/setup-java v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • subosito/flutter-action v2
  • actions/upload-artifact v3
gradle
android/gradle.properties
android/settings.gradle
android/build.gradle
  • com.android.tools.build:gradle 8.0.2
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.7.22
android/app/build.gradle
gradle-wrapper
android/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.1.1
pub
dependencies/settings_ui/pubspec.yaml
  • flutter
  • pedantic ^1.11.1
  • dart >=2.12.0 <3.0.0
packages/dio_trending_api/pubspec.yaml
  • dio ^5.0.1
  • flutter
  • rxdart ^0.27.2
  • mocktail ^0.3.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/http_trending_api/pubspec.yaml
  • flutter
  • http ^0.13.5
  • rxdart ^0.27.2
  • mocktail ^0.3.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/local_storage_repository_middleware/pubspec.yaml
  • flutter
  • shared_preferences ^2.0.7
  • mocktail ^0.3.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/repository_middleware/pubspec.yaml
  • rxdart ^0.27.2
  • shared_preferences ^2.0.7
  • mocktail ^0.3.0
  • test ^1.17.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/trending_api/pubspec.yaml
  • test ^1.17.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/trending_common/pubspec.yaml
  • equatable ^2.0.3
  • json_annotation ^4.6.0
  • build_runner ^2.0.0
  • json_serializable ^6.0.0
  • test ^1.17.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
packages/trending_repository/pubspec.yaml
  • mocktail ^0.3.0
  • test ^1.17.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0
pubspec.yaml
  • adaptive_dialog ^1.8.2
  • bloc ^8.1.1
  • connectivity_plus ^4.0.0
  • cupertino_icons ^1.0.5
  • easy_refresh ^3.3.1
  • fluent_ui ^4.4.1
  • flutter
  • flutter_bloc ^8.1.2
  • flutter_easyloading ^3.0.5
  • flutter_native_splash ^2.2.19
  • fluttertoast ^8.2.1
  • intl ^0.17.0
  • introduction_screen ^3.1.7
  • json_annotation ^4.8.0
  • macos_ui ^1.12.2
  • pretty_dio_logger ^1.3.1
  • sentry_flutter ^7.2.0
  • synchronized ^3.0.1
  • window_manager ^0.3.1
  • bloc_test ^9.1.1
  • build_runner ^2.3.3
  • json_serializable ^6.6.1
  • mockingjay ^0.3.0
  • mocktail ^0.3.0
  • very_good_analysis ^4.0.0+1
  • dart >=2.19.0 <3.0.0
  • flutter 3.7.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.