diff --git a/.gradle/6.1.1/executionHistory/executionHistory.lock b/.gradle/6.1.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..d663f93 Binary files /dev/null and b/.gradle/6.1.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.1.1/fileChanges/last-build.bin b/.gradle/6.1.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.1.1/fileChanges/last-build.bin differ diff --git a/.gradle/6.1.1/fileHashes/fileHashes.lock b/.gradle/6.1.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..4d41858 Binary files /dev/null and b/.gradle/6.1.1/fileHashes/fileHashes.lock differ diff --git a/lib/data/base/export.dart b/.gradle/6.1.1/gc.properties similarity index 100% rename from lib/data/base/export.dart rename to .gradle/6.1.1/gc.properties diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..46fc882 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..bc5271b --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Mon Mar 01 13:25:25 PKT 2021 +gradle.version=6.1.1 diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock new file mode 100644 index 0000000..e1c919c Binary files /dev/null and b/.gradle/checksums/checksums.lock differ diff --git a/lib/data/export.dart b/.gradle/vcs-1/gc.properties similarity index 100% rename from lib/data/export.dart rename to .gradle/vcs-1/gc.properties diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 0000000..1985397 --- /dev/null +++ b/core/.gitignore @@ -0,0 +1,74 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/core/.metadata b/core/.metadata new file mode 100644 index 0000000..bfc12cb --- /dev/null +++ b/core/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 + channel: stable + +project_type: package diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md new file mode 100644 index 0000000..ac07159 --- /dev/null +++ b/core/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.0.1] - TODO: Add release date. + +* TODO: Describe initial release. diff --git a/core/LICENSE b/core/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/core/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/core/README.md b/core/README.md new file mode 100644 index 0000000..b9c1e72 --- /dev/null +++ b/core/README.md @@ -0,0 +1,14 @@ +# core + +A new Flutter package. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/core/lib/core.dart b/core/lib/core.dart new file mode 100644 index 0000000..dd8ed2a --- /dev/null +++ b/core/lib/core.dart @@ -0,0 +1,7 @@ +library core; + +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/core/pubspec.lock b/core/pubspec.lock new file mode 100644 index 0000000..ed3ea9d --- /dev/null +++ b/core/pubspec.lock @@ -0,0 +1,147 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" +sdks: + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.17.0" diff --git a/core/pubspec.yaml b/core/pubspec.yaml new file mode 100644 index 0000000..bd3c673 --- /dev/null +++ b/core/pubspec.yaml @@ -0,0 +1,54 @@ +name: core +description: A new Flutter package. +version: 0.0.1 +author: +homepage: + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/core/test/core_test.dart b/core/test/core_test.dart new file mode 100644 index 0000000..844f24a --- /dev/null +++ b/core/test/core_test.dart @@ -0,0 +1,13 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:core/core.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + expect(() => calculator.addOne(null), throwsNoSuchMethodError); + }); +} diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..1985397 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,74 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/data/.metadata b/data/.metadata new file mode 100644 index 0000000..bfc12cb --- /dev/null +++ b/data/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 + channel: stable + +project_type: package diff --git a/data/CHANGELOG.md b/data/CHANGELOG.md new file mode 100644 index 0000000..ac07159 --- /dev/null +++ b/data/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.0.1] - TODO: Add release date. + +* TODO: Describe initial release. diff --git a/data/LICENSE b/data/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/data/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/data/README.md b/data/README.md new file mode 100644 index 0000000..6c779f0 --- /dev/null +++ b/data/README.md @@ -0,0 +1,14 @@ +# data + +A new Flutter package. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/lib/data/model/export.dart b/data/lib/base/export.dart similarity index 100% rename from lib/data/model/export.dart rename to data/lib/base/export.dart diff --git a/data/lib/data.dart b/data/lib/data.dart new file mode 100644 index 0000000..c89e71d --- /dev/null +++ b/data/lib/data.dart @@ -0,0 +1,7 @@ +library data; + +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/lib/data/repo/export.dart b/data/lib/export.dart similarity index 100% rename from lib/data/repo/export.dart rename to data/lib/export.dart diff --git a/lib/domain/base/export.dart b/data/lib/model/export.dart similarity index 100% rename from lib/domain/base/export.dart rename to data/lib/model/export.dart diff --git a/data/lib/network/network_helper.dart b/data/lib/network/network_helper.dart new file mode 100755 index 0000000..7cb95f0 --- /dev/null +++ b/data/lib/network/network_helper.dart @@ -0,0 +1,10 @@ +import 'package:http/http.dart' as http; + +abstract class NetworkHelper { + Future get(String url, {Map headers}); + Future post(String url, {Map headers, body, encoding}); + Future delete(String url, {Map headers}); + Future put(String url, {Map headers, body, encoding}); + Map appendHeader({Map headers}); + http.Response handleResponse(http.Response response); +} diff --git a/data/lib/network/network_helper_impl.dart b/data/lib/network/network_helper_impl.dart new file mode 100755 index 0000000..45d454b --- /dev/null +++ b/data/lib/network/network_helper_impl.dart @@ -0,0 +1,89 @@ +import 'dart:convert'; +import 'package:flutter/cupertino.dart'; +import 'package:http/http.dart' as http; +import 'network_helper.dart'; + +class NetworkHelperImpl extends NetworkHelper { + @override + Future get(String url, {Map headers}) { + return http.get(url, headers: appendHeader(headers: headers)).then(( + http.Response response, + ) { + return handleResponse(response); + }); + } + + @override + Future post(String url, {Map headers, body, encoding}) { + return http + .post(url, + body: json.encode(body), + headers: appendHeader(headers: headers), + encoding: encoding) + .then((http.Response response) { + return handleResponse(response); + }); + } + + @override + Future delete(String url, {Map headers}) { + return http + .delete(url, headers: appendHeader(headers: headers)) + .then((http.Response response) { + return handleResponse(response); + }); + } + + @override + Future put(String url, {Map headers, body, encoding}) { + return http + .put(url, + body: json.encode(body), + headers: appendHeader(headers: headers), + encoding: encoding) + .then( + (http.Response response) { + return handleResponse(response); + }, + ); + } + + @override + http.Response handleResponse(http.Response response) { + final int statusCode = response.statusCode; + switch (statusCode) { + case 401: + { + // di().refreshIdToken(); + throw new Exception("Unauthorized"); + } + case 500: + { + throw new Exception("Internal server error"); + } + default: + return response; + } + } + + @override + Map appendHeader({Map headers, bool refresh = false}) { + try { + if (headers == null) { + headers = {}; + } + var idToken; + // idToken = di().getIdToken(); + + if (idToken == null || idToken.isEmpty) + throw ("Id token cannot be empty!"); + + headers["Authorization"] = 'Bearer $idToken'; + headers["Content-Type"] = "application/json"; + } catch (e) { + debugPrint(e.toString()); + } + + return headers; + } +} diff --git a/lib/domain/entities/export.dart b/data/lib/repo/export.dart similarity index 100% rename from lib/domain/entities/export.dart rename to data/lib/repo/export.dart diff --git a/data/pubspec.lock b/data/pubspec.lock new file mode 100644 index 0000000..85e1a2d --- /dev/null +++ b/data/pubspec.lock @@ -0,0 +1,168 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" +sdks: + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.17.0" diff --git a/data/pubspec.yaml b/data/pubspec.yaml new file mode 100644 index 0000000..23779e9 --- /dev/null +++ b/data/pubspec.yaml @@ -0,0 +1,57 @@ +name: data +description: A new Flutter package. +version: 0.0.1 +author: +homepage: + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + #Network + http: 0.12.1 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + +# To add assets to your package, add an assets section, like this: +# assets: +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg +# +# For details regarding assets in packages, see +# https://flutter.dev/assets-and-images/#from-packages +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/assets-and-images/#resolution-aware. + +# To add custom fonts to your package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages diff --git a/data/test/data_test.dart b/data/test/data_test.dart new file mode 100644 index 0000000..0fb55e3 --- /dev/null +++ b/data/test/data_test.dart @@ -0,0 +1,13 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:data/data.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + expect(() => calculator.addOne(null), throwsNoSuchMethodError); + }); +} diff --git a/domain/.gitignore b/domain/.gitignore new file mode 100644 index 0000000..1985397 --- /dev/null +++ b/domain/.gitignore @@ -0,0 +1,74 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/domain/.metadata b/domain/.metadata new file mode 100644 index 0000000..bfc12cb --- /dev/null +++ b/domain/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 + channel: stable + +project_type: package diff --git a/domain/CHANGELOG.md b/domain/CHANGELOG.md new file mode 100644 index 0000000..ac07159 --- /dev/null +++ b/domain/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.0.1] - TODO: Add release date. + +* TODO: Describe initial release. diff --git a/domain/LICENSE b/domain/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/domain/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/domain/README.md b/domain/README.md new file mode 100644 index 0000000..430eac3 --- /dev/null +++ b/domain/README.md @@ -0,0 +1,14 @@ +# domain + +A new Flutter package. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/lib/domain/export.dart b/domain/lib/base/export.dart similarity index 100% rename from lib/domain/export.dart rename to domain/lib/base/export.dart diff --git a/domain/lib/di/di.dart b/domain/lib/di/di.dart new file mode 100644 index 0000000..a3d1fe7 --- /dev/null +++ b/domain/lib/di/di.dart @@ -0,0 +1,13 @@ + +import 'package:get_it/get_it.dart'; + +final di = GetIt.instance; + +Future initializeDomainDependencies() { + +} + +Future initializeRepoDependencies(){ + + +} \ No newline at end of file diff --git a/lib/domain/use_case/export.dart b/domain/lib/di/export.dart similarity index 100% rename from lib/domain/use_case/export.dart rename to domain/lib/di/export.dart diff --git a/domain/lib/domain.dart b/domain/lib/domain.dart new file mode 100644 index 0000000..d9f0b6c --- /dev/null +++ b/domain/lib/domain.dart @@ -0,0 +1,7 @@ +library domain; + +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/lib/presentation/base/export.dart b/domain/lib/entities/export.dart similarity index 100% rename from lib/presentation/base/export.dart rename to domain/lib/entities/export.dart diff --git a/lib/presentation/di/export.dart b/domain/lib/export.dart similarity index 100% rename from lib/presentation/di/export.dart rename to domain/lib/export.dart diff --git a/lib/presentation/export.dart b/domain/lib/use_case/export.dart similarity index 100% rename from lib/presentation/export.dart rename to domain/lib/use_case/export.dart diff --git a/domain/pubspec.lock b/domain/pubspec.lock new file mode 100644 index 0000000..88be84d --- /dev/null +++ b/domain/pubspec.lock @@ -0,0 +1,154 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.6" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" +sdks: + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.17.0" diff --git a/domain/pubspec.yaml b/domain/pubspec.yaml new file mode 100644 index 0000000..a718735 --- /dev/null +++ b/domain/pubspec.yaml @@ -0,0 +1,54 @@ +name: domain +description: A new Flutter package. +version: 0.0.1 +author: +homepage: + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + get_it: ^5.0.6 +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + +# To add assets to your package, add an assets section, like this: +# assets: +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg +# +# For details regarding assets in packages, see +# https://flutter.dev/assets-and-images/#from-packages +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/assets-and-images/#resolution-aware. + +# To add custom fonts to your package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages diff --git a/domain/test/domain_test.dart b/domain/test/domain_test.dart new file mode 100644 index 0000000..3e72d9b --- /dev/null +++ b/domain/test/domain_test.dart @@ -0,0 +1,13 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:domain/domain.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + expect(() => calculator.addOne(null), throwsNoSuchMethodError); + }); +} diff --git a/lib/presentation/provider/export.dart b/lib/base/export.dart similarity index 100% rename from lib/presentation/provider/export.dart rename to lib/base/export.dart diff --git a/lib/di/di.dart b/lib/di/di.dart new file mode 100644 index 0000000..6712e11 --- /dev/null +++ b/lib/di/di.dart @@ -0,0 +1,5 @@ +import 'package:domain/di/di.dart'; + +Future initializeDependencies(){ + initializeDomainDependencies(); +} \ No newline at end of file diff --git a/lib/presentation/screen/export.dart b/lib/di/export.dart similarity index 100% rename from lib/presentation/screen/export.dart rename to lib/di/export.dart diff --git a/lib/presentation/screen/home/contract.dart b/lib/export.dart similarity index 100% rename from lib/presentation/screen/home/contract.dart rename to lib/export.dart diff --git a/lib/main.dart b/lib/main.dart index 7352f60..cd72495 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -34,7 +34,147 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title), ), - body: Center(), + body: Center( + child: CustomPaint( + size: Size(50, (50 * 1).toDouble()), + //You can Replace [WIDTH] with your desired width for Custom Paint and height will be calculated automatically + painter: RPSCustomPainter(), + ), + ), ); } } + +//Add this CustomPaint widget to the Widget Tree + +//Copy this CustomPainter code to the Bottom of the File +class RPSCustomPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + Path path = Path(); + path.moveTo(size.width * 0.9266250, size.height * 0.7687917); + path.lineTo(size.width * 0.5600833, size.height * 0.1590000); + path.cubicTo( + size.width * 0.5472917, + size.height * 0.1377083, + size.width * 0.5248333, + size.height * 0.1250000, + size.width * 0.5000000, + size.height * 0.1250000); + path.cubicTo( + size.width * 0.4751667, + size.height * 0.1250000, + size.width * 0.4527083, + size.height * 0.1377083, + size.width * 0.4399583, + size.height * 0.1589583); + path.lineTo(size.width * 0.07337500, size.height * 0.7687917); + path.cubicTo( + size.width * 0.06037500, + size.height * 0.7904167, + size.width * 0.06004167, + size.height * 0.8174583, + size.width * 0.07245833, + size.height * 0.8394167); + path.cubicTo( + size.width * 0.08483333, + size.height * 0.8613750, + size.width * 0.1082083, + size.height * 0.8750000, + size.width * 0.1334583, + size.height * 0.8750000); + path.lineTo(size.width * 0.8665833, size.height * 0.8750000); + path.cubicTo( + size.width * 0.8917917, + size.height * 0.8750000, + size.width * 0.9152083, + size.height * 0.8613750, + size.width * 0.9275833, + size.height * 0.8394167); + path.cubicTo( + size.width * 0.9400000, + size.height * 0.8174583, + size.width * 0.9396250, + size.height * 0.7904167, + size.width * 0.9266250, + size.height * 0.7687917); + path.close(); + path.moveTo(size.width * 0.5208333, size.height * 0.7500000); + path.lineTo(size.width * 0.4791667, size.height * 0.7500000); + path.cubicTo( + size.width * 0.4676667, + size.height * 0.7500000, + size.width * 0.4583333, + size.height * 0.7406667, + size.width * 0.4583333, + size.height * 0.7291667); + path.lineTo(size.width * 0.4583333, size.height * 0.6875000); + path.cubicTo( + size.width * 0.4583333, + size.height * 0.6760000, + size.width * 0.4676667, + size.height * 0.6666667, + size.width * 0.4791667, + size.height * 0.6666667); + path.lineTo(size.width * 0.5208333, size.height * 0.6666667); + path.cubicTo( + size.width * 0.5323333, + size.height * 0.6666667, + size.width * 0.5416667, + size.height * 0.6760000, + size.width * 0.5416667, + size.height * 0.6875000); + path.lineTo(size.width * 0.5416667, size.height * 0.7291667); + path.cubicTo( + size.width * 0.5416667, + size.height * 0.7406667, + size.width * 0.5323333, + size.height * 0.7500000, + size.width * 0.5208333, + size.height * 0.7500000); + path.close(); + path.moveTo(size.width * 0.5000000, size.height * 0.5833333); + path.lineTo(size.width * 0.5000000, size.height * 0.5833333); + path.cubicTo( + size.width * 0.4770000, + size.height * 0.5833333, + size.width * 0.4583333, + size.height * 0.5646667, + size.width * 0.4583333, + size.height * 0.5416667); + path.lineTo(size.width * 0.4583333, size.height * 0.4166667); + path.cubicTo( + size.width * 0.4583333, + size.height * 0.3936667, + size.width * 0.4770000, + size.height * 0.3750000, + size.width * 0.5000000, + size.height * 0.3750000); + path.lineTo(size.width * 0.5000000, size.height * 0.3750000); + path.cubicTo( + size.width * 0.5230000, + size.height * 0.3750000, + size.width * 0.5416667, + size.height * 0.3936667, + size.width * 0.5416667, + size.height * 0.4166667); + path.lineTo(size.width * 0.5416667, size.height * 0.5416667); + path.cubicTo( + size.width * 0.5416667, + size.height * 0.5646667, + size.width * 0.5230000, + size.height * 0.5833333, + size.width * 0.5000000, + size.height * 0.5833333); + path.close(); + + Paint paint = Paint()..style = PaintingStyle.fill; + paint.color = Colors.red; + canvas.drawPath(path, paint); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) { + return true; + } +} diff --git a/lib/presentation/screen/home/page.dart b/lib/provider/export.dart similarity index 100% rename from lib/presentation/screen/home/page.dart rename to lib/provider/export.dart diff --git a/lib/presentation/screen/home/presenter_Impl.dart b/lib/screen/export.dart similarity index 100% rename from lib/presentation/screen/home/presenter_Impl.dart rename to lib/screen/export.dart diff --git a/lib/screen/home/contract.dart b/lib/screen/home/contract.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/screen/home/page.dart b/lib/screen/home/page.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/screen/home/presenter_Impl.dart b/lib/screen/home/presenter_Impl.dart new file mode 100644 index 0000000..e69de29 diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..086acc5 --- /dev/null +++ b/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Mon Mar 01 13:22:56 PKT 2021 +sdk.dir=/Users/muhammad/Library/Android/sdk diff --git a/localization/.gitignore b/localization/.gitignore new file mode 100644 index 0000000..1985397 --- /dev/null +++ b/localization/.gitignore @@ -0,0 +1,74 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/localization/.metadata b/localization/.metadata new file mode 100644 index 0000000..bfc12cb --- /dev/null +++ b/localization/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 + channel: stable + +project_type: package diff --git a/localization/CHANGELOG.md b/localization/CHANGELOG.md new file mode 100644 index 0000000..ac07159 --- /dev/null +++ b/localization/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.0.1] - TODO: Add release date. + +* TODO: Describe initial release. diff --git a/localization/LICENSE b/localization/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/localization/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/localization/README.md b/localization/README.md new file mode 100644 index 0000000..4a5d069 --- /dev/null +++ b/localization/README.md @@ -0,0 +1,14 @@ +# localization1 + +A new Flutter package. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/localization/lib/localization.dart b/localization/lib/localization.dart new file mode 100644 index 0000000..2ce30bf --- /dev/null +++ b/localization/lib/localization.dart @@ -0,0 +1,7 @@ +library localization1; + +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/localization/pubspec.lock b/localization/pubspec.lock new file mode 100644 index 0000000..ed3ea9d --- /dev/null +++ b/localization/pubspec.lock @@ -0,0 +1,147 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" +sdks: + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.17.0" diff --git a/localization/pubspec.yaml b/localization/pubspec.yaml new file mode 100644 index 0000000..ff28ca0 --- /dev/null +++ b/localization/pubspec.yaml @@ -0,0 +1,54 @@ +name: localization1 +description: A new Flutter package. +version: 0.0.1 +author: +homepage: + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/localization/test/localization_test.dart b/localization/test/localization_test.dart new file mode 100644 index 0000000..5c325f0 --- /dev/null +++ b/localization/test/localization_test.dart @@ -0,0 +1,14 @@ +import 'package:flutter_test/flutter_test.dart'; + +import '../lib/localization.dart'; + + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + expect(() => calculator.addOne(null), throwsNoSuchMethodError); + }); +} diff --git a/pubspec.lock b/pubspec.lock index 96650d2..2abe012 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -50,6 +50,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + domain: + dependency: "direct main" + description: + path: domain + relative: true + source: path + version: "0.0.1" fake_async: dependency: transitive description: @@ -172,4 +179,4 @@ packages: version: "2.1.0-nullsafety.3" sdks: dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.16.0 <2.0.0" + flutter: ">=1.17.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8930e3a..d06b802 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,6 +30,8 @@ dependencies: #di get_it: ^5.0.6 provider: ^4.3.3 + domain: + path: ./domain dev_dependencies: flutter_test: