- 新增 CategoryScreen 屏幕用于显示分类- 新增 ItemCategory 模型类用于分类数据管理 - 新增 ItemCategoryRepository 用于分类数据持久化 - 新增 item_category_table 创建分类表结构 -重构 HomeScreen 底部导航栏,增加分类选项 - 重命名相关屏幕文件,统一命名规范 - 调整 ItemScreen 以适应新增的分类功能- 更新 SQLiteHelper 以支持分类表创建和默认分类插入 - 删除 StatisticsScreen 屏幕
25 lines
646 B
Dart
25 lines
646 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SubmitButton extends StatelessWidget {
|
|
final VoidCallback onPressed;
|
|
final bool isEdit;
|
|
|
|
const SubmitButton({required this.onPressed, this.isEdit = false});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final buttonText = isEdit ? '保存' : '提交';
|
|
return ElevatedButton(
|
|
onPressed: onPressed,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Text('${buttonText}'),
|
|
),
|
|
style: ElevatedButton.styleFrom(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
elevation: 4,
|
|
),
|
|
);
|
|
}
|
|
}
|