Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Dec 23, 2023
1 parent 7bedb86 commit 164669e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 77 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.7.3]
* improve code style
* improve dropdown animate

## [4.7.2]
* add actionAlignment for dropdown

Expand Down
25 changes: 6 additions & 19 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="DialogDemo"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<uses-permission android:name="android.permission.INTERNET" />

<application android:label="DialogDemo" android:name="${applicationName}" android:usesCleartextTraffic="true" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
</manifest>
50 changes: 1 addition & 49 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
sha256: "793964beb8e297995714326628881437d4211f10fc8843534bab54129cd896ee"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.3.1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -57,14 +49,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.1"
crypto:
dependency: transitive
description:
name: crypto
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.2"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -96,14 +80,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: "direct main"
description:
name: image
sha256: "9d2c5f73435a70a936d317769ee8e7ef480e37674b9f2bce95ea98969a307855"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -152,21 +128,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.3"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.0"
shirne_dialog:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "4.7.2"
version: "4.7.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -220,14 +188,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.1"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
vector_math:
dependency: transitive
description:
Expand All @@ -244,13 +204,5 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
xml:
dependency: transitive
description:
name: xml
sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.0"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
3 changes: 1 addition & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ dependencies:
flutter_localizations:
sdk: flutter

image:
shirne_dialog:
path: ../

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
flutter_lints:

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
32 changes: 27 additions & 5 deletions lib/src/widgets/dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ class _DropdownWidgetState extends State<DropdownWidget> {
),
child: GestureDetector(
onTap: () {},
child: CombinedAnimation(
config: widget.animate ?? AnimationConfig.fadeIn,
leaveConfig: widget.leaveAnimate,
//controller: controller,
child: ValueListenableBuilder<DropDownLayoutPosition>(
valueListenable: layoutPositionNotifier,
builder: (context, value, child) {
return CombinedAnimation(
config: widget.animate ??
AnimationConfig.enter(align: value.startAlign),
leaveConfig: widget.leaveAnimate,
//controller: controller,
child: child!,
);
},
child: Material(
color: Colors.transparent,
borderOnForeground: false,
Expand Down Expand Up @@ -245,6 +252,19 @@ enum DropDownLayoutPosition {
}
}

Alignment get startAlign {
switch (this) {
case top:
return const Alignment(0, 0.3);
case left:
return const Alignment(0.3, 0);
case right:
return const Alignment(-0.3, 0);
case bottom:
return const Alignment(0, -0.3);
}
}

static const auto = {bottom, top, right, left};
static const vertical = {bottom, top};
static const horizontal = {bottom, top};
Expand Down Expand Up @@ -322,7 +342,9 @@ class _DropDownLayout extends SingleChildLayoutDelegate {
constraintsSets.entries.first,
bigger,
);
layoutPositionNotifier.value = _resolved!.key;
WidgetsBinding.instance.addPostFrameCallback((_) {
layoutPositionNotifier.value = _resolved!.key;
});
return _resolved!;
}

Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: shirne_dialog
description: A flutter package to use alert, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.
version: 4.7.2
version: 4.7.3
homepage: https://shirne.github.io/dialog/
repository: https://github.com/shirne/shirne_dialog
screenshots:
Expand All @@ -22,7 +22,6 @@ dependencies:
sdk: flutter
combined_animation: ">=0.3.1 <1.0.0"


dev_dependencies:
flutter_test:
sdk: flutter
Expand Down

0 comments on commit 164669e

Please sign in to comment.