Browse Source

finish work

master
mohsen zamani 2 years ago
parent
commit
64fa30173f
  1. 3
      assets/images/svg/next_level.svg
  2. 3
      assets/images/svg/sad.svg
  3. 30
      data/data_core/local_db/local_db_core/.gitignore
  4. 10
      data/data_core/local_db/local_db_core/.metadata
  5. 3
      data/data_core/local_db/local_db_core/CHANGELOG.md
  6. 1
      data/data_core/local_db/local_db_core/LICENSE
  7. 39
      data/data_core/local_db/local_db_core/README.md
  8. 4
      data/data_core/local_db/local_db_core/analysis_options.yaml
  9. 25
      data/data_core/local_db/local_db_core/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
  10. 2
      data/data_core/local_db/local_db_core/android/local.properties
  11. 14
      data/data_core/local_db/local_db_core/ios/Flutter/Generated.xcconfig
  12. 13
      data/data_core/local_db/local_db_core/ios/Flutter/flutter_export_environment.sh
  13. 19
      data/data_core/local_db/local_db_core/ios/Runner/GeneratedPluginRegistrant.h
  14. 21
      data/data_core/local_db/local_db_core/ios/Runner/GeneratedPluginRegistrant.m
  15. 75
      data/data_core/local_db/local_db_core/lib/boxes/box_list/level_box/level_box.dart
  16. 8
      data/data_core/local_db/local_db_core/lib/boxes/box_list/level_box/level_box_keys.dart
  17. 7
      data/data_core/local_db/local_db_core/lib/boxes/interfaces/base_box_interface.dart
  18. 1
      data/data_core/local_db/local_db_core/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
  19. 11
      data/data_core/local_db/local_db_core/linux/flutter/generated_plugin_registrant.cc
  20. 15
      data/data_core/local_db/local_db_core/linux/flutter/generated_plugin_registrant.h
  21. 23
      data/data_core/local_db/local_db_core/linux/flutter/generated_plugins.cmake
  22. 12
      data/data_core/local_db/local_db_core/macos/Flutter/GeneratedPluginRegistrant.swift
  23. 11
      data/data_core/local_db/local_db_core/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
  24. 12
      data/data_core/local_db/local_db_core/macos/Flutter/ephemeral/flutter_export_environment.sh
  25. 23
      data/data_core/local_db/local_db_core/pubspec.yaml
  26. 11
      data/data_core/local_db/local_db_core/windows/flutter/generated_plugin_registrant.cc
  27. 15
      data/data_core/local_db/local_db_core/windows/flutter/generated_plugin_registrant.h
  28. 23
      data/data_core/local_db/local_db_core/windows/flutter/generated_plugins.cmake
  29. 30
      data/data_types/types/.gitignore
  30. 10
      data/data_types/types/.metadata
  31. 3
      data/data_types/types/CHANGELOG.md
  32. 1
      data/data_types/types/LICENSE
  33. 39
      data/data_types/types/README.md
  34. 4
      data/data_types/types/analysis_options.yaml
  35. 25
      data/data_types/types/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
  36. 2
      data/data_types/types/android/local.properties
  37. 14
      data/data_types/types/ios/Flutter/Generated.xcconfig
  38. 13
      data/data_types/types/ios/Flutter/flutter_export_environment.sh
  39. 19
      data/data_types/types/ios/Runner/GeneratedPluginRegistrant.h
  40. 21
      data/data_types/types/ios/Runner/GeneratedPluginRegistrant.m
  41. 83
      data/data_types/types/lib/level_data/interface/level_box_repository_impl.dart
  42. 1
      data/data_types/types/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
  43. 11
      data/data_types/types/linux/flutter/generated_plugin_registrant.cc
  44. 15
      data/data_types/types/linux/flutter/generated_plugin_registrant.h
  45. 23
      data/data_types/types/linux/flutter/generated_plugins.cmake
  46. 12
      data/data_types/types/macos/Flutter/GeneratedPluginRegistrant.swift
  47. 11
      data/data_types/types/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
  48. 12
      data/data_types/types/macos/Flutter/ephemeral/flutter_export_environment.sh
  49. 22
      data/data_types/types/pubspec.yaml
  50. 11
      data/data_types/types/windows/flutter/generated_plugin_registrant.cc
  51. 15
      data/data_types/types/windows/flutter/generated_plugin_registrant.h
  52. 23
      data/data_types/types/windows/flutter/generated_plugins.cmake
  53. 30
      domain/repositories/.gitignore
  54. 10
      domain/repositories/.metadata
  55. 3
      domain/repositories/CHANGELOG.md
  56. 1
      domain/repositories/LICENSE
  57. 39
      domain/repositories/README.md
  58. 4
      domain/repositories/analysis_options.yaml
  59. 25
      domain/repositories/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
  60. 19
      domain/repositories/ios/Runner/GeneratedPluginRegistrant.h
  61. 21
      domain/repositories/ios/Runner/GeneratedPluginRegistrant.m
  62. 49
      domain/repositories/lib/level_box_domain/adapter/level_model_adapter.dart
  63. 37
      domain/repositories/lib/level_box_domain/model/level_model.dart
  64. 11
      domain/repositories/lib/level_box_domain/repository/level_box_repository.dart
  65. 11
      domain/repositories/linux/flutter/generated_plugin_registrant.cc
  66. 15
      domain/repositories/linux/flutter/generated_plugin_registrant.h
  67. 23
      domain/repositories/linux/flutter/generated_plugins.cmake
  68. 12
      domain/repositories/macos/Flutter/GeneratedPluginRegistrant.swift
  69. 11
      domain/repositories/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
  70. 12
      domain/repositories/macos/Flutter/ephemeral/flutter_export_environment.sh
  71. 18
      domain/repositories/pubspec.yaml
  72. 11
      domain/repositories/windows/flutter/generated_plugin_registrant.cc
  73. 15
      domain/repositories/windows/flutter/generated_plugin_registrant.h
  74. 23
      domain/repositories/windows/flutter/generated_plugins.cmake
  75. 25
      lib/initializer.dart
  76. 22
      lib/main.dart
  77. 31
      lib/screens/level_list/cubit/level_list_cubit.dart
  78. 108
      lib/screens/level_list/screen/level_list_screen.dart
  79. 4
      lib/screens/level_list/widgets/level_widget.dart
  80. 4
      lib/screens/level_list/widgets/lock_level_widget.dart
  81. 11
      lib/screens/level_list/widgets/payed_level_widget.dart
  82. 221
      lib/screens/lose/lose_screen.dart
  83. 84
      lib/screens/photo/photo_screen_large.dart
  84. 7
      lib/screens/splash/screen/splash_screen.dart
  85. 235
      lib/screens/win/win_screen.dart
  86. 2
      lib/utils/toast.dart
  87. 36
      lib/widgets/solo_screen/moves_tiles_widget.dart
  88. 6
      lib/widgets/solo_screen/moves_tiles_widget/moves_tiles_text.dart
  89. 39
      pubspec.lock
  90. 6
      pubspec.yaml

