Skip to content

Commit

Permalink
resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahimhass committed Apr 30, 2024
2 parents 72d664d + 5a721b9 commit bd3adf8
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 240 deletions.
53 changes: 53 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,68 @@
PODS:
- DKImagePickerController/Core (4.3.8):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.8)
- DKImagePickerController/PhotoGallery (4.3.8):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.8)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.17):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.17):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- SDWebImage (5.19.1):
- SDWebImage/Core (= 5.19.1)
- SDWebImage/Core (5.19.1)
- SwiftyGif (5.4.5)

DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)

SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- SDWebImage
- SwiftyGif

EXTERNAL SOURCES:
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter

SPEC CHECKSUMS:
DKImagePickerController: a7836546cfdfe014171694f643a7d575bc8ace7f
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4

PODFILE CHECKSUM: 60d9d7ad3a326c175d3a1d4032b5028bf5e01126

Expand Down
18 changes: 18 additions & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
7696D6052C602E6D37A272DE /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -235,6 +236,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
7696D6052C602E6D37A272DE /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down
10 changes: 10 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,16 @@ class _HomePageState extends State<HomePage> {
print(date);
},
),
const SizedBox(
height: 20,
),
// TUIFilePicker(),
TUIFilePicker(
title: "Pick file",
filesPicked: (files) {
print(files);
},
),
const SizedBox(height: 100),
],
),
Expand Down
73 changes: 67 additions & 6 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.18.0"
cross_file:
dependency: transitive
description:
name: cross_file
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
url: "https://pub.dev"
source: hosted
version: "0.3.4+1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.dev"
source: hosted
version: "1.0.6"
version: "1.0.8"
fake_async:
dependency: transitive
description:
Expand All @@ -57,14 +65,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
file_picker:
dependency: transitive
description:
name: file_picker
sha256: "45c70b43df893027e441a6fa0aacc8f484fb9f9c60c746dc8f1dc4f774cf55cd"
url: "https://pub.dev"
source: hosted
version: "8.0.2"
fluentui_system_icons:
dependency: "direct main"
description:
name: fluentui_system_icons
sha256: bb2dd7b5dc2c14c8a18cab6405a67c4697825d2662553b1b22d1f7ddc1057235
sha256: "9bb6c46ff0351f0b20a79bbe5afcaf533af5f06fd8ac22407b57eaee8025004c"
url: "https://pub.dev"
source: hosted
version: "1.1.229"
version: "1.1.236"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -83,11 +107,24 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f"
url: "https://pub.dev"
source: hosted
version: "2.0.19"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -160,6 +197,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -236,6 +281,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "13.0.0"
web:
dependency: transitive
description:
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
win32:
dependency: transitive
description:
name: win32
sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a"
url: "https://pub.dev"
source: hosted
version: "5.4.0"
sdks:
dart: ">=3.2.0-0 <4.0.0"
flutter: ">=3.10.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.0"
66 changes: 66 additions & 0 deletions lib/components/file_picker/file_picker.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:tarka_ui/components/button/button.dart';
import 'package:tarka_ui/components/button/style.dart';

class TUIFilePicker extends StatelessWidget {
final bool allowMultipleFiles;
final String title;
final AllowedFileType allowedFileType;
final List<String>? allowedFileExtensions;
final Function(List<PlatformFile>?) filesPicked;

const TUIFilePicker({
super.key,
required this.title,
this.allowMultipleFiles = false,
this.allowedFileType = AllowedFileType.any,
this.allowedFileExtensions,
required this.filesPicked,
});

@override
Widget build(BuildContext context) {
return TUIButton(
label: title,
type: TUIButtonType.primary,
onPressed: () {
openFiles();
});
}

Future<void> openFiles() async {
List<String> allowedFileExtensions = this.allowedFileExtensions ?? [];

FilePickerResult? resultFile = await FilePicker.platform.pickFiles(
type: allowedFileType.getFileType(),
allowedExtensions: allowedFileExtensions,
allowMultiple: allowMultipleFiles);

if (resultFile != null) {
List<PlatformFile> pickedFiles = resultFile.files;
filesPicked(pickedFiles);
}
}
}

enum AllowedFileType { any, media, image, video, audio, custom }

extension AllowedFileTypeExtension on AllowedFileType {
FileType getFileType() {
switch (this) {
case AllowedFileType.any:
return FileType.any;
case AllowedFileType.media:
return FileType.media;
case AllowedFileType.image:
return FileType.image;
case AllowedFileType.video:
return FileType.video;
case AllowedFileType.audio:
return FileType.audio;
case AllowedFileType.custom:
return FileType.custom;
}
}
}
1 change: 1 addition & 0 deletions lib/tarka_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export 'package:tarka_ui/components/divider/divider.dart';
export 'package:tarka_ui/components/draggable_card/draggable_card.dart';
export 'package:tarka_ui/components/email_field/email_field.dart';
export 'package:tarka_ui/components/email_subject_field/email_subject_field.dart';
export 'package:tarka_ui/components/file_picker/file_picker.dart';
export 'package:tarka_ui/components/floating_action_button/floating_action_button.dart';
export 'package:tarka_ui/components/media_thumbnail/media_thumbnail.dart';
export 'package:tarka_ui/components/menu_item/menu_item.dart';
Expand Down
Loading

0 comments on commit bd3adf8

Please sign in to comment.