Skip to content

Commit

Permalink
Dart fixes (deprecated methods and classes).
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham16g committed May 19, 2024
1 parent fe5d449 commit 467086e
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 39 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.2
- Fixed deprecated methods and classes.

## 1.0.1
- Added support for network image at `ImageFile` class for initial selected images.
- Fixed error icon for `DefaultDraggableItemWidget`, Added file type based icon.
Expand Down
4 changes: 2 additions & 2 deletions example/lib/custom/files_custom_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _FilesCustomExampleState extends State<FilesCustomExample> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color.lerp(fileColor(imageFile.extension),
Theme.of(context).colorScheme.background, 0.85),
Theme.of(context).colorScheme.surface, 0.85),
),
alignment: Alignment.center,
padding: const EdgeInsets.only(top: 16),
Expand Down Expand Up @@ -83,7 +83,7 @@ class _FilesCustomExampleState extends State<FilesCustomExample> {
child: Icon(
Icons.close,
size: 18,
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
)),
)),
],
Expand Down
2 changes: 1 addition & 1 deletion example/lib/custom/full_custom_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _FullCustomExampleState extends State<FullCustomExample> {
child: Icon(
Icons.delete_forever_rounded,
size: 18,
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
)),
)),
],
Expand Down
5 changes: 2 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ void main() {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
elevation: MaterialStateProperty.all(0),
backgroundColor:
MaterialStateProperty.all(Colors.purple.shade50)),
elevation: WidgetStateProperty.all(0),
backgroundColor: WidgetStateProperty.all(Colors.purple.shade50)),
)),
home: const DemoPage(),
));
Expand Down
70 changes: 47 additions & 23 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -248,6 +248,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
dependency: transitive
description:
Expand All @@ -260,26 +284,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.12.0"
mime:
dependency: transitive
description:
Expand All @@ -294,15 +318,15 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.2"
path:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -328,18 +352,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand All @@ -360,10 +384,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.7.0"
typed_data:
dependency: transitive
description:
Expand All @@ -380,14 +404,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "14.2.1"
win32:
dependency: transitive
description:
Expand All @@ -397,5 +421,5 @@ packages:
source: hosted
version: "5.0.3"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
3 changes: 2 additions & 1 deletion lib/src/image_file_view/io_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class ImageFileView extends StatelessWidget {
return Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: backgroundColor ?? Theme.of(context).colorScheme.surfaceVariant,
color: backgroundColor ??
Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: borderRadius ?? BorderRadius.zero,
),
child: Uri.tryParse(imageFile.path!)?.scheme.startsWith('http') == true
Expand Down
3 changes: 2 additions & 1 deletion lib/src/image_file_view/web_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class ImageFileView extends StatelessWidget {
return Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: backgroundColor ?? Theme.of(context).colorScheme.surfaceVariant,
color: backgroundColor ??
Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: borderRadius ?? BorderRadius.zero,
),
child: imageFile.path == null
Expand Down
5 changes: 1 addition & 4 deletions lib/src/widgets/default_draggable_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import 'package:flutter/material.dart';
import 'package:multi_image_picker_view/multi_image_picker_view.dart';
import 'package:multi_image_picker_view/src/multi_image_picker_controller_wrapper.dart';

import '../image_file.dart';
import '../image_file_view/image_file_view.dart';

class DefaultDraggableItemWidget extends StatelessWidget {
const DefaultDraggableItemWidget({
super.key,
Expand Down Expand Up @@ -61,7 +58,7 @@ class DefaultDraggableItemWidget extends StatelessWidget {
BoxDecoration(
color: Theme.of(context)
.colorScheme
.surfaceVariant
.surfaceContainerHighest
.withOpacity(0.5),
shape: BoxShape.circle,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/default_initial_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class DefaultInitialWidget extends StatelessWidget {
child: Material(
color: Colors.transparent,
child: InkWell(
overlayColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.pressed)) {
overlayColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.pressed)) {
return Theme.of(context).colorScheme.primary.withOpacity(0.15);
}
return Theme.of(context).colorScheme.primary.withOpacity(0.07);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/draggable_item_ink_well.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DraggableItemInkWell extends StatelessWidget {
final Color? hoverColor;
final Color? highlightColor;
final Color? focusColor;
final MaterialStateProperty<Color?>? overlayColor;
final WidgetStateProperty<Color?>? overlayColor;
final Color? splashColor;
final InteractiveInkFeatureFactory? splashFactory;

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: multi_image_picker_view
description: A complete widget which can easily pick multiple images from device and display them in UI. Also picked image can be re-ordered and removed easily.
version: 1.0.1
version: 1.0.2
homepage: https://github.com/shubham-gupta-16/multi_image_picker_view
repository: https://github.com/shubham-gupta-16/multi_image_picker_view
issue_tracker: https://github.com/shubham-gupta-16/multi_image_picker_view/issues
Expand Down

0 comments on commit 467086e

Please sign in to comment.