Skip to content

Latest commit

 

History

History
168 lines (111 loc) · 3.77 KB

README.md

File metadata and controls

168 lines (111 loc) · 3.77 KB

Flutter starter project 🚦 📱 💻 🖥️

style: ficcanaso

Introduction

a template with best practices for starting a new app or becoming familiar with the architecture of our projects

Live Demo: https://patchaii.github.io/flutter_starter_project/


Tools


Installation

to verify proper installation

flutter doctor -v
  • add dotenv (filename: dotenv) file in the root of the project with:
ENDPOINT='https://graphql-pokemon2.vercel.app'
ENVIRONMENT='dev/prod/qa'

Architecture

https://pub.dev/packages/flutter_bloc

https://bloclibrary.dev/#/architecture

Test

brew install lcov
flutter test
  • coverage
flutter test --coverage
flutter test --coverage && lcov --remove coverage/lcov.info '**/*.freezed.dart' '**/*.g.dart' '**/*.graphql.dart' '**/*.part.dart' '**/*.config.dart' '**/*_event.dart' '**/*_state.dart' '**/*_repo.dart' '**/core/*' '**/*_controller.dart' '**/alert/*.dart' -o coverage/lcov.info && genhtml coverage/lcov.info --output=coverage && open coverage/index.html
  • golden
flutter test --update-goldens

✨Mago Merlino✨

https://github.com/PatchAii/mago-merlino

  • generate a new feature (bloc/repo/view) using the magic powers of mago merlino:
# install dart
brew install dart

# activate ✨mago_merlino✨
dart pub global activate -sgit https://github.com/PatchAii/mago-merlino.git
# do some ✨magic✨
dart pub global run mago_merlino:mago_merlino create-feature --path lib/feature/abc

#or

dart pub global run mago_merlino:mago_merlino create-feature abc

Translations

Update transaltions:

make localisation

Usefull commands

# Code generator "build_runner"
flutter pub run build_runner build

# Code generator "build_runner" with confict remove
flutter pub run build_runner build --delete-conflicting-outputs

Notifications

Local and push notification are handled by Awesome_notification https://pub.dev/packages/awesome_notifications

To send a notification using FCM services, you need to send a POST to:

https://fcm.googleapis.com/fcm/send

To avoid misbehavior on Android and IOS you should send an empty notification field and use only data field for your data.

Here's an example of a POST request body:

{
    "to" : "[YOUR APP FCM TOKEN]",
    "mutable_content" : true,
    "content_available": true,
    "priority": "high",
    "data" : {
        "id": 100,
        "channelKey": "basic_channel",
        "title": "Basic message",
        "body": "This is the body of a basic FCM message"
    }
}

Inside headers define:

Content-type: application/json
Authorization: key=[server_key]