Skip to content

Commit

Permalink
[Feat!]: Dart 3 support (#86)
Browse files Browse the repository at this point in the history
* Docs: Update dart docs for core part (partially, WIP).

* Chore: handle Dart 3

* Feat: use interface instead of classes and finalize the elementary(element).

* Feat: ListenableState now is pure interface.

* Docs: update documentation.

* Docs: update documentation.

* Docs: update documentation.

* Docs: update documentation.
Refactor: Entity state, Entity Builder.
Test: adjust test, add a few missed.

* Chore: add changelog for the new version of elementary.

* Chore: add changelog for the new version of elementary_test.

* Chore: update examples to support new version elementary.

* Docs: small cosmetic documentation improvement.

* Feat: add alias for EntityStateNotifier interface.

* Docs: update main page for repository.

* Docs: update main page for repository.

* Refactor: move wrappers, builders and pub-subs into separate package.

* Chore: add workflow for elementary_helper.

* Docs: big update of documentation.

* Chore: update workflows, replace deprecated flutter format.

* Refactor: format code for elementary helper.

* Chore: rename directory to follow pub convention.

* Chore: elementary_test preparation to release.

* Chore: adjust examples.

* Feat: update templates for cli tool.

* Feat: update templates for mason.

* Refactor: fix warnings.

---------

Co-authored-by: KristinaZoteva <kristina1994misha@gmail.com>
  • Loading branch information
MbIXjkee and KristinaZoteva committed Aug 4, 2023
1 parent a61d1c8 commit 9968952
Show file tree
Hide file tree
Showing 228 changed files with 6,666 additions and 830 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/elementary_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
- main
paths:
- "packages/elementary/**"
- ".github/workflows/elementary.yaml"
- ".github/workflows/elementary_analysis.yaml"

push:
branches:
- main
paths:
- "packages/elementary/**"
- ".github/workflows/elementary.yaml"
- ".github/workflows/elementary_analysis.yaml"

jobs:
analysis:
Expand All @@ -23,7 +23,6 @@ jobs:
shell: bash
working-directory: packages/elementary


steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -33,8 +32,8 @@ jobs:
with:
channel: "stable"

- name: Content
id: check_license
- name: Check Files
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "LICENSE, README.md, example, CHANGELOG.md"
Expand All @@ -43,27 +42,19 @@ jobs:
if: steps.check_files.outputs.files_exists == 'true'
run: echo Content is ok!

- name: Check Description
run: echo | grep -q Description README.md ; echo $?

- name: Check Overview
run: echo | grep -q Overview README.md ; echo $?

- name: Check Technical Overview
run: echo | grep -q 'Technical Overview' README.md ; echo $?

- name: Install dependencies
run: flutter pub get

- name: Run dependency validator
run: |
dart pub global activate dependency_validator
dart pub global run dependency_validator:dependency_validator
- name: Run analyzer
run: flutter analyze --fatal-warnings --fatal-infos .

- name: Run formatter
run: flutter format --set-exit-if-changed .
run: dart format --set-exit-if-changed .

- name: Run package analyzer
uses: axel-op/dart-package-analyzer@v3
Expand Down
146 changes: 146 additions & 0 deletions .github/workflows/elementary_helper_analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: elementary helper analysis

on:
pull_request:
branches:
- main
paths:
- "packages/elementary_helper/**"
- ".github/workflows/elementary_helper_analysis.yaml"

push:
branches:
- main
paths:
- "packages/elementary_helper/**"
- ".github/workflows/elementary_helper_analysis.yaml"

jobs:
analysis:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/elementary_helper

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Check Files
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "LICENSE, README.md, example, CHANGELOG.md"

- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
run: echo Content is ok!

- name: Install dependencies
run: flutter pub get

- name: Run dependency validator
run: |
dart pub global activate dependency_validator
dart pub global run dependency_validator:dependency_validator
- name: Run analyzer
run: flutter analyze --fatal-warnings --fatal-infos .

- name: Run formatter
run: dart format --set-exit-if-changed .

- name: Run package analyzer
uses: axel-op/dart-package-analyzer@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/elementary_helper/

testing:
needs: analysis
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/elementary_helper

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install dependencies
run: flutter pub get

- name: Run tests
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
if: success()
run: |
flutter test --coverage
bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info -F elementary_helper
build_android_example:
needs: analysis
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/elementary_helper

steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install dependencies
run: flutter pub get

- name: Build Android
run: |
cd example
flutter pub get
flutter build apk
build_ios_example:
needs: analysis
runs-on: macos-latest
defaults:
run:
shell: bash
working-directory: packages/elementary_helper

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install dependencies
run: flutter pub get

- name: Build iOS
run: |
cd example
flutter pub get
flutter build ios --release --no-codesign
102 changes: 82 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,97 @@
# Flutter Elementary repository
###
<p align="center">
<img src="https://i.ibb.co/jgkB4ZN/Elementary-Logo.png" alt="Elementary Logo">
</p>

<img src="https://i.ibb.co/jgkB4ZN/Elementary-Logo.png" alt="Elementary Logo" style="margin:50px 0px">
###

[![Pub Version](https://img.shields.io/pub/v/elementary?logo=dart&logoColor=white)](https://pub.dev/packages/elementary)
[![Coverage Status](https://img.shields.io/codecov/c/github/Elementary-team/flutter-elementary?flag=elementary&logo=codecov&logoColor=white)](https://app.codecov.io/gh/Elementary-team/flutter-elementary)
[![Pub points](https://badgen.net/pub/points/elementary)](https://pub.dev/packages/elementary)
[![Pub Likes](https://badgen.net/pub/likes/elementary)](https://pub.dev/packages/elementary)
[![Pub popularity](https://badgen.net/pub/popularity/elementary)](https://pub.dev/packages/elementary)
[![Contributors](https://badgen.net/github/contributors/Elementary-team/flutter-elementary)](https://github.com/Elementary-team/flutter-elementary/graphs/contributors)
[![License](https://badgen.net/github/license/Elementary-team/flutter-elementary)](https://github.com/Elementary-team/flutter-elementary/blob/main/LICENSE)
<p align="center">
<a href="https://github.com/MbIXjkee"><img src="https://img.shields.io/badge/Owner-mbixjkee-red.svg" alt="Owner"></a>
<a href="https://pub.dev/packages/elementary"><img src="https://img.shields.io/pub/v/elementary?logo=dart&logoColor=white" alt="Pub Version"></a>
<a href="https://app.codecov.io/gh/Elementary-team/flutter-elementary"><img src="https://img.shields.io/codecov/c/github/Elementary-team/flutter-elementary?flag=elementary&logo=codecov&logoColor=white" alt="Coverage Status"></a>
<a href="https://pub.dev/packages/elementary"><img src="https://badgen.net/pub/points/elementary" alt="Pub points"></a>
<a href="https://pub.dev/packages/elementary"><img src="https://badgen.net/pub/likes/elementary" alt="Pub Likes"></a>
<a href="https://pub.dev/packages/elementary"><img src="https://badgen.net/pub/popularity/elementary" alt="Pub popularity"></a>
<a href="https://github.com/Elementary-team/flutter-elementary/graphs/contributors"><img src="https://badgen.net/github/contributors/Elementary-team/flutter-elementary" alt="Contributors"></a>
<a href="https://github.com/Elementary-team/flutter-elementary/blob/main/LICENSE"><img src="https://badgen.net/github/license/Elementary-team/flutter-elementary" alt="License"></a>
</p>

## Description

This is a home to a family of Elementary library packages.
This repository is a home to packages and tools from the Elementary library family.

| Package | Version |
| --------------|:-------------:|
| [elementary](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary) | [![Pub Version](https://img.shields.io/pub/v/elementary?logo=dart&logoColor=white)](https://pub.dev/packages/elementary) |
| [elementary_test](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary_test) | [![Pub Version](https://img.shields.io/pub/v/elementary_test?logo=dart&logoColor=white)](https://pub.dev/packages/elementary_test) |
| [elementary_cli](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary_tools/elementary_cli) | [![Pub Version](https://img.shields.io/pub/v/elementary_cli?logo=dart&logoColor=white)](https://pub.dev/packages/elementary_cli) |
| Package | Version |
|----------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------:|
| [elementary](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary) | [![Pub Version](https://img.shields.io/pub/v/elementary?logo=dart&logoColor=white)](https://pub.dev/packages/elementary) |
| [elementary_helper](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary_helper) | [![Pub Version](https://img.shields.io/pub/v/elementary_helper?logo=dart&logoColor=white)](https://pub.dev/packages/elementary_helper) |
| [elementary_test](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary_test) | [![Pub Version](https://img.shields.io/pub/v/elementary_test?logo=dart&logoColor=white)](https://pub.dev/packages/elementary_test) |
| [elementary_cli](https://github.com/Elementary-team/flutter-elementary/tree/main/packages/elementary_tools/elementary_cli) | [![Pub Version](https://img.shields.io/pub/v/elementary_cli?logo=dart&logoColor=white)](https://pub.dev/packages/elementary_cli) |

## Elementary overview

The primary goal of this library is to split code into different responsibility layers, thus making it clearer,
simpler as well as more readable and testable. This approach is based on an architectural pattern called MVVM and
the fundamentals of Clean Architecture.
Elementary is a simple and reliable way to build applications with MVVM in Flutter.
Benefits from using:

## Sponsor
- maximum Flutter-like, you don't need to spend a lot of time learning the library if you are already familiar with the
standard Flutter approaches;
- splitting code into different layers by responsibility, that bring low coupling, make code simpler as well as more
readable;
- high testability of all layers from widgets to business logic;
- speed boost for a team consisting of more than one person, due to the easy sharing of independent task-parts among
team members.

Our main sponsor is [Surf](https://surf.ru/).
## Environment

For reduce amount of boilerplate and the manual work, for Elementary there are few options:

- [elementary_cli](https://pub.dev/packages/elementary_cli) - command line util helps with boilerplate generation;
- [plugin for IntelliJ](https://plugins.jetbrains.com/plugin/18099-elementary) - plugin for IntelliJ IDE family,
based on elementary_cli;
- [plugin for VSCode](https://marketplace.visualstudio.com/items?itemName=ElementaryTeam.elementary) - plugin for VSCode,
based on elementary_cli;
- [elementary brick](https://brickhub.dev/bricks/elementary) - command line util helps with boilerplate generation,
based on mason.

## Examples

[Country](https://github.com/Elementary-team/flutter-elementary/tree/main/examples/country) - general example how to use elementary for development;

[Elementary with Redux](https://github.com/Elementary-team/flutter-elementary/tree/main/examples/elementary_redux) - example how to use elementary + redux;

[Profile](https://github.com/Elementary-team/flutter-elementary/tree/main/examples/profile) - example shows the feature with the process that spread by separate screens, and also how to use elementary + bloc;

## Maintainer

[Mikhail Zotyev](https://github.com/MbIXjkee)
<a href="https://github.com/MbIXjkee">
<div style="display: inline-block;">
<img src="https://i.ibb.co/6Hhpg5L/circle-ava-jedi.png" height="64" width="64" alt="Maintainer avatar">
<p style="float:right; margin-left: 8px;">Mikhail Zotyev</p>
</div>
</a>

## Contributors thanks

Big thanks to all these people, who put their effort to help the project.

![contributors](https://contributors-img.firebaseapp.com/image?repo=Elementary-team/flutter-elementary)
<a href="https://github.com/Elementary-team/flutter-elementary/graphs/contributors"></a>

Special thanks to:

[Dmitry Krutskikh](https://github.com/dkrutskikh), [Konoshenko Vlad](https://github.com/vlkonoshenko),
[Denis Grafov](https://github.com/grafovdenis) for the early adoption and the first production feedback;

[Alex Bukin](https://github.com/AlexeyBukin) for IDE plugins;

All members of the Surf Flutter Team for actively using and providing feedback.

## Sponsorship

Special sponsor of the project:

<a href="https://surf.ru/">
<img src="https://surf.ru/wp-content/themes/surf/assets/img/logo.svg" alt="Surf"/>
</a>

For all questions regarding sponsorship/collaboration connect with [Mikhail Zotyev](https://github.com/MbIXjkee).
2 changes: 1 addition & 1 deletion examples/country/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
Loading

0 comments on commit 9968952

Please sign in to comment.