3
assets/images/svg/next_level.svg

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="12.028" height="11.723" viewBox="0 0 12.028 11.723">
<path id="Icon_awesome-arrow-right" data-name="Icon awesome-arrow-right" d="M5.114,3.432l.6-.6a.642.642,0,0,1,.91,0l5.219,5.216a.642.642,0,0,1,0,.91L6.62,14.181a.642.642,0,0,1-.91,0l-.6-.6a.645.645,0,0,1,.011-.921L8.36,9.583H.644A.643.643,0,0,1,0,8.938V8.079a.643.643,0,0,1,.644-.644H8.36L5.125,4.353A.64.64,0,0,1,5.114,3.432Z" transform="translate(0 -2.647)" fill="#ff9c00"/>
</svg>

3
assets/images/svg/sad.svg

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="29.25" height="29.25" viewBox="0 0 29.25 29.25">
<path id="Icon_ionic-ios-sad" data-name="Icon ionic-ios-sad" d="M18,3.375A14.625,14.625,0,1,0,32.625,18,14.623,14.623,0,0,0,18,3.375ZM12.8,14.07a1.69,1.69,0,1,1-1.547,1.547A1.691,1.691,0,0,1,12.8,14.07Zm-.049,10.68a1.127,1.127,0,0,1-1.034-1.575,6.844,6.844,0,0,1,12.558,0,1.124,1.124,0,0,1-1.034,1.575,50.671,50.671,0,0,0-5.14-.281C15.4,24.469,12.755,24.75,12.755,24.75ZM23.2,17.43a1.69,1.69,0,1,1,1.547-1.547A1.691,1.691,0,0,1,23.2,17.43Z" transform="translate(-3.375 -3.375)" fill="#fff"/>
</svg>

30
data/data_core/local_db/local_db_core/.gitignore

@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# 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
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

10
data/data_core/local_db/local_db_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: b4bce91dd0f168179d46a7ae5eceb3572ba9637a
channel: stable
project_type: package

3
data/data_core/local_db/local_db_core/CHANGELOG.md

@ -0,0 +1,3 @@
## 0.0.1
* TODO: Describe initial release.

1
data/data_core/local_db/local_db_core/LICENSE

@ -0,0 +1 @@
TODO: Add your license here.

39
data/data_core/local_db/local_db_core/README.md

@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features
TODO: List what your package can do. Maybe include images, gifs, or videos.
## Getting started
TODO: List prerequisites and provide or point to information on how to
start using the package.
## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart
const like = 'sample';
```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

4
data/data_core/local_db/local_db_core/analysis_options.yaml

@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

25
data/data_core/local_db/local_db_core/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

@ -0,0 +1,25 @@
package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
/**
* Generated file. Do not edit.
*/
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}

2
data/data_core/local_db/local_db_core/android/local.properties

@ -0,0 +1,2 @@
sdk.dir=C:\\Work\\Tools\\Sdk
flutter.sdk=C:\\Work\\Tools\\flutter

14
data/data_core/local_db/local_db_core/ios/Flutter/Generated.xcconfig

@ -0,0 +1,14 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Work\Tools\flutter
FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_core\local_db\local_db_core
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib\main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

13
data/data_core/local_db/local_db_core/ios/Flutter/flutter_export_environment.sh

@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Work\Tools\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_core\local_db\local_db_core"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

19
data/data_core/local_db/local_db_core/ios/Runner/GeneratedPluginRegistrant.h

@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end
NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */

21
data/data_core/local_db/local_db_core/ios/Runner/GeneratedPluginRegistrant.m

@ -0,0 +1,21 @@
//
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
}
@end

75
data/data_core/local_db/local_db_core/lib/boxes/box_list/level_box/level_box.dart

@ -0,0 +1,75 @@
import 'package:hive/hive.dart';
import 'package:local_db_core/boxes/box_list/level_box/level_box_keys.dart';
import 'package:local_db_core/boxes/interfaces/base_box_interface.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class LevelBox implements BaseBoxInterface<LevelBoxKeys> {
Box? _box;
LevelBox.privateConstructor();
static final LevelBox instance = LevelBox.privateConstructor();
factory LevelBox() {
return instance;
}
@override
String getBoxName() {
return "level";
}
@override
String getKeyName(LevelBoxKeys key) {
return key.value;
}
@override
Future<void> openBox() async {
_box = await Hive.openBox(getBoxName());
}
void updateData({required Level level}) async {
if (!Hive.isBoxOpen(getBoxName())) {
await openBox();
}
List<Level> list = await getData();
int index = list.indexWhere((element) => element.level == level.level);
if (index != -1) {
list[index] = level;
await saveData(list);
}
}
Future<void> setCurrentLevel(int level) async {
if (!Hive.isBoxOpen(getBoxName())) {
await openBox();
}
_box?.put(getKeyName(LevelBoxKeys.currentLevel), level);
}
Future<int> getLevel() async {
if (!Hive.isBoxOpen(getBoxName())) {
await openBox();
}
int level = _box?.get(getKeyName(LevelBoxKeys.currentLevel), defaultValue: 1) ?? 1;
return level;
}
Future<List<Level>> getData() async {
if (!Hive.isBoxOpen(getBoxName())) {
await openBox();
}
return _box?.values.cast<Level>().toList() ?? [];
}
Future<void> saveData(List<Level> data) async {
if (!Hive.isBoxOpen(getBoxName())) {
await openBox();
}
_box?.addAll(data);
for (var value in data) {
await value.save();
}
}
}

8
data/data_core/local_db/local_db_core/lib/boxes/box_list/level_box/level_box_keys.dart

@ -0,0 +1,8 @@
enum LevelBoxKeys {
levelList('levelList'),
currentLevel('currentLevel');
final String value;
const LevelBoxKeys(this.value);
}

7
data/data_core/local_db/local_db_core/lib/boxes/interfaces/base_box_interface.dart

@ -0,0 +1,7 @@
abstract class BaseBoxInterface<T> {
String getBoxName();
String getKeyName(T key);
Future<void> openBox();
}

1
data/data_core/local_db/local_db_core/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux

@ -0,0 +1 @@
C:/Users/user1/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.1.10/

11
data/data_core/local_db/local_db_core/linux/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void fl_register_plugins(FlPluginRegistry* registry) {
}

15
data/data_core/local_db/local_db_core/linux/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter_linux/flutter_linux.h>
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
data/data_core/local_db/local_db_core/linux/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

12
data/data_core/local_db/local_db_core/macos/Flutter/GeneratedPluginRegistrant.swift

@ -0,0 +1,12 @@
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}

11
data/data_core/local_db/local_db_core/macos/Flutter/ephemeral/Flutter-Generated.xcconfig

@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Work\Tools\flutter
FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_core\local_db\local_db_core
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

12
data/data_core/local_db/local_db_core/macos/Flutter/ephemeral/flutter_export_environment.sh

@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Work\Tools\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_core\local_db\local_db_core"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

23
data/data_core/local_db/local_db_core/pubspec.yaml

@ -0,0 +1,23 @@
name: local_db_core
description: A new Flutter project.
version: 1.0.0+1
publish_to: 'none'
environment:
sdk: ">=2.17.6 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
hive: ^2.0.5
hive_flutter: ^1.1.0
path_provider: ^2.0.11
repositories:
path : ../../../../domain/repositories
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true

11
data/data_core/local_db/local_db_core/windows/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void RegisterPlugins(flutter::PluginRegistry* registry) {
}

15
data/data_core/local_db/local_db_core/windows/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter/plugin_registry.h>
// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
data/data_core/local_db/local_db_core/windows/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

30
data/data_types/types/.gitignore

@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# 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
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

10
data/data_types/types/.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: b4bce91dd0f168179d46a7ae5eceb3572ba9637a
channel: stable
project_type: package

3
data/data_types/types/CHANGELOG.md

@ -0,0 +1,3 @@
## 0.0.1
* TODO: Describe initial release.

1
data/data_types/types/LICENSE

@ -0,0 +1 @@
TODO: Add your license here.

39
data/data_types/types/README.md

@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features
TODO: List what your package can do. Maybe include images, gifs, or videos.
## Getting started
TODO: List prerequisites and provide or point to information on how to
start using the package.
## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart
const like = 'sample';
```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

