Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
小滋润 committed Oct 21, 2024
1 parent 7def9d7 commit 2c3da3b
Show file tree
Hide file tree
Showing 24 changed files with 150 additions and 190 deletions.
9 changes: 4 additions & 5 deletions lib/common/constant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ class Constant {
static init() {
radius = 12.0.sp;
buttomSheetRadius = 28.0.sp;
smallPadding = 8.0.sp;
padding = 16.0.sp;
largePadding = 24.0.sp;
margin = 8.0.sp;
buttomHight = 320.0.h;
buttomHight = 320.h;
buttomLetterSpacing = 4.0.sp;

iconSize = 24;
iconlargeSize = 32;
}
}

Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ class MyApp extends StatelessWidget {
shadowColor: ConstantColor.shadowColor,
surfaceTintColor: Colors.white,
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
side: BorderSide(color: Colors.grey),
foregroundColor: Colors.grey,
shape: const StadiumBorder(side: BorderSide(style: BorderStyle.none)),
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(Colors.blue),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/account/edit/account_edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AccountEditState extends State<AccountEdit> {
appBar: AppBar(
title: Text(mode == AccountEditMode.add ? "添加账本" : "编辑账本"),
actions: <Widget>[
IconButton(icon: Icon(Icons.save, size: 24), onPressed: _onSave),
IconButton(icon: Icon(Icons.save, size: Constant.iconSize), onPressed: _onSave),
],
),
body: SingleChildScrollView(
Expand Down
2 changes: 1 addition & 1 deletion lib/view/account/list/enter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Widget _buildLeading(AccountModel account, int selectAccountId) {
child: Container(color: account.id == selectAccountId ? ConstantColor.primaryColor : Colors.white),
),
SizedBox(width: Constant.margin),
Icon(account.icon, size: Constant.iconlargeSize),
Icon(account.icon, size: Constant.iconSize),
SizedBox(width: Constant.margin),
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class _AccountUserDetailButtomSheetState extends State<AccountUserDetailButtomSh
children: [
Column(
children: [
Icon(icon, size: 36, color: ConstantColor.primaryColor),
Icon(icon, size: Constant.iconlargeSize, color: ConstantColor.primaryColor),
Text(
text,
style: TextStyle(
Expand Down
2 changes: 1 addition & 1 deletion lib/view/home/widget/header_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class _HeaderCardState extends State<HeaderCard> {
padding: EdgeInsets.symmetric(horizontal: Constant.padding),
child: Text(
"${_bloc.account.timeLocation.name} ${DateFormat.Md().format(_bloc.getTZDateTime(start))} - ${DateFormat.Md().format(_bloc.getTZDateTime(end))}",
style: TextStyle(fontSize: ConstantFontSize.bodySmall),
style: TextStyle(fontSize: ConstantFontSize.body),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/view/navigation/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class _NavigationState extends State<Navigation> {
return IndexedStack(index: index, children: _pages);
},
),
floatingActionButton: FloatingActionButton(onPressed: _onAdd, child: const Icon(Icons.add)),
floatingActionButton: FloatingActionButton(onPressed: _onAdd, child: Icon(Icons.add, size: Constant.iconSize)),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: const _BottomNavigationBar(),
endDrawer: const UserDrawer(),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/navigation/widget/user_drawer_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class _UserDrawerHeaderState extends State<UserDrawerHeader> {
Clipboard.setData(ClipboardData(text: user.uniqueUsername));
CommonToast.tipToast("用户名已复制");
},
child: Icon(Icons.copy_outlined, color: Colors.white, size: 18))
child: Icon(Icons.copy_outlined, color: Colors.white, size: ConstantFontSize.body))
],
)));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/view/share/home/widget/account_total.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AccountTotal extends StatelessWidget {
children: [
Column(
children: [
Icon(icon, size: 36, color: ConstantColor.primaryColor),
Icon(icon, size: Constant.iconlargeSize, color: ConstantColor.primaryColor),
Text(
text,
style: TextStyle(
Expand Down
13 changes: 2 additions & 11 deletions lib/view/transaction/category/edit/transaction_category_edit.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leap_ledger_app/bloc/category/category_bloc.dart';
import 'package:leap_ledger_app/common/global.dart';
import 'package:leap_ledger_app/model/account/model.dart';
import 'package:leap_ledger_app/model/transaction/category/model.dart';
import 'package:leap_ledger_app/widget/form/form.dart';
import 'package:leap_ledger_app/widget/icon/enter.dart';

class TransactionCategoryEdit extends StatefulWidget {
const TransactionCategoryEdit({super.key, this.transactionCategory, required this.account});
Expand Down Expand Up @@ -67,16 +67,7 @@ class _TransactionCategoryEditState extends State<TransactionCategoryEdit> {
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(90),
),
margin: EdgeInsets.only(bottom: Constant.padding),
width: 64.sp,
height: 64.sp,
child: Icon(data.icon, size: Constant.iconlargeSize, color: Colors.black87),
),
CircularIcon(icon: data.icon),
FormInputField.string('名称', data.name, (text) => data.name = text),
SizedBox(height: Constant.padding),
FormSelecter.transactionCategoryIcon(data.icon, onChanged: _onSelectIcon),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ class _TransactionDetailBottomSheetState extends State<TransactionDetailBottomSh
offstage: false == canEdit,
child: OutlinedButton(
onPressed: _onDelete,
style: const ButtonStyle(
side: WidgetStatePropertyAll<BorderSide>(BorderSide(color: ConstantColor.primaryColor)),
),
child: Text(
"删除",
style: TextStyle(letterSpacing: Constant.buttomLetterSpacing),
Expand Down
22 changes: 13 additions & 9 deletions lib/view/transaction/flow/transaction_flow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ class _TransactionFlowState extends State<TransactionFlow> {
child: BlocBuilder<FlowConditionCubit, FlowConditionState>(
buildWhen: (_, state) => state is FlowCurrentAccountChanged,
builder: (context, state) {
return Row(children: [
Icon(_conditionCubit.account.icon, size: Constant.iconSize),
Text(_conditionCubit.account.name)
]);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(_conditionCubit.account.icon, size: Constant.iconSize),Text(_conditionCubit.account.name)
],
);
},
),
),
Expand All @@ -200,11 +203,7 @@ class _TransactionFlowState extends State<TransactionFlow> {
startDate: _conditionCubit.condition.startTime,
endDate: _conditionCubit.condition.endTime,
).push(),
icon: Icon(
Icons.pie_chart_outline_outlined,
color: ConstantColor.primaryColor,
size: Constant.iconSize,
),
icon: Icon(Icons.pie_chart_outline_outlined, color: ConstantColor.primaryColor, size: Constant.iconSize),
),
Builder(builder: (context) {
return IconButton(
Expand All @@ -213,6 +212,11 @@ class _TransactionFlowState extends State<TransactionFlow> {
showModalBottomSheet(
isScrollControlled: true,
context: context,
transitionAnimationController: AnimationController(
animationBehavior: AnimationBehavior.preserve,
vsync: Scaffold.of(context),
duration: Duration(milliseconds: 600),
)..drive(CurveTween(curve: Curves.easeInOut)),
builder: (BuildContext context) {
return BlocProvider.value(
value: _conditionCubit,
Expand Down
Loading

0 comments on commit 2c3da3b

Please sign in to comment.