From a46872cfa97885c2cc982597e1fccdc2c6cf74c0 Mon Sep 17 00:00:00 2001 From: Majd Date: Wed, 19 Feb 2020 19:49:22 +0200 Subject: [PATCH 1/2] - make autoplayDelay can change in onIndexChange --- example/lib/InnerSwiper.dart | 6 ++++++ lib/src/swiper.dart | 17 ++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/example/lib/InnerSwiper.dart b/example/lib/InnerSwiper.dart index ccf32a6..c8dd544 100644 --- a/example/lib/InnerSwiper.dart +++ b/example/lib/InnerSwiper.dart @@ -21,6 +21,7 @@ class InnerSwiper extends StatefulWidget { class _InnerSwiperState extends State { SwiperController controller; + int autoPlayDelay = 3000; List autoplayes; @@ -60,6 +61,11 @@ class _InnerSwiperState extends State { child: new Text("jkfjkldsfjd"), ); }, + onIndexChanged: (i) { + setState(() { + autoPlayDelay = autoPlayDelay * i; + }); + }, autoplay: autoplayes[index], ), height: 300.0, diff --git a/lib/src/swiper.dart b/lib/src/swiper.dart index 9783740..482ce94 100644 --- a/lib/src/swiper.dart +++ b/lib/src/swiper.dart @@ -1,9 +1,9 @@ -import 'package:flutter/material.dart'; +import 'dart:async'; + import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_page_indicator/flutter_page_indicator.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'dart:async'; - import 'package:transformer_page_view/transformer_page_view.dart'; part 'custom_layout.dart'; @@ -48,13 +48,13 @@ class Swiper extends StatefulWidget { /// count of the display items final int itemCount; - final ValueChanged onIndexChanged; + final Function(int) onIndexChanged; ///auto play config final bool autoplay; ///Duration of the animation between transactions (in millisecond). - final int autoplayDelay; + int autoplayDelay; ///disable auto play when interaction final bool autoplayDisableOnInteraction; @@ -285,7 +285,7 @@ class Swiper extends StatefulWidget { @override State createState() { - return new _SwiperState(); + return new _SwiperState(delay: this.autoplayDelay); } } @@ -380,7 +380,8 @@ abstract class _SwiperTimerMixin extends State { class _SwiperState extends _SwiperTimerMixin { int _activeIndex; - + int delay; + _SwiperState({this.delay}); TransformerPageController _pageController; Widget _wrapTap(BuildContext context, int index) { @@ -456,6 +457,8 @@ class _SwiperState extends _SwiperTimerMixin { _activeIndex = index; }); if (widget.onIndexChanged != null) { + _stopAutoplay(); + _startAutoplay(); widget.onIndexChanged(index); } } From 4a3cf3e29631532aafac47b2a7407d0338e4336f Mon Sep 17 00:00:00 2001 From: Majd Date: Sat, 11 Apr 2020 03:46:06 +0300 Subject: [PATCH 2/2] - Upload ios version to app store --- example/pubspec.lock | 123 ++++++++++++++++++++++++++++++------------- pubspec.lock | 113 ++++++++++++++++++++++++++++----------- 2 files changed, 167 insertions(+), 69 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 5aa195f..16f1318 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,41 +1,69 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.4.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.1.3" flutter: dependency: "direct main" description: flutter @@ -45,7 +73,7 @@ packages: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.3" flutter_swiper: @@ -54,47 +82,61 @@ packages: path: ".." relative: true source: path - version: "1.1.5" + version: "1.1.6" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.6" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.1.8" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" percent_indicator: dependency: "direct main" description: name: percent_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.1.1+1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.5" sky_engine: dependency: transitive description: flutter @@ -104,65 +146,72 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.5.5" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.9.3" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.2.14" transformer_page_view: dependency: transitive description: name: transformer_page_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.6" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" sdks: - dart: ">=2.0.0 <3.0.0" + dart: ">=2.4.0 <3.0.0" flutter: ">=0.1.4 <3.0.0" diff --git a/pubspec.lock b/pubspec.lock index 86f253d..d71d841 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,34 +1,62 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.4.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" flutter: dependency: "direct main" description: flutter @@ -38,7 +66,7 @@ packages: dependency: "direct main" description: name: flutter_page_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.3" flutter_test: @@ -46,34 +74,48 @@ packages: description: flutter source: sdk version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.6" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.1.8" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.5" sky_engine: dependency: transitive description: flutter @@ -83,65 +125,72 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.5.5" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.9.3" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.2.14" transformer_page_view: dependency: "direct main" description: name: transformer_page_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.6" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" sdks: - dart: ">=2.0.0 <3.0.0" + dart: ">=2.4.0 <3.0.0" flutter: ">=0.1.4 <3.0.0"