|
@@ -1,7 +1,9 @@
|
|
|
+import 'package:app_flowy/generated/locale_keys.g.dart';
|
|
|
import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
|
|
|
import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart';
|
|
|
import 'package:app_flowy/startup/startup.dart';
|
|
|
import 'package:app_flowy/plugins/grid/application/grid_bloc.dart';
|
|
|
+import 'package:easy_localization/easy_localization.dart';
|
|
|
import 'package:flowy_infra/theme.dart';
|
|
|
import 'package:flowy_infra_ui/flowy_infra_ui_web.dart';
|
|
|
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
|
|
@@ -119,6 +121,7 @@ class _FlowyGridState extends State<FlowyGrid> {
|
|
|
const _GridToolbarAdaptor(),
|
|
|
_gridHeader(context, state.gridId),
|
|
|
Flexible(child: child),
|
|
|
+ const RowCountBadge(),
|
|
|
],
|
|
|
);
|
|
|
},
|
|
@@ -307,48 +310,48 @@ class _GridFooter extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- final rowCount = context.watch<GridBloc>().state.rowInfos.length;
|
|
|
- final theme = context.watch<AppTheme>();
|
|
|
return SliverPadding(
|
|
|
padding: const EdgeInsets.only(bottom: 200),
|
|
|
sliver: SliverToBoxAdapter(
|
|
|
child: SizedBox(
|
|
|
height: GridSize.footerHeight,
|
|
|
child: Padding(
|
|
|
- padding: GridSize.headerContentInsets,
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- SizedBox(width: GridSize.leadingHeaderPadding),
|
|
|
- Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- const SizedBox(width: 120, child: GridAddRowButton()),
|
|
|
- const SizedBox(height: 30),
|
|
|
- _rowCountTextWidget(theme: theme, count: rowCount)
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
+ padding: GridSize.footerContentInsets,
|
|
|
+ child: const Expanded(
|
|
|
+ child: SizedBox(height: 40, child: GridAddRowButton()),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- Widget _rowCountTextWidget({required AppTheme theme, required int count}) {
|
|
|
- return Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- FlowyText.regular(
|
|
|
- 'Count : ',
|
|
|
- fontSize: 13,
|
|
|
- color: theme.shader3,
|
|
|
- ),
|
|
|
- FlowyText.regular(
|
|
|
- count.toString(),
|
|
|
- fontSize: 13,
|
|
|
- ),
|
|
|
- ],
|
|
|
+class RowCountBadge extends StatelessWidget {
|
|
|
+ const RowCountBadge({Key? key}) : super(key: key);
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
|
+
|
|
|
+ return BlocSelector<GridBloc, GridState, int>(
|
|
|
+ selector: (state) => state.rowCount,
|
|
|
+ builder: (context, rowCount) {
|
|
|
+ return Padding(
|
|
|
+ padding: GridSize.footerContentInsets,
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ FlowyText.regular(
|
|
|
+ '${LocaleKeys.grid_row_count.tr()} : ',
|
|
|
+ fontSize: 13,
|
|
|
+ color: theme.shader3,
|
|
|
+ ),
|
|
|
+ FlowyText.regular(rowCount.toString(), fontSize: 13),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
);
|
|
|
}
|
|
|
}
|