Skip to content

Commit

Permalink
UI changes & Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DMouayad committed May 17, 2023
1 parent ebea597 commit dd33549
Show file tree
Hide file tree
Showing 60 changed files with 1,228 additions and 1,035 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ collections.

- If you are new to Flutter, start with the [installation instruction](https://flutter.io/docs/get-started/install).

- Flutter v3.7 & Dart v2.19 - or higher.
- Flutter v3.10 & Dart v3.0 - or higher.

- For running on *Windows*, please read the following [requirements](https://docs.flutter.dev/development/platform-integration/desktop#requirements).

- Run the command `flutter doctor -v` in a terminal to make sure no issues are present.

#### Setup
### Setup

**Step 1:** download or clone this repo.

Expand All @@ -137,7 +137,7 @@ collections.
- `cd path_of_project_folder`
- `flutter pub get`

#### Running the app
### Running the app

**Option 1**

Expand All @@ -156,7 +156,7 @@ collections.
flutter run -d ios
```

**Additional Info**
**Run Additional Info**

You can also specify the build mode of the app:

Expand Down
7 changes: 6 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 31
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -67,6 +71,7 @@ android {
storePassword keystoreProperties['storePassword']
}
}

}

buildTypes {
Expand Down
Binary file modified android/app/src/main/res/drawable-v21/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/light_splash_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion flutter_native_splash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ flutter_native_splash:
# splash screen to a png image. This is useful for gradients. The image will be stretch to the
# size of the app. Only one parameter can be used, color and background_image cannot both be set.
# color: "#FEFBF6"
background_image: "assets/logo_light.png"
background_image: "assets/light_splash_image.png"

# Optional parameters are listed below. To enable a parameter, uncomment the line by removing
# the leading # character.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/blocs/base_event.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:flutter_bloc/flutter_bloc.dart';

abstract class BaseBlocEvent<R, State> {
Expand Down
42 changes: 37 additions & 5 deletions lib/blocs/library_bloc/library_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:books_genie/domain/book/base/base_book_repository.dart';
import 'package:books_genie/domain/book/base/entities/base_book.dart';
import 'package:books_genie/domain/book/base/entities/base_user_book_collection.dart';
Expand All @@ -6,19 +8,49 @@ import 'package:books_genie/support/result/result.dart';
import 'package:books_genie/support/services/logger_service.dart';
import 'package:books_genie/support/utils/extensions.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:books_genie/blocs/base_event.dart';
import 'package:bloc_concurrency/bloc_concurrency.dart';

part 'library_event.dart';
part 'library_events.dart';
part 'library_state.dart';

class LibraryBloc extends Bloc<LibraryEvent, LibraryState> {
final BaseBookRepository _repository;
LibraryBloc(this._repository) : super(const LibraryInitial()) {

LibraryBloc(this._repository) : super(const LibraryState()) {
on<LibraryEvent>(
(event, emit) => event.handle(_repository, state, emit),
(event, emit) async {
final states = event.handle(_repository, state);

if (states.processingState != null) {
emit(state.copyWith(loadingState: await states.processingState));
}
if (states.resultFuture != null) {
(await states.resultFuture)!.fold(
ifSuccess: (value) async {
if (states.beforeSuccessState != null) {
emit(state.copyWith(
loadingCompletedState: await states.beforeSuccessState));
}
await Future.delayed(const Duration(milliseconds: 200));
emit(states
.stateIfSuccessResult(value)
.copyWith(loadingState: null, loadingCompletedState: null));
},
ifFailure: (error) {
if (states.stateIfFailureResult != null) {
emit(state.copyWith(
errorState: states.stateIfFailureResult!(error),
loadingState: null,
loadingCompletedState: null,
));
}
},
);
} else {
emit(states.stateIfSuccessResult(null));
}
},
transformer: sequential(),
);
}
Expand Down
246 changes: 0 additions & 246 deletions lib/blocs/library_bloc/library_event.dart

This file was deleted.

Loading

0 comments on commit dd33549

Please sign in to comment.