Skip to content

Commit

Permalink
Refactor library structure
Browse files Browse the repository at this point in the history
- Remove need of importing grouped_list when using silver_grouped_list
  • Loading branch information
Dimibe committed Jul 22, 2021
1 parent 116a7fb commit b3d435f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion example/lib/example_sliver.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:grouped_list/grouped_list.dart';
import 'package:grouped_list/sliver_grouped_list.dart';

void main() => runApp(MyApp());
Expand Down
9 changes: 4 additions & 5 deletions lib/grouped_list.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
library grouped_list;

import 'dart:async';
import 'dart:collection';
import 'dart:math' as math;

import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';

import 'src/GroupedListOrder.dart';

export 'src/GroupedListOrder.dart';

/// A groupable list of widgets similar to [ListView], execpt that the
/// items can be sectioned into groups.
///
Expand Down Expand Up @@ -428,6 +430,3 @@ class _GroupedListViewState<T, E> extends State<GroupedListView<T, E>> {
return widget.groupHeaderBuilder!(element);
}
}

/// Used to define the order of a [GroupedListView].
enum GroupedListOrder { ASC, DESC }
7 changes: 4 additions & 3 deletions lib/sliver_grouped_list.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
library grouped_list;

import 'dart:collection';
import 'package:flutter/widgets.dart';
import 'package:grouped_list/grouped_list.dart';

import 'src/GroupedListOrder.dart';

export 'src/GroupedListOrder.dart';

class SliverGroupedListView<T, E> extends StatefulWidget {
/// Items of which [itemBuilder] or [indexedItemBuilder] produce the list.
Expand Down
5 changes: 5 additions & 0 deletions lib/src/GroupedListOrder.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import '../grouped_list.dart';
import '../sliver_grouped_list.dart';

/// Used to define the order of a [GroupedListView] or [SliverGroupedListView].
enum GroupedListOrder { ASC, DESC }
1 change: 0 additions & 1 deletion test/sliver_grouped_list_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:grouped_list/grouped_list.dart';
import 'package:grouped_list/sliver_grouped_list.dart';
import 'package:flutter/material.dart';

Expand Down

0 comments on commit b3d435f

Please sign in to comment.