Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
小滋润 committed Oct 27, 2024
1 parent cdc0bc4 commit 1da2302
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 869 deletions.
201 changes: 0 additions & 201 deletions android/.kotlin/errors/errors-1725992091454.log

This file was deleted.

201 changes: 0 additions & 201 deletions android/.kotlin/errors/errors-1725992091478.log

This file was deleted.

201 changes: 0 additions & 201 deletions android/.kotlin/errors/errors-1725992091489.log

This file was deleted.

201 changes: 0 additions & 201 deletions android/.kotlin/errors/errors-1725992091528.log

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _AccountUserDetailButtomSheetState extends State<AccountUserDetailButtomSh
textAlign: TextAlign.right,
),
trailing: const Icon(Icons.chevron_right_outlined),
onTap: () => _onLookMore(recentTrans?.lastOrNull),
onTap: () => _onLookMore(recentTrans?.firstOrNull),
)
],
),
Expand Down
16 changes: 8 additions & 8 deletions lib/view/navigation/widget/user_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class UserDrawer extends StatelessWidget {
contentPadding: EdgeInsets.only(left: leftPadding),
onTap: () => AccountRoutes.list(context, selectedCurrentAccount: true).push(),
),
ListTile(
leading: Icon(Icons.toggle_on_outlined, color: iconColor),
title: const Text('分享配置'),
contentPadding: EdgeInsets.only(left: leftPadding),
onTap: () {
Navigator.pushNamed(context, UserRoutes.configTransactionShare);
},
),
// ListTile(
// leading: Icon(Icons.toggle_on_outlined, color: iconColor),
// title: const Text('分享配置'),
// contentPadding: EdgeInsets.only(left: leftPadding),
// onTap: () {
// Navigator.pushNamed(context, UserRoutes.configTransactionShare);
// },
// ),
ListTile(
leading: Icon(Icons.send_outlined, color: iconColor),
title: const Text('邀请'),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/share/home/widget/account_trans_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class _AccountTransListState extends State<AccountTransList> {
ListTile(
title: const Text("查看更多交易", textAlign: TextAlign.right),
trailing: const Icon(Icons.chevron_right_outlined),
onTap: () => _onLookMore(account, state.list.lastOrNull),
onTap: () => _onLookMore(account, state.list.firstOrNull),
),
],
));
Expand Down
130 changes: 78 additions & 52 deletions lib/view/transaction/detail/transaction_detail_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class _TransactionDetailBottomSheetState extends State<TransactionDetailBottomSh
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
padding: EdgeInsets.zero,
icon: const Icon(Icons.share_outlined),
onPressed: _onShare,
),
// IconButton(
// padding: EdgeInsets.zero,
// icon: const Icon(Icons.share_outlined),
// onPressed: _onShare,
// ),
],
);
}
Expand All @@ -98,60 +98,86 @@ class _TransactionDetailBottomSheetState extends State<TransactionDetailBottomSh
}