4
data/data_types/types/analysis_options.yaml

@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

25
data/data_types/types/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

@ -0,0 +1,25 @@
package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
/**
* Generated file. Do not edit.
*/
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}

2
data/data_types/types/android/local.properties

@ -0,0 +1,2 @@
sdk.dir=C:\\Work\\Tools\\Sdk
flutter.sdk=C:\\Work\\Tools\\flutter

14
data/data_types/types/ios/Flutter/Generated.xcconfig

@ -0,0 +1,14 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Work\Tools\flutter
FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_types\types
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib\main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

13
data/data_types/types/ios/Flutter/flutter_export_environment.sh

@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Work\Tools\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_types\types"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

19
data/data_types/types/ios/Runner/GeneratedPluginRegistrant.h

@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end
NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */

21
data/data_types/types/ios/Runner/GeneratedPluginRegistrant.m

@ -0,0 +1,21 @@
//
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
}
@end

83
data/data_types/types/lib/level_data/interface/level_box_repository_impl.dart

@ -0,0 +1,83 @@
import 'package:local_db_core/boxes/box_list/level_box/level_box.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
import 'package:repositories/level_box_domain/repository/level_box_repository.dart';
class LevelBoxRepositoryImpl extends LevelBoxRepository {
final LevelBox _levelBox;
LevelBoxRepositoryImpl({required LevelBox levelBox}) : _levelBox = levelBox;
@override
Future<void> getLevel({required void Function(List<Level> data) result}) async {
final List<Level> levelList = [];
levelList.add(Level(
image: 'assets/images/jpg/level-1.jpg',
duration: 4,
puzzleSize: 3,
level: 1,
));
levelList.add(Level(
image: 'assets/images/jpg/level-2.jpg',
duration: 4,
puzzleSize: 3,
level: 2,
));
levelList.add(Level(
image: 'assets/images/jpg/level-3.jpg',
duration: 4,
puzzleSize: 3,
level: 3,
));
levelList.add(Level(
image: 'assets/images/jpg/level-4.jpg',
duration: 4,
puzzleSize: 3,
level: 4,
));
levelList.add(Level(
image: 'assets/images/jpg/level-5.jpg',
duration: 4,
puzzleSize: 3,
level: 5,
payable: true,
));
levelList.add(Level(
image: 'assets/images/jpg/level-6.jpg',
duration: 4,
puzzleSize: 3,
level: 6,
payable: true,
));
levelList.add(Level(
image: 'assets/images/jpg/level-7.jpg',
duration: 6,
puzzleSize: 4,
level: 7,
payable: true,
));
levelList.add(Level(
image: 'assets/images/jpg/level-8.jpg',
duration: 6,
puzzleSize: 4,
level: 8,
payable: true,
));
_levelBox.saveData(levelList);
result.call(levelList);
}
@override
Future<void> openBox() async {
await _levelBox.openBox();
}
@override
Future<int> getCurrentLevel() async {
return await _levelBox.getLevel();
}
@override
Future<void> setCurrentLevel(int level) async {
await _levelBox.setCurrentLevel(level);
}
}

1
data/data_types/types/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux

@ -0,0 +1 @@
C:/Users/user1/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.1.10/

11
data/data_types/types/linux/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void fl_register_plugins(FlPluginRegistry* registry) {
}

15
data/data_types/types/linux/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter_linux/flutter_linux.h>
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
data/data_types/types/linux/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

12
data/data_types/types/macos/Flutter/GeneratedPluginRegistrant.swift

@ -0,0 +1,12 @@
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}

11
data/data_types/types/macos/Flutter/ephemeral/Flutter-Generated.xcconfig

@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Work\Tools\flutter
FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_types\types
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

12
data/data_types/types/macos/Flutter/ephemeral/flutter_export_environment.sh

@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Work\Tools\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\data\data_types\types"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

22
data/data_types/types/pubspec.yaml

@ -0,0 +1,22 @@
name: types
description: A new Flutter project.
version: 0.0.1
publish_to: 'none'
environment:
sdk: ">=2.17.6 <3.0.0"
flutter: ">=1.17.0"
dependencies:
flutter:
sdk: flutter
repositories:
path: ../../../domain/repositories
local_db_core:
path: ../../../data/data_core/local_db/local_db_core
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:

11
data/data_types/types/windows/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void RegisterPlugins(flutter::PluginRegistry* registry) {
}

15
data/data_types/types/windows/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter/plugin_registry.h>
// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
data/data_types/types/windows/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

30
domain/repositories/.gitignore

@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# 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
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

10
domain/repositories/.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: b4bce91dd0f168179d46a7ae5eceb3572ba9637a
channel: stable
project_type: package

3
domain/repositories/CHANGELOG.md

@ -0,0 +1,3 @@
## 0.0.1
* TODO: Describe initial release.

1
domain/repositories/LICENSE

@ -0,0 +1 @@
TODO: Add your license here.

39
domain/repositories/README.md

