diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 00000000..40ce549d --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,30 @@ +name: Dart CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + test: + #The type of machine to run the job on. [windows,macos, ubuntu , self-hosted] + runs-on: macos-latest + #sequence of tasks called + steps: + # The branch or tag ref that triggered the workflow will be checked out. + # https://github.com/actions/checkout + - uses: actions/checkout@v1 + # Setup a flutter environment. + # https://github.com/marketplace/actions/flutter-action + - uses: subosito/flutter-action@v1 + with: + flutter-version: '1.15.18' + channel: 'dev' + - run: flutter pub get + - name: Static analysis + run: flutter analyze + # - name: Running tests + # We can run SQLite tests only on real device + # run: flutter run -t test/tests.dart diff --git a/README.md b/README.md index 1acdefca..fbb64c14 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,30 @@ Functionality description and discussion [E-commerce App Mobile App Local Database Structure](https://medium.com/@openflutterproject/open-flutter-project-e-commerce-app-local-database-4744b61264c7) +## Flutter Version +You may need to update flutter to dev or beta for the most recent updates to work. Use following commands to upgrade flutter: + +``` +flutter channel dev +flutter upgrade +``` +or + +``` +flutter channel beta +flutter upgrade +``` + +## Tests +To run tests use command below: + +``` +flutter run -t test/test.dart +``` + + +## IDE settings You need to update the configuration of your IDE to tell the location of the entry point. The example for VS Code is below: diff --git a/lib/domain/entities/entity.dart b/lib/domain/entities/entity.dart index 28e662a1..0cc3f645 100644 --- a/lib/domain/entities/entity.dart +++ b/lib/domain/entities/entity.dart @@ -7,7 +7,11 @@ abstract class Entity extends Equatable { Entity(this.id); - Map toMap(); + Map toMap() { + return { + 'id': id + }; + } @override List get props => []; diff --git a/pubspec.yaml b/pubspec.yaml index 84d38aea..98063ac3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,14 +33,15 @@ dependencies: bubble_tab_indicator: any dartz: ^0.8.9 rxdart: ^0.23.1 - pedantic: ^1.9.0 sqflite: path: dev_dependencies: flutter_test: sdk: flutter -# pedantic: 1.8.0+1 + +dependency_overrides: + pedantic: ^1.9.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/test/data/local/user/user_data_source_test.dart b/test/data/local/user/user_data_source_test.dart index e7fce7e4..588afe4f 100644 --- a/test/data/local/user/user_data_source_test.dart +++ b/test/data/local/user/user_data_source_test.dart @@ -59,7 +59,7 @@ void main() { await dataSource.update(dataToUpdate); - UserEntity updatedData = await dataSource.get(dataToUpdate.id); + var updatedData = await dataSource.get(dataToUpdate.id); expect(dataToUpdate == updatedData, true); });