Widget _buildDetail(TransactionModel data) {
return Column(mainAxisSize: MainAxisSize.min, children: [
_buildListTile(
leading: "金额",
trailingWidget: AmountText.sameHeight(
data.amount,
textStyle: TextStyle(
fontSize: ConstantFontSize.body,
fontWeight: FontWeight.w500,
color: Colors.black,
),
)),
ConstantWidget.divider.list,
_buildListTile(
leading: "分类",
trailing: data.categoryName,
),
ConstantWidget.divider.list,
_buildListTile(
leading: "时间",
trailing: DateFormat.yMd().format(data.tradeTime),
),
ConstantWidget.divider.list,
_buildListTile(
leading: "账本",
trailing: data.accountName,
),
ConstantWidget.divider.list,
_buildListTile(
leading: "备注",
trailing: data.remark.isEmpty ? "无" : data.remark,
),
if (data.recordType != RecordType.manual) ...[
return Padding(
padding: EdgeInsets.symmetric(horizontal: Constant.margin),
child: Column(mainAxisSize: MainAxisSize.min, children: [
_buildListTile(
leading: "金额",
trailingWidget: Align(
alignment: Alignment.centerRight,
child: AmountText.sameHeight(
data.amount,
textStyle: TextStyle(
fontSize: ConstantFontSize.body,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
)),
ConstantWidget.divider.list,
_buildListTile(
leading: "记录方式",
trailing: data.recordType.label,
leading: "分类",
trailing: data.categoryName,
),
],
ConstantWidget.divider.list,
_buildListTile(
leading: "新建时间",
trailing: DateFormat.yMd().add_Hms().format(data.createTime),
),
_buildButtomButtonGroup(TransactionRouterGuard.edit(mode: TransactionEditMode.update, account: widget.account)),
]);
ConstantWidget.divider.list,
_buildListTile(
leading: "时间",
trailing: DateFormat.yMd().format(data.tradeTime),
),
ConstantWidget.divider.list,
_buildListTile(
leading: "账本",
trailing: data.accountName,
),
ConstantWidget.divider.list,
_buildListTile(
leading: "备注",
trailing: data.remark.isEmpty ? "无" : data.remark,
),
if (data.recordType != RecordType.manual) ...[
ConstantWidget.divider.list,
_buildListTile(leading: "记录方式", trailing: data.recordType.label),
],
if (widget.account.isShare) ...[
ConstantWidget.divider.list,
_buildListTile(leading: "记录人", trailing: data.userName),
],
ConstantWidget.divider.list,
_buildListTile(
leading: "新建时间",
trailing: DateFormat.yMd().add_Hms().format(data.createTime),
),
_buildButtomButtonGroup(TransactionRouterGuard.edit(mode: TransactionEditMode.update, account: widget.account)),
]),
);
}

Widget _buildListTile({required String leading, String? trailing, Widget? trailingWidget}) {
assert(trailing != null || trailingWidget != null);
trailingWidget ??= Text(trailing!, style: TextStyle(fontSize: ConstantFontSize.body));

return ListTile(
leading: Text(leading, style: TextStyle(fontSize: ConstantFontSize.body)),
trailing: trailingWidget,
trailingWidget ??= Text(trailing!,
style: TextStyle(fontSize: ConstantFontSize.body),
textAlign: TextAlign.right,
maxLines: 2,
overflow: TextOverflow.ellipsis);
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 3,
child: Padding(
padding: EdgeInsets.all(Constant.padding),
child: Text(leading, style: TextStyle(fontSize: ConstantFontSize.body)),
),
),
Expanded(
flex: 9,
child: Padding(
padding: EdgeInsets.all(Constant.padding),
child: trailingWidget,
),
)
],
);
}

Expand Down
2 changes: 2 additions & 0 deletions lib/view/transaction/flow/bloc/flow_condition_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class FlowConditionCubit extends AccountBasedCubit<FlowConditionState> {
);
} else {
_condition = condition;
condition.startTime = account.getTZDateTime(Time.getFirstSecondOfDay(date: condition.startTime));
condition.endTime = account.getTZDateTime(Time.getLastSecondOfDay(date: condition.endTime));
}
this.condition = _condition.copyWith();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/view/transaction/timing/widget/bottom_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _TimingBottomSelecterState extends State<TimingBottomSelecter> {
}

final double _leftWidth = 160.w;
final double _height = 280.sp;
final double _height = 300.sp;
final Duration _animatedDuration = Duration(milliseconds: 300);
@override
Widget build(BuildContext context) {
Expand Down
6 changes: 4 additions & 2 deletions lib/widget/form/form_selecter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ bottomSelecter createBottomSelect({
List<SelectOption<DateTime>> options;
DateTime now;
if(location!=null){
now = TZDateTime.from(DateTime.now(), location);
now = TZDateTime.from(Time.getFirstSecondOfDay(), location);
}else{
now = DateTime.now();
now = Time.getFirstSecondOfDay();
}
print(now);
if (mode == DateSelectMode.month) {
now = Time.getFirstSecondOfMonth(date: selected ?? now);
// The month has 28 days
Expand All @@ -110,6 +111,7 @@ bottomSelecter createBottomSelect({
.map((e) => SelectOption<DateTime>(name: DateFormat('EEE').format(e), value: e))
.toList();
}
print(options);
switch (type) {
case BottomSelecter:
return BottomSelecter<DateTime>(
Expand Down

0 comments on commit 1da2302

Please sign in to comment.