diff --git a/android/key.properties b/android/key.properties new file mode 100644 index 0000000..9368721 --- /dev/null +++ b/android/key.properties @@ -0,0 +1,4 @@ +storePassword=qwe123 +keyPassword=qwe123 +keyAlias=key0 +storeFile=../../../../keystore/AmanSystemsKey \ No newline at end of file diff --git a/lib/core/redux/actions/journal_actions.dart b/lib/core/redux/actions/journal_actions.dart index b898171..6ddbee8 100644 --- a/lib/core/redux/actions/journal_actions.dart +++ b/lib/core/redux/actions/journal_actions.dart @@ -78,6 +78,6 @@ Future loadJournalData(Store store) async { ))); } catch (e, stack) { - log.e('loadSellData', e, stack); + log.e('loadJournalData', e, stack); } } diff --git a/lib/views/work/tabs/component/journal_list_tile.dart b/lib/views/work/tabs/component/journal_list_tile.dart new file mode 100644 index 0000000..483fd1d --- /dev/null +++ b/lib/views/work/tabs/component/journal_list_tile.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; +import 'package:satu/shared/app_colors.dart'; + +class JournalTile extends StatelessWidget { + const JournalTile({ + required this.title, + required this.subTitle, + this.received = true, + this.amount = 0, + this.date = '01.01.2000', + Key? key, + + this.onPress, + }) : super(key: key); + + final String title; + final String subTitle; + final bool received; + final double amount; + final String date; + final Function()? onPress; + + @override + Widget build(BuildContext context) { + return Container( + decoration: const BoxDecoration(color: whiteColor), + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: onPress, + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle(fontSize: 12, color: textColor), + ), + Text( + subTitle, + style: const TextStyle( + fontSize: 10, color: placeholderColor)), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + ' ${received ? '+' : '-'} $amount ₸', + style: TextStyle( + color: received ? Colors.green : Colors.red, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + Text( + date, + style: const TextStyle( + fontSize: 10, color: placeholderColor)), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/views/work/tabs/journal_view.dart b/lib/views/work/tabs/journal_view.dart index 5735dfd..54b6b4f 100644 --- a/lib/views/work/tabs/journal_view.dart +++ b/lib/views/work/tabs/journal_view.dart @@ -8,6 +8,7 @@ import 'package:satu/core/redux/store.dart'; import 'package:satu/shared/app_colors.dart'; import 'package:satu/widgets/bar/products_app_bar.dart'; import 'package:satu/widgets/buttons/option_pill.dart'; +import 'component/journal_list_tile.dart'; import 'component/transaction_item.dart'; class JournalView extends StatefulWidget { @@ -33,13 +34,15 @@ class _JournalViewState extends State { body: StoreConnector( converter: (store) => store.state.journalState!, builder: (context, snapshot) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: const BoxDecoration( + color: whiteColor + ), + child: Padding( + padding: const EdgeInsets.all(15.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -73,39 +76,48 @@ class _JournalViewState extends State { ], ), ), - Expanded( - child: GroupedListView( - physics: const BouncingScrollPhysics(), - elements: snapshot.items!, - groupBy: (element) => element.day!, - groupSeparatorBuilder: (String groupByValue) => Text( + ), + Expanded( + child: GroupedListView( + physics: const BouncingScrollPhysics(), + elements: snapshot.items!, + groupBy: (element) => element.day!, + groupSeparatorBuilder: (String groupByValue) => Padding( + padding: const EdgeInsets.only( + left: 15.0, bottom: 5.0, top: 20.0), + child: Text( groupByValue, style: const TextStyle( - color: textColor, - fontSize: 14, + color: placeholderColor, + fontSize: 12, fontWeight: FontWeight.bold, ), ), - itemBuilder: (context, TransactionDao element) => - TransactionItem( - fullName: 'Чек № ${element.number} ${element.date}', - status: element.contragentName, - amount: element.total.toString(), - received: element.received, - ), - itemComparator: (item1, item2) => - item1.day!.compareTo(item2.day!), - // optional - useStickyGroupSeparators: true, - // optional - floatingHeader: true, - - // optional - order: GroupedListOrder.DESC, // optional ), + separator: const Divider( + height: 1, + color: disableColor, + ), + itemBuilder: (context, TransactionDao element) => + JournalTile( + title: '№ ${element.number}', + subTitle: element.contragentName, + date: element.date!, + amount: element.total, + received: element.received, + ), + itemComparator: (item1, item2) => + item1.day!.compareTo(item2.day!), + // optional + useStickyGroupSeparators: true, + stickyHeaderBackgroundColor: backgroundColor, + // optional + //floatingHeader: true, + // optional + order: GroupedListOrder.DESC, // optional ), - ], - ), + ), + ], ); }), );