feat: row count widget added

This commit is contained in:
Aman Kumar 2022-07-29 22:14:53 +05:30
parent 04b06659f4
commit d955b6ef7e
3 changed files with 32 additions and 3 deletions

View File

@ -64,4 +64,5 @@ windows/flutter/dart_ffi/
**/**/*.dll
**/**/*.so
**/**/Brewfile.lock.json
**/.sandbox
**/.sandbox
**/.vscode/

View File

@ -1,14 +1,18 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/grid/grid_bloc.dart';
import 'package:app_flowy/workspace/application/grid/row/row_service.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_scroll_bar.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_scrollview.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart';
import 'package:linked_scroll_controller/linked_scroll_controller.dart';
import 'package:provider/provider.dart';
import 'controller/grid_scroll.dart';
import 'layout/layout.dart';
import 'layout/sizes.dart';
@ -250,6 +254,8 @@ 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(
@ -260,7 +266,14 @@ class _GridFooter extends StatelessWidget {
child: Row(
children: [
SizedBox(width: GridSize.leadingHeaderPadding),
const SizedBox(width: 120, child: GridAddRowButton()),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: 120, child: GridAddRowButton()),
const SizedBox(height: 30),
_rowCountTextWidget(theme: theme,count: rowCount)
],
),
],
),
),
@ -268,4 +281,19 @@ class _GridFooter extends StatelessWidget {
),
);
}
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,
),
],
);
}
}

View File

@ -5,7 +5,7 @@ class GridSize {
static double get scrollBarSize => 12 * scale;
static double get headerHeight => 40 * scale;
static double get footerHeight => 40 * scale;
static double get footerHeight => 100 * scale;
static double get leadingHeaderPadding => 50 * scale;
static double get trailHeaderPadding => 140 * scale;
static double get headerContainerPadding => 0 * scale;