@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features
TODO: List what your package can do. Maybe include images, gifs, or videos.
## Getting started
TODO: List prerequisites and provide or point to information on how to
start using the package.
## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart
const like = 'sample';
```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

4
domain/repositories/analysis_options.yaml

@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

25
domain/repositories/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

@ -0,0 +1,25 @@
package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
/**
* Generated file. Do not edit.
*/
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}

19
domain/repositories/ios/Runner/GeneratedPluginRegistrant.h

@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end
NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */

21
domain/repositories/ios/Runner/GeneratedPluginRegistrant.m

@ -0,0 +1,21 @@
//
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
}
@end

49
domain/repositories/lib/level_box_domain/adapter/level_model_adapter.dart

@ -0,0 +1,49 @@
import 'package:hive_flutter/hive_flutter.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class LevelModelAdapter extends TypeAdapter<Level> {
@override
final int typeId = 0;
@override
Level read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Level(
image: fields[0] as String,
puzzleSize: fields[1] as int,
duration: fields[2] as int,
level: fields[3] as int,
recordDuration: fields[4] as int,
payable: fields[5] as bool,
);
}
@override
void write(BinaryWriter writer, Level obj) {
writer
..writeByte(6)
..writeByte(0)
..write(obj.image)
..writeByte(1)
..write(obj.puzzleSize)
..writeByte(2)
..write(obj.duration)
..writeByte(3)
..write(obj.level)
..writeByte(4)
..write(obj.recordDuration)
..writeByte(5)
..write(obj.payable);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LevelModelAdapter && runtimeType == other.runtimeType && typeId == other.typeId;
}

37
domain/repositories/lib/level_box_domain/model/level_model.dart

@ -0,0 +1,37 @@
import 'package:hive_flutter/adapters.dart';
@HiveType(typeId: 0)
class Level extends HiveObject {
@HiveField(0)
final String image;
@HiveField(1)
final int puzzleSize;
@HiveField(2)
final int duration;
@HiveField(3)
final int level;
@HiveField(4)
final int recordDuration;
@HiveField(5)
final bool payable;
Level({
required this.image,
required this.duration,
required this.puzzleSize,
required this.level,
this.recordDuration = 0,
this.payable = false,
});
Map<String, dynamic> toJson() {
return {
'image': image,
'duration': duration,
'puzzleSize': puzzleSize,
'level': level,
'recordDuration': recordDuration,
'payable': payable,
};
}
}

11
domain/repositories/lib/level_box_domain/repository/level_box_repository.dart

@ -0,0 +1,11 @@
import 'package:repositories/level_box_domain/model/level_model.dart';
abstract class LevelBoxRepository {
Future<void> getLevel({required void Function(List<Level> data) result});
Future<void> openBox();
Future<int> getCurrentLevel();
Future<void> setCurrentLevel(int level);
}

11
domain/repositories/linux/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void fl_register_plugins(FlPluginRegistry* registry) {
}

15
domain/repositories/linux/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter_linux/flutter_linux.h>
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
domain/repositories/linux/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

12
domain/repositories/macos/Flutter/GeneratedPluginRegistrant.swift

@ -0,0 +1,12 @@
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}

11
domain/repositories/macos/Flutter/ephemeral/Flutter-Generated.xcconfig

@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Work\Tools\flutter
FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\domain\repositories
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

12
domain/repositories/macos/Flutter/ephemeral/flutter_export_environment.sh

@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Work\Tools\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user1\StudioProjects\habib_kids\domain\repositories"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

18
domain/repositories/pubspec.yaml

@ -0,0 +1,18 @@
name: repositories
description: A new Flutter project.
version: 0.0.1
environment:
sdk: ">=2.17.6 <3.0.0"
flutter: ">=1.17.0"
dependencies:
flutter:
sdk: flutter
hive_flutter: ^1.1.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:

11
domain/repositories/windows/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void RegisterPlugins(flutter::PluginRegistry* registry) {
}

15
domain/repositories/windows/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter/plugin_registry.h>
// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
domain/repositories/windows/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

25
lib/initializer.dart

@ -0,0 +1,25 @@
import 'package:local_db_core/boxes/box_list/level_box/level_box.dart';
import 'package:path_provider/path_provider.dart';
import 'package:repositories/level_box_domain/adapter/level_model_adapter.dart';
import 'package:repositories/level_box_domain/repository/level_box_repository.dart';
import 'package:types/level_data/interface/level_box_repository_impl.dart';
import 'package:hive_flutter/hive_flutter.dart';
class Initializer {
Initializer.privateConstructor();
final LevelBoxRepository _repository = LevelBoxRepositoryImpl(levelBox: LevelBox());
static final Initializer instance = Initializer.privateConstructor();
factory Initializer() {
return instance;
}
Future<void> initialHive() async {
final dir = await getApplicationDocumentsDirectory();
Hive.init(dir.path);
Hive.registerAdapter(LevelModelAdapter());
await _repository.openBox();
await _repository.setCurrentLevel(1);
}
}

22
lib/main.dart

@ -3,19 +3,14 @@ import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart'; import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart';
import 'package:my_flutter_puzzle/initializer.dart';
import 'package:my_flutter_puzzle/res/palette.dart'; import 'package:my_flutter_puzzle/res/palette.dart';
import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
import 'package:my_flutter_puzzle/screens/puzzle/puzzle_starter_screen.dart';
import 'package:my_flutter_puzzle/screens/splash/screen/splash_screen.dart'; import 'package:my_flutter_puzzle/screens/splash/screen/splash_screen.dart';
import 'package:my_flutter_puzzle/utils/color_brightness.dart'; import 'package:my_flutter_puzzle/utils/color_brightness.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:url_strategy/url_strategy.dart';
void main() async { void main() async {
setPathUrlStrategy();
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await Initializer.instance.initialHive();
runApp(const ProviderScope(child: MyApp())); runApp(const ProviderScope(child: MyApp()));
} }
@ -28,12 +23,6 @@ class MyApp extends StatelessWidget {
DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight, DeviceOrientation.landscapeRight,
]); ]);
Level level = Level(
image: 'level-1'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 1,
);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
return BlocProvider( return BlocProvider(
create: (context) => CountDownTimerCubit(), create: (context) => CountDownTimerCubit(),
@ -58,12 +47,7 @@ class MyApp extends StatelessWidget {
onSurface: Colors.white38, onSurface: Colors.white38,
), ),
), ),
home: PuzzleStarterScreen(
duration: level.duration,
puzzleSize: level.puzzleSize,
image: level.image,
level: level.level,
),
home: const SplashScreen(),
), ),
); );
} }

31
lib/screens/level_list/cubit/level_list_cubit.dart

@ -0,0 +1,31 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:local_db_core/boxes/box_list/level_box/level_box.dart';
import 'package:my_flutter_puzzle/cubits/base_cubit_type.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
import 'package:repositories/level_box_domain/repository/level_box_repository.dart';
import 'package:types/level_data/interface/level_box_repository_impl.dart';
class LevelListCubit extends Cubit<BaseCubitType<LevelListCubitState>> {
List<Level> levelList = [];
late int currentLevel;
final LevelBoxRepository _repository = LevelBoxRepositoryImpl(levelBox: LevelBox());
LevelListCubit() : super(BaseCubitType(eventName: LevelListCubitState.empty));
void empty() => emit(BaseCubitType(eventName: LevelListCubitState.empty));
void getData() async {
currentLevel = await _repository.getCurrentLevel();
await _repository.getLevel(
result: (data) {
levelList = data;
emit(BaseCubitType(eventName: LevelListCubitState.list));
},
);
}
}
enum LevelListCubitState {
empty,
list,
}

108
lib/screens/level_list/screen/level_list_screen.dart

@ -1,10 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_flutter_puzzle/cubits/base_cubit_type.dart';
import 'package:my_flutter_puzzle/screens/level_list/cubit/level_list_cubit.dart';
import 'package:my_flutter_puzzle/screens/level_list/widgets/level_widget.dart'; import 'package:my_flutter_puzzle/screens/level_list/widgets/level_widget.dart';
import 'package:my_flutter_puzzle/screens/level_list/widgets/lock_level_widget.dart'; import 'package:my_flutter_puzzle/screens/level_list/widgets/lock_level_widget.dart';
import 'package:my_flutter_puzzle/screens/level_list/widgets/payed_level_widget.dart'; import 'package:my_flutter_puzzle/screens/level_list/widgets/payed_level_widget.dart';
import 'package:my_flutter_puzzle/screens/lose/lose_screen.dart';
import 'package:my_flutter_puzzle/screens/puzzle/puzzle_starter_screen.dart'; import 'package:my_flutter_puzzle/screens/puzzle/puzzle_starter_screen.dart';
import 'package:my_flutter_puzzle/screens/win/win_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart'; import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class LevelListScreen extends StatefulWidget { class LevelListScreen extends StatefulWidget {
const LevelListScreen({Key? key}) : super(key: key); const LevelListScreen({Key? key}) : super(key: key);
@ -14,58 +20,12 @@ class LevelListScreen extends StatefulWidget {
} }
class _LevelListScreenState extends State<LevelListScreen> { class _LevelListScreenState extends State<LevelListScreen> {
final List<Level> _levelList = [];
late final LevelListCubit _cubit;
@override @override
void initState() { void initState() {
_levelList.add(Level(
image: 'level-1'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 1,
));
_levelList.add(Level(
image: 'level-2'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 2,
));
_levelList.add(Level(
image: 'level-3'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 3,
));
_levelList.add(Level(
image: 'level-4'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 4,
));
_levelList.add(Level(
image: 'level-5'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 5,
));
_levelList.add(Level(
image: 'level-6'.jpgPath,
duration: 4,
puzzleSize: 3,
level: 6,
));
_levelList.add(Level(
image: 'level-7'.jpgPath,
duration: 6,
puzzleSize: 4,
level: 7,
));
_levelList.add(Level(
image: 'level-8'.jpgPath,
duration: 6,
puzzleSize: 4,
level: 8,
));
_cubit = BlocProvider.of<LevelListCubit>(context);
_cubit.getData();
super.initState(); super.initState();
} }
@ -73,7 +33,15 @@ class _LevelListScreenState extends State<LevelListScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: const Color(0xff6236FF), backgroundColor: const Color(0xff6236FF),
body: Padding(
body: BlocBuilder<LevelListCubit, BaseCubitType<LevelListCubitState>>(
builder: (context, state) {
switch (state.eventName!) {
case LevelListCubitState.empty:
break;
case LevelListCubitState.list:
break;
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 55), padding: const EdgeInsets.symmetric(horizontal: 55),
child: Row( child: Row(
children: [ children: [
@ -90,9 +58,7 @@ class _LevelListScreenState extends State<LevelListScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(
top: context.height * 33 / 540,
bottom: context.height * 12 / 540),
padding: EdgeInsets.only(top: context.height * 33 / 540, bottom: context.height * 12 / 540),
child: const Text( child: const Text(
'Levels', 'Levels',
style: TextStyle( style: TextStyle(
@ -107,30 +73,26 @@ class _LevelListScreenState extends State<LevelListScreen> {
height: context.height * 397 / 540, height: context.height * 397 / 540,
child: ListView.builder( child: ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == 0 || index == 1) {
if (_cubit.levelList[index].level == _cubit.currentLevel) {
return GestureDetector( return GestureDetector(
onTap: () => _startLevel(_levelList[index]),
child: LevelWidget(level: _levelList[index]),
onTap: () => _startLevel(_cubit.levelList[index]),
child: LevelWidget(level: _cubit.levelList[index]),
); );
} }
if (index == 2) {
return GestureDetector(
child: LockLevelWidget(level: _levelList[index]),
onTap: () => _startLevel(_levelList[index]),
);
if (_cubit.levelList[index].payable) {
return PayedLevelWidget(level: _cubit.levelList[index]);
} }
return GestureDetector(
child: PayedLevelWidget(level: _levelList[index]),
onTap: () => _startLevel(_levelList[index]),
);
return LockLevelWidget(level: _cubit.levelList[index]);
}, },
itemCount: _levelList.length,
itemCount: _cubit.levelList.length,
), ),
), ),
], ],
), ),
], ],
), ),
);
},
), ),
); );
} }
@ -151,17 +113,3 @@ class _LevelListScreenState extends State<LevelListScreen> {
); );
} }
} }
class Level {
final String image;
final int puzzleSize;
final int duration;
final int level;
Level({
required this.image,
required this.duration,
required this.puzzleSize,
required this.level,
});
}

4
lib/screens/level_list/widgets/level_widget.dart

@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart'; import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class LevelWidget extends StatelessWidget { class LevelWidget extends StatelessWidget {
final Level level; final Level level;
@ -92,7 +92,7 @@ class LevelWidget extends StatelessWidget {
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Text(
'${level.puzzleSize}*${level.puzzleSize} | 00:56',
'${level.puzzleSize}*${level.puzzleSize} | ${level.recordDuration}',
style: const TextStyle( style: const TextStyle(
color: Color(0xffBCACF4), color: Color(0xffBCACF4),
fontSize: 16, fontSize: 16,

4
lib/screens/level_list/widgets/lock_level_widget.dart

@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart'; import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class LockLevelWidget extends StatelessWidget { class LockLevelWidget extends StatelessWidget {
final Level level; final Level level;
@ -59,7 +59,7 @@ class LockLevelWidget extends StatelessWidget {
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Text(
'${level.puzzleSize}*${level.puzzleSize} | 00:56',
'${level.puzzleSize}*${level.puzzleSize} | ${level.recordDuration}',
style: TextStyle( style: TextStyle(
color: const Color(0xffBCACF4).withOpacity(0.5), color: const Color(0xffBCACF4).withOpacity(0.5),
fontSize: 16, fontSize: 16,

11
lib/screens/level_list/widgets/payed_level_widget.dart

@ -1,16 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart'; import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:repositories/level_box_domain/model/level_model.dart';
class PayedLevelWidget extends StatelessWidget { class PayedLevelWidget extends StatelessWidget {
final Level level; final Level level;
const PayedLevelWidget({
Key? key,
required this.level,
}) : super(key: key);
const PayedLevelWidget({Key? key, required this.level}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,7 +59,7 @@ class PayedLevelWidget extends StatelessWidget {
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Text(
'${level.puzzleSize}*${level.puzzleSize} | 00:56',
'${level.puzzleSize}*${level.puzzleSize} | ${level.recordDuration}',
style: TextStyle( style: TextStyle(
color: const Color(0xffBCACF4).withOpacity(0.5), color: const Color(0xffBCACF4).withOpacity(0.5),
fontSize: 16, fontSize: 16,
@ -115,7 +112,7 @@ class PayedLevelWidget extends StatelessWidget {
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
margin: const EdgeInsets.symmetric(vertical: 3), margin: const EdgeInsets.symmetric(vertical: 3),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white ,
color: Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: SvgPicture.asset('lock'.svgPath), child: SvgPicture.asset('lock'.svgPath),

221
lib/screens/lose/lose_screen.dart

@ -0,0 +1,221 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
class LoseScreen extends StatefulWidget {
final int move;
final int tiles;
const LoseScreen({
Key? key,
required this.tiles,
required this.move,
}) : super(key: key);
@override
State<LoseScreen> createState() => _LoseScreenState();
}
class _LoseScreenState extends State<LoseScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xffA7A7A7),
body: SizedBox(
width: context.width,
height: context.height,
child: Stack(
alignment: AlignmentDirectional.centerEnd,
children: [
Center(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
width: context.width * 267 / 812,
height: context.height * 284 / 375,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color(0xffB9B9B9),
Color(0xffD1D1D1),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(36),
),
child: Column(
children: [
const SizedBox(height: 31),
const Text(
'Opsssss !',
style: TextStyle(
color: Colors.white,
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 24),
Container(
width: context.width * 114 / 812,
height: context.width * 114 / 812,
decoration: BoxDecoration(
color: const Color(0xffC0C0C0),
shape: BoxShape.circle,
border: Border.all(
color: const Color(0xff7a7a7a),
width: 1,
),
),
child: Container(
margin: EdgeInsets.all(context.width * 20 / 812),
padding: EdgeInsets.all(context.width * 20 / 812),
decoration: const BoxDecoration(
color: Color(0xffE02020),
shape: BoxShape.circle,
),
child: SvgPicture.asset(
'sad'.svgPath,
colorFilter: const ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
),
),
),
const SizedBox(height: 19),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
const Text(
'Tiles',
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 9),
Text(
'${widget.tiles}',
style: const TextStyle(
decoration: TextDecoration.underline,
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
],
),
const SizedBox(width: 42),
Row(
children: [
const Text(
'Move',
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 9),
Text(
'${widget.move}',
style: const TextStyle(
decoration: TextDecoration.underline,
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
],
),
],
),
],
),
),
Transform.translate(
offset: const Offset(0, 20),
child: Container(
width: context.width * 147 / 812,
height: context.height * 51 / 375,
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
color: const Color(0xff979797).withOpacity(0.12),
borderRadius: BorderRadius.circular(36),
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(31),
gradient: const LinearGradient(
colors: [
Color(0xffFFC600),
Color(0xffFF5A00),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(width: 6),
Container(
width: context.width * 26 / 540,
height: context.width * 26 / 540,
padding: const EdgeInsets.all(9),
margin: const EdgeInsets.symmetric(vertical: 3),
decoration: BoxDecoration(
border: Border.all(
color: Colors.white,
width: 1,
),
gradient: const LinearGradient(
colors: [
Colors.white,
Color(0xffD5D5D5),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
shape: BoxShape.circle,
),
child: SvgPicture.asset('refresh'.svgPath),
),
const SizedBox(width: 8),
const Text(
'Restart',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 14),
],
),
),
),
),
],
),
),
Container(
margin: EdgeInsetsDirectional.only(end: context.width * 68 / 812),
width: context.width * 142 / 812,
height: context.height * 280 / 375,
child: Image(
image: AssetImage('avatar'.pngPath),
),
),
],
),
),
);
}
}

84
lib/screens/photo/photo_screen_large.dart

@ -8,12 +8,13 @@ import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart';
import 'package:my_flutter_puzzle/models/puzzle_data.dart'; import 'package:my_flutter_puzzle/models/puzzle_data.dart';
import 'package:my_flutter_puzzle/providers.dart'; import 'package:my_flutter_puzzle/providers.dart';
import 'package:my_flutter_puzzle/res/puzzle_constants.dart'; import 'package:my_flutter_puzzle/res/puzzle_constants.dart';
import 'package:my_flutter_puzzle/screens/lose/lose_screen.dart';
import 'package:my_flutter_puzzle/screens/win/win_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart'; import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
import 'package:my_flutter_puzzle/utils/puzzle_solver.dart'; import 'package:my_flutter_puzzle/utils/puzzle_solver.dart';
import 'package:my_flutter_puzzle/utils/utils.dart'; import 'package:my_flutter_puzzle/utils/utils.dart';
import 'package:my_flutter_puzzle/widgets/photo_screen/image_viewer.dart'; import 'package:my_flutter_puzzle/widgets/photo_screen/image_viewer.dart';
import 'package:my_flutter_puzzle/widgets/solo_screen/animated_dash.dart';
import 'package:my_flutter_puzzle/widgets/solo_screen/count_down_timer_widget.dart'; import 'package:my_flutter_puzzle/widgets/solo_screen/count_down_timer_widget.dart';
import 'package:my_flutter_puzzle/widgets/solo_screen/countdown_widget.dart'; import 'package:my_flutter_puzzle/widgets/solo_screen/countdown_widget.dart';
import 'package:my_flutter_puzzle/widgets/solo_screen/moves_tiles_widget.dart'; import 'package:my_flutter_puzzle/widgets/solo_screen/moves_tiles_widget.dart';
@ -40,8 +41,7 @@ class PhotoScreenLarge extends ConsumerStatefulWidget {
final RiveAnimationController riveController; final RiveAnimationController riveController;
@override @override
ConsumerState<ConsumerStatefulWidget> createState() =>
_SoloScreenLargeState();
ConsumerState<ConsumerStatefulWidget> createState() => _SoloScreenLargeState();
} }
class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
@ -58,6 +58,8 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
List<Image>? _previousImages; List<Image>? _previousImages;
Image? _previousImage; Image? _previousImage;
PaletteGenerator? _previousPalette; PaletteGenerator? _previousPalette;
int _moves = 0;
int _tiles = 0;
@override @override
void initState() { void initState() {
@ -71,8 +73,7 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen(puzzleNotifierProvider(_solverClient),
(previous, PuzzleState next) {
ref.listen(puzzleNotifierProvider(_solverClient), (previous, PuzzleState next) {
if (next is PuzzleInitializing) { if (next is PuzzleInitializing) {
setState(() { setState(() {
_isStartPressed = true; _isStartPressed = true;
@ -80,6 +81,17 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
} }
if (next is PuzzleSolved) { if (next is PuzzleSolved) {
_puzzleSolved = true; _puzzleSolved = true;
Future.delayed(const Duration(milliseconds: 500), () {
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return WinScreen(
tiles: _tiles,
move: _moves,
level: widget.level,
);
},
));
});
} }
}); });
@ -90,9 +102,7 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
_previousImage = next.image; _previousImage = next.image;
_previousPalette = next.palette; _previousPalette = next.palette;
}); });
ref
.read(puzzleNotifierProvider(_solverClient).notifier)
.initializePuzzle(
ref.read(puzzleNotifierProvider(_solverClient).notifier).initializePuzzle(
initialPuzzleData: _initialPuzzleData, initialPuzzleData: _initialPuzzleData,
); );
} }
@ -108,16 +118,14 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
body: SafeArea( body: SafeArea(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: context.width * 30 / 812,
vertical: context.height * 20 / 375,
horizontal: context.width * 26 / 812,
), ),
child: Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
child: Column(
children: [ children: [
Row(
SizedBox(height: context.height * 20 / 375),
SizedBox(
width: context.width,
child: Row(
children: [ children: [
SvgPicture.asset('flash'.svgPath), SvgPicture.asset('flash'.svgPath),
const SizedBox(width: 8), const SizedBox(width: 8),
@ -129,7 +137,12 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
fontSize: 16, fontSize: 16,
), ),
), ),
const SizedBox(width: 18),
const Spacer(),
CountDownTimerWidget(
duration: widget.duration,
finishCallback: _finishTime,
),
const Spacer(),
GestureDetector( GestureDetector(
onTap: _resetTimer, onTap: _resetTimer,
child: Container( child: Container(
@ -146,30 +159,35 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
), ),
], ],
), ),
const SizedBox(height: 21),
),
SizedBox(height: context.height * 22 / 375),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
ImageViewer( ImageViewer(
puzzleSize: _puzzleSize, puzzleSize: _puzzleSize,
previousImage: _previousImage, previousImage: _previousImage,
previousPalette: _previousPalette, previousPalette: _previousPalette,
imageSize: 200, imageSize: 200,
), ),
const SizedBox(height: 12),
SizedBox(height: context.height * 30 / 375),
MovesTilesWidget( MovesTilesWidget(
solverClient: _solverClient, solverClient: _solverClient,
fontSize: 16, fontSize: 16,
callback: (move, tiles) {
_moves = move;
_tiles = tiles;
},
), ),
], ],
), ),
SizedBox(width: context.width * 60 / 812),
SizedBox(width: context.width * 34 / 812),
SingleChildScrollView( SingleChildScrollView(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
CountDownTimerWidget(
duration: widget.duration,
finishCallback: _finishTime,
),
const SizedBox(height: 23),
Consumer( Consumer(
builder: (context, ref, child) { builder: (context, ref, child) {
final state = ref.watch( final state = ref.watch(
@ -215,13 +233,13 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
], ],
), ),
), ),
SizedBox(width: context.width * 38 / 812),
SizedBox(width: context.width * 32 / 812),
Stack( Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
SizedBox( SizedBox(
width: context.width * 126 / 812, width: context.width * 126 / 812,
height: context.height * 251 / 375,
height: context.height * 280 / 375,
child: Image( child: Image(
image: AssetImage('avatar'.pngPath), image: AssetImage('avatar'.pngPath),
), ),
@ -234,8 +252,7 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
CountdownWidget( CountdownWidget(
isStartPressed: _isStartPressed, isStartPressed: _isStartPressed,
onFinish: () { onFinish: () {
BlocProvider.of<CountDownTimerCubit>(context)
.start();
BlocProvider.of<CountDownTimerCubit>(context).start();
setState(() { setState(() {
_isStartPressed = false; _isStartPressed = false;
}); });
@ -248,6 +265,8 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
), ),
], ],
), ),
],
),
), ),
), ),
), ),
@ -256,9 +275,12 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> {
void _finishTime() { void _finishTime() {
if (!_puzzleSolved) { if (!_puzzleSolved) {
Utils.instance.showToast(context, 'TimeOut');
Future.delayed(const Duration(milliseconds: 1500), () { Future.delayed(const Duration(milliseconds: 1500), () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return LoseScreen(tiles: _tiles, move: _moves);
},
));
}); });
} }
} }

7
lib/screens/splash/screen/splash_screen.dart

@ -1,6 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_flutter_puzzle/screens/level_list/cubit/level_list_cubit.dart';
import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart'; import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
@ -17,7 +19,10 @@ class _SplashScreenState extends State<SplashScreen> {
Timer(const Duration(milliseconds: 2000), () { Timer(const Duration(milliseconds: 2000), () {
Navigator.push(context, MaterialPageRoute( Navigator.push(context, MaterialPageRoute(
builder: (context) { builder: (context) {
return const LevelListScreen();
return BlocProvider(
child: const LevelListScreen(),
create: (context) => LevelListCubit(),
);
}, },
)); ));
}); });

235
lib/screens/win/win_screen.dart

@ -0,0 +1,235 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
class WinScreen extends StatefulWidget {
final int move;
final int tiles;
final int level;
const WinScreen({
Key? key,
required this.tiles,
required this.move,
required this.level,
}) : super(key: key);
@override
State<WinScreen> createState() => _WinScreenState();
}
class _WinScreenState extends State<WinScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xff4400CE),
body: SizedBox(
width: context.width,
height: context.height,
child: Stack(
alignment: AlignmentDirectional.centerEnd,
children: [
Center(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
width: context.width * 267 / 812,
height: context.height * 284 / 375,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color(0xff6236FF),
Color(0xff4706CC),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(36),
),
child: Column(
children: [
const SizedBox(height: 31),
const Text(
'Well done !',
style: TextStyle(
color: Colors.white,
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 24),
Container(
width: context.width * 114 / 812,
height: context.width * 114 / 812,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color(0xff6236FF),
Color(0xff4824CB),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
shape: BoxShape.circle,
border: Border.all(
color: const Color(0xff6136FE),
width: 1,
),
),
child: Container(
margin: EdgeInsets.all(context.width * 20 / 812),
padding: EdgeInsets.all(context.width * 20 / 812),
decoration: const BoxDecoration(
color: Color(0xff6DD400),
shape: BoxShape.circle,
),
child: SvgPicture.asset(
'check'.svgPath,
colorFilter: const ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
),
),
),
const SizedBox(height: 19),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
const Text(
'Tiles',
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 9),
Text(
'${widget.tiles}',
style: const TextStyle(
decoration: TextDecoration.underline,
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
],
),
const SizedBox(width: 42),
Row(
children: [
const Text(
'Move',
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 9),
Text(
'${widget.move}',
style: const TextStyle(
decoration: TextDecoration.underline,
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
],
),
],
),
],
),
),
Transform.translate(
offset: const Offset(0, 20),
child: GestureDetector(
onTap: () {
},
child: Container(
width: context.width * 160 / 812,
height: context.height * 51 / 375,
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
color: const Color(0xff979797).withOpacity(0.12),
borderRadius: BorderRadius.circular(36),
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(31),
gradient: const LinearGradient(
colors: [
Color(0xffFFC600),
Color(0xffFF5A00),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(width: 6),
Container(
width: context.width * 31 / 540,
height: context.width * 31 / 540,
padding: const EdgeInsets.all(9),
margin: const EdgeInsets.symmetric(vertical: 3),
decoration: BoxDecoration(
border: Border.all(
color: Colors.white,
width: 1,
),
gradient: const LinearGradient(
colors: [
Colors.white,
Color(0xffD5D5D5),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
shape: BoxShape.circle,
),
child: SvgPicture.asset('next_level'.svgPath),
),
const SizedBox(width: 8),
const Text(
'Next level',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 14),
],
),
),
),
),
),
],
),
),
Container(
margin: EdgeInsetsDirectional.only(end: context.width * 68 / 812),
width: context.width * 142 / 812,
height: context.height * 280 / 375,
child: Image(
image: AssetImage('avatar'.pngPath),
),
),
],
),
),
);
}
}

2
lib/utils/toast.dart

@ -49,7 +49,7 @@ class FToast {
} }
_ToastEntry toastEntry = _overlayQueue.removeAt(0); _ToastEntry toastEntry = _overlayQueue.removeAt(0);
_entry = toastEntry.entry; _entry = toastEntry.entry;
Overlay.of(context)?.insert(_entry!);
Overlay.of(context).insert(_entry!);
_timer = Timer(toastEntry.duration, () { _timer = Timer(toastEntry.duration, () {
Future.delayed(const Duration(milliseconds: 360), () { Future.delayed(const Duration(milliseconds: 360), () {

36
lib/widgets/solo_screen/moves_tiles_widget.dart

@ -5,16 +5,18 @@ import 'package:my_flutter_puzzle/utils/puzzle_solver.dart';
import 'package:my_flutter_puzzle/widgets/solo_screen/moves_tiles_widget/moves_tiles_text.dart'; import 'package:my_flutter_puzzle/widgets/solo_screen/moves_tiles_widget/moves_tiles_text.dart';
class MovesTilesWidget extends StatelessWidget { class MovesTilesWidget extends StatelessWidget {
final PuzzleSolverClient _solverClient;
final double fontSize;
final Function(int move, int tiles) callback;
const MovesTilesWidget({ const MovesTilesWidget({
Key? key, Key? key,
required this.callback,
required PuzzleSolverClient solverClient, required PuzzleSolverClient solverClient,
this.fontSize = 24, this.fontSize = 24,
}) : _solverClient = solverClient, }) : _solverClient = solverClient,
super(key: key); super(key: key);
final PuzzleSolverClient _solverClient;
final double fontSize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer( return Consumer(
@ -36,26 +38,38 @@ class MovesTilesWidget extends StatelessWidget {
tiles: 0, tiles: 0,
fontSize: fontSize, fontSize: fontSize,
), ),
current: (puzzleData) => MovesTilesText(
current: (puzzleData) {
callback.call(puzzleData.moves, puzzleData.tiles);
return MovesTilesText(
moves: puzzleData.moves, moves: puzzleData.moves,
tiles: puzzleData.tiles, tiles: puzzleData.tiles,
fontSize: fontSize, fontSize: fontSize,
),
computingSolution: (puzzleData) => MovesTilesText(
);
},
computingSolution: (puzzleData) {
callback.call(puzzleData.moves, puzzleData.tiles);
return MovesTilesText(
moves: puzzleData.moves, moves: puzzleData.moves,
tiles: puzzleData.tiles, tiles: puzzleData.tiles,
fontSize: fontSize, fontSize: fontSize,
),
autoSolving: (puzzleData) => MovesTilesText(
);
},
autoSolving: (puzzleData) {
callback.call(puzzleData.moves, puzzleData.tiles);
return MovesTilesText(
moves: puzzleData.moves, moves: puzzleData.moves,
tiles: puzzleData.tiles, tiles: puzzleData.tiles,
fontSize: fontSize, fontSize: fontSize,
),
solved: (puzzleData) => MovesTilesText(
);
},
solved: (puzzleData) {
callback.call(puzzleData.moves, puzzleData.tiles);
return MovesTilesText(
moves: puzzleData.moves, moves: puzzleData.moves,
tiles: puzzleData.tiles, tiles: puzzleData.tiles,
fontSize: fontSize, fontSize: fontSize,
),
);
},
error: (_) => MovesTilesText( error: (_) => MovesTilesText(
moves: 0, moves: 0,
tiles: 0, tiles: 0,

6
lib/widgets/solo_screen/moves_tiles_widget/moves_tiles_text.dart

@ -19,7 +19,7 @@ class MovesTilesText extends StatelessWidget {
children: [ children: [
Container( Container(
height: context.height * 32 / 375, height: context.height * 32 / 375,
width: context.width * 94 / 812,
width: context.width * 90 / 812,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: const Color(0xff6236FF), width: 1), border: Border.all(color: const Color(0xff6236FF), width: 1),
@ -55,10 +55,10 @@ class MovesTilesText extends StatelessWidget {
], ],
), ),
), ),
const SizedBox(width: 12),
SizedBox(width: context.width * 6 / 812),
Container( Container(
height: context.height * 32 / 375, height: context.height * 32 / 375,
width: context.width * 94 / 812,
width: context.width * 90 / 812,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: const Color(0xff6236FF), width: 1), border: Border.all(color: const Color(0xff6236FF), width: 1),

39
pubspec.lock

@ -344,6 +344,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.2.0"
hive:
dependency: transitive
description:
name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
hive_flutter:
dependency: transitive
description:
name: hive_flutter
sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc
url: "https://pub.dev"
source: hosted
version: "1.1.0"
http: http:
dependency: transitive dependency: transitive
description: description:
@ -416,6 +432,13 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
local_db_core:
dependency: "direct main"
description:
path: "data/data_core/local_db/local_db_core"
relative: true
source: path
version: "1.0.0+1"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@ -616,6 +639,13 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
repositories:
dependency: "direct main"
description:
path: "domain/repositories"
relative: true
source: path
version: "0.0.1"
rive: rive:
dependency: "direct main" dependency: "direct main"
description: description:
@ -749,6 +779,13 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
types:
dependency: "direct main"
description:
path: "data/data_types/types"
relative: true
source: path
version: "0.0.1"
url_strategy: url_strategy:
dependency: "direct main" dependency: "direct main"
description: description:
@ -838,5 +875,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.19.0 <3.0.0"
dart: ">=2.19.2 <3.0.0"
flutter: ">=3.7.0-0" flutter: ">=3.7.0-0"

6
pubspec.yaml

@ -24,6 +24,12 @@ dependencies:
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
font_awesome_flutter: ^9.2.0 font_awesome_flutter: ^9.2.0
crop: ^0.5.2 crop: ^0.5.2
local_db_core:
path: data/data_core/local_db/local_db_core
types:
path: data/data_types/types
repositories:
path: domain/repositories
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save