Skip to content

Commit

Permalink
FORMAT CODE
Browse files Browse the repository at this point in the history
  • Loading branch information
jzoom committed Oct 18, 2018
1 parent 7844823 commit 2896e5b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 35 deletions.
34 changes: 14 additions & 20 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions lib/src/swiper_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ import 'package:flutter_swiper/src/swiper_plugin.dart';
import 'package:transformer_page_view/transformer_page_view.dart';

class SwiperController extends IndexController {

// Autoplay is started
static const int START_AUTOPLAY = 2;

// Autoplay is stopped.
static const int STOP_AUTOPLAY = 3;


// Indicate that user is swiping
static const int SWIPE = 4;

// Indicate that `Swiper` has changed it's index and is building it's ui ,so that the
// `SwiperPluginConfig` is available.
static const int BUILD = 5;


// Avaliable when `event` == SwiperController.BUILD
SwiperPluginConfig config;

Expand All @@ -41,7 +38,4 @@ class SwiperController extends IndexController {
this.autoplay = false;
notifyListeners();
}



}
17 changes: 8 additions & 9 deletions test/flutter_swiper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,19 @@ void main() {
expect(find.text("0", skipOffstage: false), findsOneWidget);
});


testWidgets('Zero itemCount', (WidgetTester tester) async {
// Build our app and trigger a frame.
SwiperController controller = SwiperController();
await tester.pumpWidget(MaterialApp(
home: Swiper(
controller: controller,
itemBuilder: (context, index) {
return Text("0");
},
itemCount: 0,
pagination: SwiperPagination(builder: SwiperPagination.fraction),
control: SwiperControl(),
)));
controller: controller,
itemBuilder: (context, index) {
return Text("0");
},
itemCount: 0,
pagination: SwiperPagination(builder: SwiperPagination.fraction),
control: SwiperControl(),
)));

expect(find.text("0", skipOffstage: false), findsNothing);
});
Expand Down

0 comments on commit 2896e5b

Please sign in to comment.