mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
CAKE-20 | changed dots indicator on smooth page indicator (dashboard page); deleted page_view_store
This commit is contained in:
parent
861a2840ce
commit
1ba86506f0
6 changed files with 23 additions and 66 deletions
|
@ -65,7 +65,6 @@ import 'package:cake_wallet/store/templates/send_template_store.dart';
|
|||
import 'package:cake_wallet/store/templates/exchange_template_store.dart';
|
||||
import 'package:cake_wallet/src/domain/common/template.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_template.dart';
|
||||
import 'package:cake_wallet/store/dashboard/page_view_store.dart';
|
||||
|
||||
final getIt = GetIt.instance;
|
||||
|
||||
|
@ -121,7 +120,6 @@ Future setup(
|
|||
TradeFilterStore(wallet: getIt.get<AppStore>().wallet));
|
||||
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
|
||||
getIt.registerSingleton<FiatConvertationStore>(FiatConvertationStore());
|
||||
getIt.registerSingleton<PageViewStore>(PageViewStore());
|
||||
getIt.registerSingleton<SendTemplateStore>(
|
||||
SendTemplateStore(templateSource: templates));
|
||||
getIt.registerSingleton<ExchangeTemplateStore>(
|
||||
|
@ -169,8 +167,7 @@ Future setup(
|
|||
appStore: getIt.get<AppStore>(),
|
||||
tradesStore: getIt.get<TradesStore>(),
|
||||
tradeFilterStore: getIt.get<TradeFilterStore>(),
|
||||
transactionFilterStore: getIt.get<TransactionFilterStore>(),
|
||||
pageViewStore: getIt.get<PageViewStore>()
|
||||
transactionFilterStore: getIt.get<TransactionFilterStore>()
|
||||
));
|
||||
|
||||
getIt.registerFactory<AuthService>(() => AuthService(
|
||||
|
|
|
@ -6,15 +6,13 @@ import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
|||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:dots_indicator/dots_indicator.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/address_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
||||
|
||||
class DashboardPage extends BasePage {
|
||||
DashboardPage({
|
||||
|
@ -95,20 +93,18 @@ class DashboardPage extends BasePage {
|
|||
padding: EdgeInsets.only(
|
||||
bottom: 24
|
||||
),
|
||||
child: Observer(
|
||||
builder: (_) {
|
||||
return DotsIndicator(
|
||||
dotsCount: pages.length,
|
||||
position: walletViewModel.currentPage,
|
||||
decorator: DotsDecorator(
|
||||
color: PaletteDark.cyanBlue,
|
||||
activeColor: Colors.white,
|
||||
size: Size(6, 6),
|
||||
activeSize: Size(6, 6),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
child: SmoothPageIndicator(
|
||||
controller: controller,
|
||||
count: pages.length,
|
||||
effect: ColorTransitionEffect(
|
||||
spacing: 6.0,
|
||||
radius: 6.0,
|
||||
dotWidth: 6.0,
|
||||
dotHeight: 6.0,
|
||||
dotColor: PaletteDark.cyanBlue,
|
||||
activeDotColor: Colors.white
|
||||
),
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
|
@ -159,16 +155,6 @@ class DashboardPage extends BasePage {
|
|||
pages.add(BalancePage(dashboardViewModel: walletViewModel));
|
||||
pages.add(TransactionsPage(dashboardViewModel: walletViewModel));
|
||||
|
||||
controller.addListener(() {
|
||||
walletViewModel.pageViewStore.setCurrentPage(controller.page);
|
||||
});
|
||||
|
||||
reaction((_) => walletViewModel.currentPage, (double currentPage) {
|
||||
if (controller.page != currentPage) {
|
||||
controller.jumpTo(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
_isEffectsInstalled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part 'page_view_store.g.dart';
|
||||
|
||||
class PageViewStore = PageViewStoreBase with _$PageViewStore;
|
||||
|
||||
abstract class PageViewStoreBase with Store {
|
||||
PageViewStoreBase() {
|
||||
setCurrentPage(1);
|
||||
}
|
||||
|
||||
@observable
|
||||
double currentPage;
|
||||
|
||||
@action
|
||||
void setCurrentPage(double currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,6 @@ import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
|||
import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/formatted_item_list.dart';
|
||||
import 'package:cake_wallet/store/dashboard/page_view_store.dart';
|
||||
|
||||
part 'dashboard_view_model.g.dart';
|
||||
|
||||
|
@ -34,8 +33,7 @@ abstract class DashboardViewModelBase with Store {
|
|||
this.appStore,
|
||||
this.tradesStore,
|
||||
this.tradeFilterStore,
|
||||
this.transactionFilterStore,
|
||||
this.pageViewStore}) {
|
||||
this.transactionFilterStore}) {
|
||||
|
||||
name = appStore.wallet?.name;
|
||||
wallet ??= appStore.wallet;
|
||||
|
@ -69,9 +67,6 @@ abstract class DashboardViewModelBase with Store {
|
|||
@observable
|
||||
String subname;
|
||||
|
||||
@computed
|
||||
double get currentPage => pageViewStore.currentPage;
|
||||
|
||||
@computed
|
||||
String get address => wallet.address;
|
||||
|
||||
|
@ -130,8 +125,6 @@ abstract class DashboardViewModelBase with Store {
|
|||
|
||||
TransactionFilterStore transactionFilterStore;
|
||||
|
||||
PageViewStore pageViewStore;
|
||||
|
||||
ReactionDisposer _reaction;
|
||||
|
||||
void _onWalletChange(WalletBase wallet) {
|
||||
|
|
14
pubspec.lock
14
pubspec.lock
|
@ -267,13 +267,6 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
dots_indicator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dots_indicator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
dotted_border:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -803,6 +796,13 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
smooth_page_indicator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: smooth_page_indicator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -50,7 +50,7 @@ dependencies:
|
|||
devicelocale: ^0.2.1
|
||||
auto_size_text: ^2.1.0
|
||||
dotted_border: ^1.0.5
|
||||
dots_indicator: ^1.2.0
|
||||
smooth_page_indicator: ^0.2.0
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
|
Loading…
Reference in a new issue