Skip to content

Commit

Permalink
fix and update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
小滋润 committed Oct 10, 2024
1 parent acef024 commit dd6649d
Show file tree
Hide file tree
Showing 23 changed files with 325 additions and 285 deletions.
9 changes: 0 additions & 9 deletions lib/common/constant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,9 @@ class ConstantFontSize {
static const double bodySmall = 12;

static const double letterSpacing = 2;
// static init() {
// largeHeadline = largeHeadline.sp;
// headline = headline.sp;
// bodyLarge = bodyLarge.sp;
// body = body.sp;
// bodySmall = bodySmall.sp;
// letterSpacing = letterSpacing.sp;
// }
}

class ConstantWidget {
// ignore: library_private_types_in_public_api
static _ConstantWidgetDivider divider = _ConstantWidgetDivider();
static const Widget activityIndicator = CircularProgressIndicator();
}
Expand Down
6 changes: 0 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class MyApp extends StatelessWidget {
final AccountBloc _accountBloc = AccountBloc();
@override
Widget build(BuildContext context) {
ScreenUtil.init(context);

return MultiRepositoryProvider(
providers: [
RepositoryProvider<UserBloc>(create: (context) => UserBloc(_accountBloc)),
Expand Down Expand Up @@ -109,10 +107,6 @@ class MyApp extends StatelessWidget {
// smallSizeConstraints: BoxConstraints(minWidth: 100),
// extendedSizeConstraints: BoxConstraints(minWidth: 100),
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Colors.white,
surfaceTintColor: Colors.white,
),
iconTheme: IconThemeData.fallback().copyWith(applyTextScaling: true),
useMaterial3: true,
),
Expand Down
125 changes: 79 additions & 46 deletions lib/model/transaction/model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 52 additions & 28 deletions lib/model/transaction/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,6 @@ class TransactionEditModel {

factory TransactionEditModel.fromJson(Map<String, dynamic> json) => _$TransactionEditModelFromJson(json);
Map<String, dynamic> toJson() => _$TransactionEditModelToJson(this);
TransactionEditModel copy() {
return TransactionEditModel(
id: id,
userId: userId,
accountId: accountId,
categoryId: categoryId,
incomeExpense: incomeExpense,
amount: amount,
remark: remark,
tradeTime: tradeTime,
);
}

setLocation(Location l) {
tradeTime = TZDateTime.from(tradeTime, l);
Expand Down Expand Up @@ -135,21 +123,35 @@ class TransactionInfoModel extends TransactionEditModel {
incomeExpense = category.incomeExpense;
}

TransactionInfoModel copy() {
TransactionInfoModel copyWith({
int? id,
int? userId,
String? userName,
int? accountId,
String? accountName,
IncomeExpense? incomeExpense,
int? categoryId,
IconData? categoryIcon,
String? categoryName,
String? categoryFatherName,
int? amount,
String? remark,
DateTime? tradeTime,
}) {
return TransactionInfoModel(
id: id,
userId: userId,
userName: userName,
accountId: accountId,
accountName: accountName,
incomeExpense: incomeExpense,
categoryId: categoryId,
categoryIcon: categoryIcon,
categoryName: categoryName,
categoryFatherName: categoryFatherName,
amount: amount,
remark: remark,
tradeTime: tradeTime,
id: id ?? this.id,
userId: userId ?? this.userId,
userName: userName ?? this.userName,
accountId: accountId ?? this.accountId,
accountName: accountName ?? this.accountName,
incomeExpense: incomeExpense ?? this.incomeExpense,
categoryId: categoryId ?? this.categoryId,
categoryIcon: categoryIcon ?? this.categoryIcon,
categoryName: categoryName ?? this.categoryName,
categoryFatherName: categoryFatherName ?? this.categoryFatherName,
amount: amount ?? this.amount,
remark: remark ?? this.remark,
tradeTime: tradeTime ?? this.tradeTime,
);
}

Expand Down Expand Up @@ -266,7 +268,7 @@ class TransactionShareModel {
Map<String, dynamic> toJson() => _$TransactionShareModelToJson(this);
}

@JsonSerializable(fieldRename: FieldRename.pascal)
@JsonSerializable(fieldRename: FieldRename.pascal, createFactory: false)
class TransactionQueryCondModel {
int accountId;
@JsonKey(toJson: toSet)
Expand Down Expand Up @@ -355,7 +357,6 @@ class TransactionQueryCondModel {
Map<String, dynamic> toJson() => _$TransactionQueryCondModelToJson(this);

@override
// ignore: unnecessary_overrides
int get hashCode => super.hashCode;

bool checkTrans(TransactionModel trans) {
Expand Down Expand Up @@ -483,6 +484,29 @@ class TransactionTimingModel {
}
}

TransactionTimingModel copyWith({
int? id,
int? accountId,
int? userId,
TransactionTimingType? type,
int? offsetDays,
DateTime? nextTime,
bool? close,
DateTime? updatedAt,
DateTime? createdAt,
}) =>
TransactionTimingModel(
id: id ?? this.id,
accountId: accountId ?? this.accountId,
userId: userId ?? this.userId,
type: type ?? this.type,
offsetDays: offsetDays ?? this.offsetDays,
nextTime: nextTime ?? this.nextTime,
close: close ?? this.close,
updatedAt: updatedAt ?? this.updatedAt,
createdAt: createdAt ?? this.createdAt,
);

setUser(UserModel user) {
userId = user.id;
}
Expand Down
1 change: 0 additions & 1 deletion lib/model/user/model.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:leap_ledger_app/common/global.dart';
import 'package:leap_ledger_app/model/account/model.dart';
import 'package:leap_ledger_app/util/enter.dart';
import 'package:leap_ledger_app/widget/common/common.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/util/enter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'dart:convert';
import 'dart:async';

import 'package:file_picker/file_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:leap_ledger_app/common/global.dart';
import 'package:permission_handler/permission_handler.dart';
Expand Down
Loading

0 comments on commit dd6649d

Please sign in to comment.