Skip to content

Commit

Permalink
Charts moved to external library (#7)
Browse files Browse the repository at this point in the history
* update gitignore

* update makefile

* refactor dispose

* migration chart to new library

* migration charts to library

* refactor

* update gitignore

* update podfile

* update readme

* bump library
  • Loading branch information
kuczynski-merix committed May 2, 2022
1 parent 030031f commit 27dea9d
Show file tree
Hide file tree
Showing 77 changed files with 597 additions and 3,838 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ app.*.map.json
/android/app/release

#FVM
.fvm/flutter_sdk/
.fvm/flutter_sdk
.fvm/

#Generated
*.freezed*
*.g*
*.g*
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
fvm_rebuild_models: ## Rebuilds all auto generated Dart files
fvm flutter pub run build_runner build --delete-conflicting-outputs

rebuild_models: ## Rebuilds all auto generated Dart files
flutter pub run build_runner build --delete-conflicting-outputs

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ The main goal was to create an application with a custom UI without using extern

We created all charts, animations, and custom widgets ourselves, using components provided by Flutter or even layers of canvas.


The application uses randomly generated data, but thanks to the architecture in which it was written, it allows you to easily connect an external provider(e.g. REST API) without changing views or cubits.

By making the project public, we can also show you how we work at Merixstudio, the application uses the standards developed by our developers.

## Charts
Due to the great interest in the graphs component, we decided to create a separate, public library.
Vizier uses it, but the entire implementation is in the library.
[Check it here!](https://pub.dev/packages/mrx_charts)

## Features
- Smooth, beautiful animations
- Unique, made from scratch charts
Expand Down
1 change: 1 addition & 0 deletions lib/config/styles/colors/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AppColors {
static Color white12 = white.withOpacity(0.12);
static Color white16 = white.withOpacity(0.16);
static Color white32 = white.withOpacity(0.32);
static Color white60 = white.withOpacity(0.6);
static Color white64 = white.withOpacity(0.64);
static Color black08 = white.withOpacity(0.08);
static Color black12 = white.withOpacity(0.12);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:bloc/bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
import 'package:vizier/data/errors/app_error.dart';
import 'package:vizier/data/factory/stock_data_factory.dart';
import 'package:vizier/data/factory/chart_factory.dart';
import 'package:vizier/data/models/account/account_model.dart';
import 'package:vizier/data/models/account/breakdown/account_breakdown_model.dart';
import 'package:vizier/data/models/transaction/category/transaction_category_model.dart';
import 'package:vizier/data/repositories/wallet/wallet_repository.dart';
import 'package:vizier/data/responses/response_status.dart';
import 'package:vizier/ui/widgets/stock/models/item/stock_data_item.dart';
import 'package:vizier/ui/models/chart_multi_pie_section.dart';

part 'account_financial_breakdown_state.dart';
part 'account_financial_breakdown_cubit.freezed.dart';
Expand All @@ -34,7 +34,7 @@ class AccountFinancialBreakdownCubit extends Cubit<AccountFinancialBreakdownStat
transactionCategories: cachedBreakdown.transactionCategories,
from: cachedBreakdown.from,
to: cachedBreakdown.to,
sections: StockDataFactory.fromAccountBreakdownModel(cachedBreakdown),
sections: ChartFactory.fromAccountBreakdownModel(cachedBreakdown),
),
);
return;
Expand All @@ -55,7 +55,7 @@ class AccountFinancialBreakdownCubit extends Cubit<AccountFinancialBreakdownStat
transactionCategories: data.transactionCategories,
from: data.from,
to: data.to,
sections: StockDataFactory.fromAccountBreakdownModel(data),
sections: ChartFactory.fromAccountBreakdownModel(data),
),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class AccountFinancialBreakdownState with _$AccountFinancialBreakdownState {
const factory AccountFinancialBreakdownState.loaded({
required DateTime from,
required DateTime to,
required List<StockDataMultiPieItem> sections,
required List<ChartMultiPieSection> sections,
required List<TransactionCategoryModel> transactionCategories,
}) = _Loaded;
const factory AccountFinancialBreakdownState.failure({
required AppError appError,
}) = _Failure;

List<StockDataMultiPieItem>? get sections => mapOrNull(
List<ChartMultiPieSection>? get sections => mapOrNull(
loaded: (state) => state.sections,
);

Expand Down

0 comments on commit 27dea9d

Please sign in to comment.