Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
mu-dawood committed Dec 28, 2021
1 parent 73c3d11 commit 04b0ad7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
3 changes: 2 additions & 1 deletion ready/example/lib/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import 'responsive.dart';

class DashBoardExample extends StatelessWidget {
final ValueChanged<ThemeMode> onModeChanged;
const DashBoardExample({Key? key, required this.onModeChanged}) : super(key: key);
const DashBoardExample({Key? key, required this.onModeChanged})
: super(key: key);

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion ready/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1-dev.2"
version: "0.0.1-dev.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down
27 changes: 19 additions & 8 deletions ready/lib/src/dashboard/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class _DrawerIcon extends StatelessWidget {
},
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: Tween(begin: hasDrawer ? 1.0 : 0.0, end: hasDrawer ? 0.0 : 1.0).animate(expansion),
progress:
Tween(begin: hasDrawer ? 1.0 : 0.0, end: hasDrawer ? 0.0 : 1.0)
.animate(expansion),
),
);
}
Expand All @@ -97,10 +99,14 @@ class _DashBoardDrawerState extends State<_DashBoardDrawer> {
}

List<DashboardItem> expaded(List<DashboardItem> items) {
return items.expand((element) => element.subItems.isEmpty ? [element] : expaded(element.subItems)).toList();
return items
.expand((element) =>
element.subItems.isEmpty ? [element] : expaded(element.subItems))
.toList();
}

Widget buildTile(BuildContext context, DashboardItem item, DashboardItem selected, List<DashboardItem> expanded) {
Widget buildTile(BuildContext context, DashboardItem item,
DashboardItem selected, List<DashboardItem> expanded) {
if (item.builder != null) {
var child = ListTile(
onTap: () {
Expand All @@ -113,7 +119,8 @@ class _DashBoardDrawerState extends State<_DashBoardDrawer> {
},
selected: item == selected,
title: Text(item.label),
leading: selected == item ? (item.selectedIcon ?? item.icon) : item.icon,
leading:
selected == item ? (item.selectedIcon ?? item.icon) : item.icon,
);
return child;
} else {
Expand All @@ -124,13 +131,15 @@ class _DashBoardDrawerState extends State<_DashBoardDrawer> {
initiallyExpanded: inner.any((element) => element == selected),
leading: item.icon,
children: [
for (var sub in item.subItems) buildTile(context, sub, selected, expanded),
for (var sub in item.subItems)
buildTile(context, sub, selected, expanded),
],
);
}
}

Widget _tilelistView(BuildContext context, List<DashboardItem> items, DrawerOptions options) {
Widget _tilelistView(
BuildContext context, List<DashboardItem> items, DrawerOptions options) {
var expanded = expaded(items);
return TabControllerLisner(
builder: (int index) {
Expand All @@ -157,7 +166,8 @@ class _DashBoardDrawerState extends State<_DashBoardDrawer> {
SliverList(
delegate: SliverChildListDelegate([
...options.headers,
for (var item in items) buildTile(context, item, selectedItem, expanded),
for (var item in items)
buildTile(context, item, selectedItem, expanded),
])),
if (options.footer != null)
SliverFillRemaining(
Expand Down Expand Up @@ -191,7 +201,8 @@ class _DrawerHeader extends SliverPersistentHeaderDelegate {
required this.statusBar,
});
@override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return SafeArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand Down
6 changes: 0 additions & 6 deletions ready/lib/src/ready_list/ready_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ part 'refresh_indecators.dart';
class ReadyList<T, TController extends ReadyListController<T>>
extends StatefulWidget implements ReadyListConfigOptions {
final ScrollController? scrollController;
final ReadyListWidgetBuilder<T>? innerHeaderSlivers;
final ReadyListWidgetBuilder<T>? headerSlivers;
final ReadyListWidgetBuilder<T>? footerSlivers;
final ReadyListWidgetBuilder<T>? innerFooterSlivers;
Expand Down Expand Up @@ -71,7 +70,6 @@ class ReadyList<T, TController extends ReadyListController<T>>
this.scrollController,
this.headerSlivers,
this.innerFooterSlivers,
this.innerHeaderSlivers,
this.footerSlivers,
required ReadyListWidgetBuilder<T> slivers,
required this.controller,
Expand Down Expand Up @@ -104,7 +102,6 @@ class ReadyList<T, TController extends ReadyListController<T>>
this.scrollController,
this.headerSlivers,
this.innerFooterSlivers,
this.innerHeaderSlivers,
this.footerSlivers,
required ReadyListItemBuilder<T> buildItem,
ReorderOptions? reorderOptions,
Expand Down Expand Up @@ -141,7 +138,6 @@ class ReadyList<T, TController extends ReadyListController<T>>
this.scrollController,
this.headerSlivers,
this.innerFooterSlivers,
this.innerHeaderSlivers,
this.footerSlivers,
required ReadyListItemBuilder<T> buildItem,
GridDelegateCallback gridDelegate = Grids.columns_2,
Expand Down Expand Up @@ -306,8 +302,6 @@ class _ReadyListState<T, TController extends ReadyListController<T>>
if (widget.topLevelHeaderSlivers != null)
...widget.topLevelHeaderSlivers!,
if (widget.headerSlivers != null) ...widget.headerSlivers!(state),
if (widget.innerHeaderSlivers != null)
...widget.innerHeaderSlivers!(state),
if (widget._slivers != null)
...state.when(
empty: () => [
Expand Down
5 changes: 0 additions & 5 deletions ready/lib/src/responsive_data_table/_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ class ListOptions<T> implements ReadyListConfigOptions {
/// [ReadyList.headerSlivers]
final ReadyListWidgetBuilder<T>? headerSlivers;

/// [ReadyList.innerHeaderSlivers]
final ReadyListWidgetBuilder<T>? innerHeaderSlivers;

/// [ReadyList.footerSlivers]
final ReadyListWidgetBuilder<T>? footerSlivers;

Expand Down Expand Up @@ -157,7 +154,6 @@ class ListOptions<T> implements ReadyListConfigOptions {
this.trailing,
this.scrollController,
this.headerSlivers,
this.innerHeaderSlivers,
this.footerSlivers,
this.innerFooterSlivers,
this.placeholdersConfig,
Expand Down Expand Up @@ -185,7 +181,6 @@ class ListOptions<T> implements ReadyListConfigOptions {
required ListItemBuilder<T> builder,
this.scrollController,
this.headerSlivers,
this.innerHeaderSlivers,
this.footerSlivers,
this.innerFooterSlivers,
this.placeholdersConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ class __ResponsiveDataTableState<T, TController extends ReadyListController<T>>
.copyWith(dividerColor: Colors.transparent),
child: ReadyList<T, TController>.grid(
scrollController: listOptions.scrollController,
innerHeaderSlivers: listOptions.innerHeaderSlivers,
footerSlivers: listOptions.footerSlivers,
innerFooterSlivers: listOptions.innerFooterSlivers,
placeholdersConfig: listOptions.placeholdersConfig,
Expand Down
2 changes: 1 addition & 1 deletion ready/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ready
description: Package that contains complete list solution and admin dashboard
version: 0.0.1-dev.2
version: 0.0.1-dev.3
homepage: https://github.com/mo-ah-dawood/ready

environment:
Expand Down

0 comments on commit 04b0ad7

Please sign in to comment.