Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix description on the pubspec.yaml #193

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -399,7 +399,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
5 changes: 4 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class _MyHomePageState extends State<MyHomePage> {
_timer?.cancel();
await EasyLoading.show(
status: 'loading...',
maskType: EasyLoadingMaskType.black,
);
print('EasyLoading show');
},
Expand Down Expand Up @@ -228,6 +227,10 @@ class _MyHomePageState extends State<MyHomePage> {
padding: EdgeInsets.all(5.0),
child: Text('custom'),
),
EasyLoadingMaskType.blur: Padding(
padding: EdgeInsets.all(5.0),
child: Text('blur'),
),
},
onValueChanged: (value) {
EasyLoading.instance.maskType = value;
Expand Down
161 changes: 161 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_easyloading:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "3.0.5"
flutter_spinkit:
dependency: transitive
description:
name: flutter_spinkit
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
sdks:
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.0.0"
5 changes: 4 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: example
description: A new Flutter project.
publish_to: none

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand All @@ -20,7 +21,9 @@ dependencies:
flutter:
sdk: flutter

flutter_easyloading: ^3.0.0
# flutter_easyloading: ^3.0.0
flutter_easyloading:
path: ../

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down
43 changes: 43 additions & 0 deletions lib/src/easy_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum EasyLoadingMaskType {
clear,
black,
custom,
blur,
}

/// loading indicator type. see [https://github.com/jogboms/flutter_spinkit#-showcase]
Expand Down Expand Up @@ -112,6 +113,12 @@ class EasyLoading {
/// loading mask type, default [EasyLoadingMaskType.none].
late EasyLoadingMaskType maskType;

/// Value of blur mask, default 5.0.
late double sigmaX;

/// Value of blur mask, default 5.0.
late double sigmaY;

/// toast position, default [EasyLoadingToastPosition.center].
late EasyLoadingToastPosition toastPosition;

Expand Down Expand Up @@ -190,6 +197,12 @@ class EasyLoading {
/// info widget of loading
Widget? infoWidget;

/// padding of mask, default 0.
EdgeInsets? maskPadding;

/// activate safe area of mask, default false.
bool? maskUseSafeArea;

Widget? _w;

EasyLoadingOverlayEntry? overlayEntry;
Expand Down Expand Up @@ -217,6 +230,8 @@ class EasyLoading {
textAlign = TextAlign.center;
indicatorSize = 40.0;
radius = 5.0;
sigmaX = 5.0;
sigmaY = 5.0;
fontSize = 15.0;
progressWidth = 2.0;
lineWidth = 4.0;
Expand All @@ -227,6 +242,8 @@ class EasyLoading {
vertical: 15.0,
horizontal: 20.0,
);
maskPadding = EdgeInsets.zero;
maskUseSafeArea = false;
}

static EasyLoading get instance => _instance;
Expand All @@ -251,13 +268,17 @@ class EasyLoading {
Widget? indicator,
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) {
Widget w = indicator ?? (_instance.indicatorWidget ?? LoadingIndicator());
return _instance._show(
status: status,
maskType: maskType,
dismissOnTap: dismissOnTap,
w: w,
maskPadding: maskPadding,
maskUseSafeArea: maskUseSafeArea,
);
}

Expand All @@ -266,6 +287,8 @@ class EasyLoading {
double value, {
String? status,
EasyLoadingMaskType? maskType,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) async {
assert(
value >= 0.0 && value <= 1.0,
Expand All @@ -292,6 +315,8 @@ class EasyLoading {
maskType: maskType,
dismissOnTap: false,
w: w,
maskPadding: maskPadding,
maskUseSafeArea: maskUseSafeArea,
);
_instance._progressKey = _progressKey;
}
Expand All @@ -307,6 +332,8 @@ class EasyLoading {
Duration? duration,
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) {
Widget w = _instance.successWidget ??
Icon(
Expand All @@ -320,6 +347,8 @@ class EasyLoading {
maskType: maskType,
dismissOnTap: dismissOnTap,
w: w,
maskPadding: maskPadding,
maskUseSafeArea: maskUseSafeArea,
);
}

Expand All @@ -329,6 +358,8 @@ class EasyLoading {
Duration? duration,
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) {
Widget w = _instance.errorWidget ??
Icon(
Expand All @@ -342,6 +373,8 @@ class EasyLoading {
maskType: maskType,
dismissOnTap: dismissOnTap,
w: w,
maskPadding: maskPadding,
maskUseSafeArea: maskUseSafeArea,
);
}

Expand All @@ -351,6 +384,8 @@ class EasyLoading {
Duration? duration,
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) {
Widget w = _instance.infoWidget ??
Icon(
Expand All @@ -364,6 +399,8 @@ class EasyLoading {
maskType: maskType,
dismissOnTap: dismissOnTap,
w: w,
maskPadding: maskPadding,
maskUseSafeArea: maskUseSafeArea,
);
}

Expand Down Expand Up @@ -420,6 +457,8 @@ class EasyLoading {
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EasyLoadingToastPosition? toastPosition,
EdgeInsets? maskPadding,
bool? maskUseSafeArea,
}) async {
assert(
overlayEntry != null,
Expand Down Expand Up @@ -471,7 +510,11 @@ class EasyLoading {
toastPosition: toastPosition,
maskType: maskType,
dismissOnTap: dismissOnTap,
sigmaX: sigmaX,
sigmaY: sigmaY,
completer: completer,
padding: maskPadding ?? this.maskPadding,
useSafeArea: maskUseSafeArea ?? this.maskUseSafeArea ?? false,
);
completer.future.whenComplete(() {
_callback(EasyLoadingStatus.show);
Expand Down
Loading