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

FEAT: Responsive toast #25

Merged
merged 2 commits into from
Jul 21, 2022
Merged
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
18 changes: 17 additions & 1 deletion lib/pages/HomePage/functions/show_result_toast.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Flutter Packages
import 'package:flutter/material.dart';

// Dart Packages
import 'dart:math';

// Third Party Packages
import 'package:motion_toast/motion_toast.dart';

Expand All @@ -20,8 +23,21 @@ void showResultToast({
style: const TextStyle(color: Colors.black),
);

final width = MediaQuery.of(context).size.width;
final minWidth = min(width - 20, 320.00);
final maxWidth = max(minWidth, width * 0.8);
toastType(result.status)
.call(title: title, description: description)
.call(
title: title,
description: description,
width: null,
height: null,
constraints: BoxConstraints(
minWidth: minWidth,
maxWidth: maxWidth,
maxHeight: 90,
),
)
.show(context);
}

Expand Down
42 changes: 21 additions & 21 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
version: "3.3.1"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -98,21 +98,21 @@ packages:
name: cloud_firestore
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
version: "3.4.0"
cloud_firestore_platform_interface:
dependency: transitive
description:
name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "5.6.0"
version: "5.7.0"
cloud_firestore_web:
dependency: transitive
description:
name: cloud_firestore_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.0"
version: "2.8.0"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -175,7 +175,7 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "2.0.1"
file:
dependency: transitive
description:
Expand All @@ -189,63 +189,63 @@ packages:
name: firebase_auth
url: "https://pub.dartlang.org"
source: hosted
version: "3.4.2"
version: "3.5.0"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.3.2"
version: "6.4.0"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
version: "4.1.0"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.19.2"
version: "1.20.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.3"
version: "4.5.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.7.1"
firebase_storage:
dependency: "direct main"
description:
name: firebase_storage
url: "https://pub.dartlang.org"
source: hosted
version: "10.3.2"
version: "10.3.3"
firebase_storage_platform_interface:
dependency: transitive
description:
name: firebase_storage_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.11"
version: "4.1.12"
firebase_storage_web:
dependency: transitive
description:
name: firebase_storage_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
version: "3.3.1"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -463,7 +463,7 @@ packages:
name: motion_toast
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.3"
version: "2.3.0"
nested:
dependency: transitive
description:
Expand All @@ -484,7 +484,7 @@ packages:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
version: "1.4.3"
package_info_plus_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -519,7 +519,7 @@ packages:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.0.0"
paginate_firestore:
dependency: "direct main"
description:
Expand Down Expand Up @@ -596,7 +596,7 @@ packages:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.1.0"
pedantic:
dependency: transitive
description:
Expand Down Expand Up @@ -811,7 +811,7 @@ packages:
name: video_player_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.7"
version: "2.3.8"
video_player_avfoundation:
dependency: transitive
description:
Expand All @@ -832,7 +832,7 @@ packages:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
version: "2.0.11"
wakelock:
dependency: transitive
description:
Expand Down Expand Up @@ -874,7 +874,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.7.0"
xdg_directories:
dependency: transitive
description:
Expand Down