TF-4075 Change attachments location
(cherry picked from commit ab23dac45d9dcf7c5e057f8e16974b3ed8205771)
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M19.4642 8.5H60.5267C66.5846 8.50003 71.4955 13.4109 71.4955 19.4688V60.5312C71.4955 66.5891 66.5846 71.5 60.5267 71.5H19.4642C13.4064 71.5 8.49551 66.5891 8.49548 60.5312V19.4688C8.49551 13.4109 13.4064 8.50003 19.4642 8.5Z" fill="#FFFDF4" stroke="#F4D221"/>
|
||||||
|
<path d="M49.5352 28.0847C50.4498 27.8027 51.9881 28.2397 51.9992 29.1715V45.2739C51.9997 45.2963 52 45.3187 52 45.3411C52 47.1799 50.2091 48.6706 48 48.6706C45.7909 48.6706 44 47.1799 44 45.3411C44 43.5023 45.7909 42.0117 48 42.0117C48.5106 42.0117 48.9988 42.0913 49.4478 42.2365L49.5065 32.7308L36 36.2452V48.6706C36 50.5094 34.2091 52 32 52C29.7909 52 28 50.5094 28 48.6706C28 46.8318 29.7909 45.3411 32 45.3411C32.5033 45.3411 32.9849 45.4185 33.4286 45.5597V33.4106H33.4336C33.399 32.7704 33.8276 32.1719 34.4909 31.9993L49.5352 28.0847Z" fill="#F7D107"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 934 B |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M19.4644 8.5H60.5269C66.5847 8.50003 71.4956 13.4109 71.4956 19.4688V60.5312C71.4956 66.5891 66.5847 71.5 60.5269 71.5H19.4644C13.4065 71.5 8.49563 66.5891 8.49561 60.5312V19.4688C8.49564 13.4109 13.4065 8.50003 19.4644 8.5Z" stroke="#333333"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M42.5825 30.5874C42.7682 30.4012 42.9889 30.2535 43.2318 30.1527C43.4747 30.0519 43.7351 30 43.9981 30C44.2611 30 44.5215 30.0519 44.7644 30.1527C45.0073 30.2535 45.2279 30.4012 45.4137 30.5874L53.4112 38.585C53.5974 38.7707 53.7451 38.9913 53.8459 39.2342C53.9467 39.4771 53.9986 39.7375 53.9986 40.0005C53.9986 40.2635 53.9467 40.5239 53.8459 40.7668C53.7451 41.0097 53.5974 41.2304 53.4112 41.4161L45.4137 49.4137C45.0382 49.7891 44.529 50 43.9981 50C43.4671 50 42.958 49.7891 42.5825 49.4137C42.2071 49.0382 41.9962 48.529 41.9962 47.9981C41.9962 47.4671 42.2071 46.9579 42.5825 46.5825L49.1685 40.0005L42.5825 33.4185C42.3963 33.2328 42.2486 33.0122 42.1478 32.7693C42.047 32.5264 41.9951 32.266 41.9951 32.003C41.9951 31.74 42.047 31.4796 42.1478 31.2367C42.2486 30.9938 42.3963 30.7731 42.5825 30.5874ZM37.4161 30.5874C37.2304 30.4012 37.0097 30.2535 36.7668 30.1527C36.5239 30.0519 36.2635 30 36.0005 30C35.7375 30 35.4771 30.0519 35.2342 30.1527C34.9913 30.2535 34.7707 30.4012 34.585 30.5874L26.5874 38.585C26.4012 38.7707 26.2535 38.9913 26.1527 39.2342C26.0519 39.4771 26 39.7375 26 40.0005C26 40.2635 26.0519 40.5239 26.1527 40.7668C26.2535 41.0097 26.4012 41.2304 26.5874 41.4161L34.585 49.4137C34.9604 49.7891 35.4696 50 36.0005 50C36.5315 50 37.0407 49.7891 37.4161 49.4137C37.7915 49.0382 38.0024 48.529 38.0024 47.9981C38.0024 47.4671 37.7915 46.9579 37.4161 46.5825L30.8301 40.0005L37.4161 33.4185C37.6023 33.2328 37.75 33.0122 37.8508 32.7693C37.9516 32.5264 38.0035 32.266 38.0035 32.003C38.0035 31.74 37.9516 31.4796 37.8508 31.2367C37.75 30.9938 37.6023 30.7731 37.4161 30.5874Z" fill="#333333"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,10 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M23.7998 8.5H47.5928L68.0996 29.0068V59.2002C68.0995 65.9932 62.5928 71.5 55.7998 71.5H23.7998C17.0069 71.4999 11.5001 65.9931 11.5 59.2002V20.7998C11.5001 14.0069 17.0069 8.50011 23.7998 8.5Z" fill="url(#paint0_linear_7058_11218)" stroke="#DEE8ED"/>
|
||||||
|
<path d="M68.6 29.6L47 8V19.1724C47 24.9314 51.513 29.6 57.08 29.6H68.6Z" fill="#E7EFF3"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_7058_11218" x1="32" y1="43" x2="-9" y2="-15" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#F9FCFD"/>
|
||||||
|
<stop offset="1" stop-color="#E8F5FD"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 667 B |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M23.9998 8.5H47.7927L68.2996 29.0068V59.2002C68.2995 65.9932 62.7928 71.5 55.9998 71.5H23.9998C17.2068 71.4999 11.7001 65.9931 11.7 59.2002V20.7998C11.7001 14.113 17.0361 8.67235 23.6824 8.50391L23.9998 8.5Z" fill="#F2F8FF" stroke="#006BE0"/>
|
||||||
|
<path d="M68.8 29.6L47.2 8V19.1724C47.2 24.9314 51.7129 29.6 57.28 29.6H68.8Z" fill="#006BE0"/>
|
||||||
|
<path d="M33.3257 41.6007H29.6L33.4943 59.1978H37.3149L39.8456 48.952L42.276 59.2001H45.8687L50.4 41.6001H44.1032V44.5308H46.2494L44.0724 52.9464L41.8228 41.6001H38.2225L35.4287 53.1088L33.3257 41.6007Z" fill="#006BE0"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 672 B |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#74B5E3"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66883 34.1 7.15V0ZM12.925 13.7506H16.176L18.0111 24.5448L20.449 13.75H23.5906L25.5535 24.3925L27.4532 16.4989H25.5805V13.75H31.075L27.121 30.2583H23.986L21.8652 20.6459L19.657 30.2561H16.3232L12.925 13.7506Z" fill="#3955B8"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 651 B |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#818C99" fill-opacity="0.12"/>
|
|
||||||
<path d="M24.4808 12.0965C24.7777 12.1649 25.0405 12.2738 25.2989 12.4354C25.5573 12.597 25.7666 12.7666 26.3144 13.3144L29.6856 16.6856C30.2334 17.2334 30.403 17.4427 30.5646 17.7011C30.7262 17.9595 30.8351 18.2223 30.9035 18.5192C30.972 18.8162 31 19.0842 31 19.8588V27.1542C31 28.4915 30.8608 28.9764 30.5993 29.4653C30.3378 29.9542 29.9542 30.3378 29.4653 30.5993C28.9764 30.8608 28.4915 31 27.1542 31H17.8458C16.5085 31 16.0236 30.8608 15.5347 30.5993C15.0458 30.3378 14.6622 29.9542 14.4007 29.4653C14.1392 28.9764 14 28.4915 14 27.1542V15.8458C14 14.5085 14.1392 14.0236 14.4007 13.5347C14.6622 13.0458 15.0458 12.6622 15.5347 12.4007C16.0236 12.1392 16.5085 12 17.8458 12H23.1412C23.9158 12 24.1838 12.028 24.4808 12.0965ZM23.8 13.9243C23.6343 13.9243 23.5 14.0586 23.5 14.2243V18C23.5 18.2762 23.7239 18.5 24 18.5H27.7757C27.8553 18.5 27.9316 18.4684 27.9879 18.4122C28.105 18.295 28.105 18.105 27.9879 17.9879L24.0121 14.0121C23.9559 13.9559 23.8796 13.9243 23.8 13.9243Z" fill="#99A2AD"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M24.174 8.5H47.9669L68.4738 29.0068V59.2002C68.4736 65.9932 62.967 71.5 56.174 71.5H24.174C17.381 71.4999 11.8743 65.9931 11.8741 59.2002V20.7998C11.8742 14.113 17.2103 8.67235 23.8566 8.50391L24.174 8.5Z" fill="#F5FDF7" stroke="#26A44D"/>
|
||||||
|
<path d="M68.9741 29.6L47.3741 8V19.1724C47.3741 24.9314 51.8871 29.6 57.4541 29.6H68.9741Z" fill="#26A44D"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.5179 41.6001H36.7992L40.0211 46.5539L43.3194 41.6195H48.5256L42.3669 49.9611L48.7999 59.1816H44.0031L39.9674 53.4081L37.6594 56.8473L39.9988 56.8502V59.2001H31.2L37.5996 50.0148L31.5179 41.6001Z" fill="#26A44D"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 728 B |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20.7954 8.5H59.1958C65.9887 8.50011 71.4955 14.0069 71.4956 20.7998V59.2002C71.4955 65.9931 65.9887 71.4999 59.1958 71.5H20.7954C14.0025 71.4999 8.49571 65.9931 8.49561 59.2002V20.7998C8.49571 14.0069 14.0025 8.50011 20.7954 8.5Z" fill="#F6FEFF" stroke="#0FCAD6"/>
|
||||||
|
<path d="M47.5719 34.3729C49.2138 34.3729 50.5463 33.0675 50.5463 31.4577C50.5463 29.8482 49.2142 28.5425 47.5719 28.5425C45.93 28.5425 44.5979 29.8479 44.5979 31.4577C44.5979 33.0704 45.94 34.3729 47.5745 34.3729H47.5719ZM57.5447 49.3749L46.3412 39.6179C45.7513 38.9414 45.2187 39.1416 44.5979 39.8672L41.865 42.7679C41.303 43.4053 40.4824 43.607 40.0437 43.0872L34.2102 35.3694C33.5764 34.7305 32.7585 34.8745 32.3907 35.6902L22.2727 49.7533C21.9049 50.572 22.3469 51.4651 23.2385 51.4576L56.9515 51.4453C57.8787 51.4513 58.1305 50.0372 57.5362 49.3749H57.5447Z" fill="#0FCAD6"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 960 B |
@@ -0,0 +1,15 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M24.1735 8.5H47.9664L68.4733 29.0068V59.2002C68.4732 65.9932 62.9665 71.5 56.1735 71.5H24.1735C17.3805 71.4999 11.8738 65.9931 11.8737 59.2002V20.7998C11.8738 14.113 17.2098 8.67235 23.8561 8.50391L24.1735 8.5Z" fill="#FDF5F5" stroke="#E50000"/>
|
||||||
|
<rect x="26" y="48" width="23" height="3" rx="1.5" fill="#E50000"/>
|
||||||
|
<rect x="23" y="55" width="30" height="3" rx="1.5" fill="#E50000"/>
|
||||||
|
<g clip-path="url(#clip0_7058_11193)">
|
||||||
|
<path d="M40.0309 37.7609C39.4638 38.1762 38.7646 38.4217 38.0079 38.4217C36.1138 38.4217 34.5783 36.8862 34.5783 34.9921C34.5783 33.2773 35.8368 31.8566 37.4805 31.6029V26C32.7541 26.2735 29 30.1976 29 34.9921C29 39.9637 33.0363 44 38.0079 44C40.3038 44 42.4 43.1387 43.9922 41.7222L40.0309 37.7609Z" fill="#E50000"/>
|
||||||
|
<path d="M41.3971 35.5194C41.3117 36.0729 41.0938 36.5826 40.777 37.0154L44.738 40.9764C46.0453 39.507 46.8792 37.6082 47 35.5194H41.3971ZM38.5353 31.6029C40.0071 31.83 41.17 32.9929 41.3972 34.4648H44.1986H47C46.7367 29.9128 43.0872 26.2634 38.5353 26V31.6029Z" fill="#E50000"/>
|
||||||
|
</g>
|
||||||
|
<path d="M68.9737 29.6L47.3737 8V19.1724C47.3737 24.9314 51.8866 29.6 57.4537 29.6H68.9737Z" fill="#E50000"/>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_7058_11193">
|
||||||
|
<rect width="18" height="18" fill="white" transform="translate(29 26)"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M24.174 8.5H47.9669L68.4738 29.0068V59.2002C68.4736 65.9932 62.967 71.5 56.174 71.5H24.174C17.381 71.4999 11.8743 65.9931 11.8741 59.2002V20.7998C11.8742 14.113 17.2103 8.67235 23.8566 8.50391L24.174 8.5Z" fill="#F5FDF7" stroke="#26A44D"/>
|
||||||
|
<path d="M68.9741 29.6L47.3741 8V19.1724C47.3741 24.9314 51.8871 29.6 57.4541 29.6H68.9741Z" fill="#26A44D"/>
|
||||||
|
<rect width="12" height="7" transform="translate(23 34)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(37 34)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(46 34)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(46 43)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(37 43)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(37 52)" fill="#26A44D"/>
|
||||||
|
<rect width="7" height="7" transform="translate(46 52)" fill="#26A44D"/>
|
||||||
|
<rect width="12" height="7" transform="translate(23 43)" fill="#26A44D"/>
|
||||||
|
<rect width="12" height="7" transform="translate(23 52)" fill="#26A44D"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,8 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M24.1735 8.5H47.9664L68.4733 29.0068V59.2002C68.4732 65.9932 62.9665 71.5 56.1735 71.5H24.1735C17.3805 71.4999 11.8738 65.9931 11.8737 59.2002V20.7998C11.8738 14.113 17.2098 8.67235 23.8561 8.50391L24.1735 8.5Z" fill="#F2F8FF" stroke="#006BE0"/>
|
||||||
|
<rect x="23" y="41" width="14" height="3" rx="1.5" fill="#006BE0"/>
|
||||||
|
<rect x="23" y="51" width="30" height="3" rx="1.5" fill="#006BE0"/>
|
||||||
|
<rect x="23" y="59" width="30" height="3" rx="1.5" fill="#006BE0"/>
|
||||||
|
<path d="M68.9737 29.6L47.3737 8V19.1724C47.3737 24.9314 51.8866 29.6 57.4537 29.6H68.9737Z" fill="#006BE0"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M45.273 38.4286C45.273 39.2143 44.6304 39.8571 43.845 39.8571C43.0596 39.8571 42.4169 39.2143 42.4169 38.4286C42.4169 37.6429 43.0596 37 43.845 37C44.6304 37 45.273 37.6429 45.273 38.4286ZM45.7014 43.4643L48.1933 39.4714C48.4861 39.0071 49.1644 39.0286 49.4286 39.5071L52.9129 45.9428C53.17 46.4214 52.8273 47 52.2846 47H39.7108C39.5861 47.0007 39.4633 46.9683 39.3551 46.9062C39.2469 46.8441 39.157 46.7545 39.0947 46.6464C39.0323 46.5383 38.9996 46.4156 39 46.2907C39.0004 46.1659 39.0338 46.0434 39.0968 45.9357L41.2959 42.0214C41.3467 41.9308 41.4166 41.8523 41.5008 41.7914C41.585 41.7306 41.6814 41.6889 41.7834 41.6691C41.8854 41.6494 41.9904 41.6522 42.0912 41.6773C42.192 41.7023 42.2861 41.7491 42.367 41.8143L44.6518 43.6429C44.9803 43.9071 45.4729 43.8286 45.7014 43.4643Z" fill="#006BE0"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,7 +1,7 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#D52E26"/>
|
<path d="M24.1747 8.5H47.9677L68.4745 29.0068V59.2002C68.4744 65.9932 62.9677 71.5 56.1747 71.5H24.1747C17.3817 71.4999 11.875 65.9931 11.8749 59.2002V20.7998C11.875 14.113 17.211 8.67235 23.8573 8.50391L24.1747 8.5Z" fill="#FDF5F4" stroke="#D52E26"/>
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66882 34.1 7.15V0Z" fill="#9D0700"/>
|
<path d="M68.9749 29.6L47.3749 8V19.1724C47.3749 24.9314 51.8878 29.6 57.4549 29.6H68.9749Z" fill="#D52E26"/>
|
||||||
<path d="M10.7642 26.3996V17.5996H14.5626C15.2158 17.5996 15.7873 17.7285 16.2771 17.9863C16.7669 18.2441 17.1479 18.6065 17.4201 19.0734C17.6922 19.5404 17.8283 20.0861 17.8283 20.7105C17.8283 21.3408 17.6879 21.8865 17.4072 22.3477C17.1293 22.8089 16.7383 23.1641 16.2341 23.4133C15.7328 23.6625 15.147 23.7871 14.4767 23.7871H12.208V21.9309H13.9955C14.2762 21.9309 14.5154 21.8822 14.713 21.7848C14.9136 21.6845 15.0668 21.5427 15.1728 21.3594C15.2817 21.176 15.3361 20.9598 15.3361 20.7105C15.3361 20.4585 15.2817 20.2436 15.1728 20.066C15.0668 19.8855 14.9136 19.748 14.713 19.6535C14.5154 19.5561 14.2762 19.5074 13.9955 19.5074H13.1533V26.3996H10.7642Z" fill="white"/>
|
<path d="M22.4008 59.1998V44.7998H28.3456C29.3677 44.7998 30.2621 45.0107 31.0288 45.4326C31.7954 45.8545 32.3917 46.4475 32.8176 47.2115C33.2435 47.9756 33.4565 48.8686 33.4565 49.8904C33.4565 50.9217 33.2368 51.8146 32.7974 52.5693C32.3626 53.324 31.7506 53.9053 30.9615 54.3131C30.177 54.7209 29.2601 54.9248 28.2111 54.9248H24.6603V51.8873H27.4579C27.8972 51.8873 28.2716 51.8076 28.5809 51.6482C28.8948 51.4842 29.1346 51.2521 29.3005 50.9521C29.4709 50.6521 29.556 50.2982 29.556 49.8904C29.556 49.4779 29.4709 49.1264 29.3005 48.8357C29.1346 48.5404 28.8948 48.3154 28.5809 48.1607C28.2716 48.0014 27.8972 47.9217 27.4579 47.9217H26.1398V59.1998H22.4008Z" fill="#D52E26"/>
|
||||||
<path d="M22.0908 26.3996H18.7048V17.5996H22.0564C22.9616 17.5996 23.7436 17.7758 24.4025 18.1281C25.0642 18.4776 25.5741 18.9818 25.9322 19.6406C26.2931 20.2966 26.4736 21.0829 26.4736 21.9996C26.4736 22.9163 26.2945 23.704 25.9365 24.3629C25.5784 25.0189 25.0714 25.523 24.4154 25.8754C23.7594 26.2249 22.9845 26.3996 22.0908 26.3996ZM21.0939 24.3715H22.0048C22.4402 24.3715 22.8112 24.3013 23.1177 24.1609C23.4271 24.0206 23.662 23.7785 23.8224 23.4348C23.9857 23.091 24.0673 22.6126 24.0673 21.9996C24.0673 21.3866 23.9843 20.9082 23.8181 20.5645C23.6548 20.2207 23.4142 19.9786 23.0962 19.8383C22.7811 19.6979 22.3944 19.6277 21.9361 19.6277H21.0939V24.3715Z" fill="white"/>
|
<path d="M40.1276 59.1998H34.8283V44.7998H40.0738C41.4905 44.7998 42.7144 45.0881 43.7455 45.6646C44.7812 46.2365 45.5792 47.0615 46.1396 48.1396C46.7045 49.2131 46.9869 50.4998 46.9869 51.9998C46.9869 53.4998 46.7067 54.7889 46.1463 55.867C45.5859 56.9404 44.7924 57.7654 43.7657 58.342C42.7391 58.9139 41.5263 59.1998 40.1276 59.1998ZM38.5674 55.8811H39.9931C40.6745 55.8811 41.2551 55.7662 41.7348 55.5365C42.219 55.3068 42.5866 54.9107 42.8377 54.3482C43.0932 53.7857 43.221 53.0029 43.221 51.9998C43.221 50.9967 43.091 50.2139 42.831 49.6514C42.5754 49.0889 42.1988 48.6928 41.7012 48.4631C41.208 48.2334 40.6028 48.1186 39.8855 48.1186H38.5674V55.8811Z" fill="#D52E26"/>
|
||||||
<path d="M27.579 26.3996V17.5996H33.7665V19.5246H29.968V21.0371H33.3883V22.9621H29.968V26.3996H27.579Z" fill="white"/>
|
<path d="M48.7169 59.1998V44.7998H58.4008V47.9498H52.456V50.4248H57.809V53.5748H52.456V59.1998H48.7169Z" fill="#D52E26"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#E7DEFF"/>
|
|
||||||
<path d="M31.898 18.4249C33.1135 18.4249 34.1 17.4602 34.1 16.2706C34.1 15.0812 33.1138 14.1162 31.898 14.1162C30.6825 14.1162 29.6964 15.0809 29.6964 16.2706C29.6964 17.4624 30.69 18.4249 31.9 18.4249H31.898ZM34.9863 28.4129L26.6923 21.2024C26.2556 20.7025 25.8612 20.8504 25.4017 21.3867L23.3785 23.5303C22.9625 24.0014 22.355 24.1504 22.0302 23.7662L17.7116 18.0627C17.2425 17.5906 16.6369 17.697 16.3647 18.2998L8.87422 28.6926C8.60197 29.2976 8.92922 29.9576 9.58922 29.9521L34.5471 29.943C35.2335 29.9474 35.42 28.9024 34.98 28.4129H34.9863Z" fill="#8400EC"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 880 B |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M24.1735 8.5H47.9664L68.4733 29.0068V59.2002C68.4732 65.9932 62.9665 71.5 56.1735 71.5H24.1735C17.3805 71.4999 11.8738 65.9931 11.8737 59.2002V20.7998C11.8738 14.113 17.2098 8.67235 23.8561 8.50391L24.1735 8.5Z" fill="#FDFAF5" stroke="#E56E00"/>
|
||||||
|
<path d="M68.9737 29.6L47.3737 8V19.1724C47.3737 24.9314 51.8866 29.6 57.4537 29.6H68.9737Z" fill="#E56E00"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.5996 41.6001V59.2001H36.9444V52.8482H40.9462C43.7501 52.8482 46.0231 50.3302 46.0231 47.2242C46.0231 44.1181 43.7501 41.6001 40.9462 41.6001H33.5996ZM36.9444 50.2016V44.2467H40.2295C41.7139 44.2467 42.9173 45.5798 42.9173 47.2242C42.9173 48.8686 41.7139 50.2016 40.2295 50.2016H36.9444Z" fill="#E66E00"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 826 B |
@@ -1,5 +0,0 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#C8421D"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66882 34.1 7.15V0Z" fill="#A03517"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 12V33H18.3077V25.4211H23.4615C27.0726 25.4211 30 22.4166 30 18.7105C30 15.0044 27.0726 12 23.4615 12H14ZM18.3077 22.2632V15.1579H22.5385C24.4502 15.1579 26 16.7485 26 18.7105C26 20.6726 24.4502 22.2632 22.5385 22.2632H18.3077Z" fill="white"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 758 B |
@@ -0,0 +1,7 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M23.9998 8.5H47.7927L68.2996 29.0068V59.2002C68.2995 65.9932 62.7928 71.5 55.9998 71.5H23.9998C17.2068 71.4999 11.7001 65.9931 11.7 59.2002V20.7998C11.7001 14.0069 17.2068 8.50011 23.9998 8.5Z" fill="#F2F9FF" stroke="#2997FF"/>
|
||||||
|
<path d="M68.8 29.6L47.2 8V19.1724C47.2 24.9314 51.7129 29.6 57.28 29.6H68.8Z" fill="#2997FF"/>
|
||||||
|
<rect x="25" y="36" width="23" height="3" rx="1.5" fill="#2997FF"/>
|
||||||
|
<rect x="25" y="46" width="30" height="3" rx="1.5" fill="#2997FF"/>
|
||||||
|
<rect x="25" y="56" width="30" height="3" rx="1.5" fill="#2997FF"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 640 B |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M19.4642 8.5H60.5267C66.5846 8.50003 71.4955 13.4109 71.4955 19.4688V60.5312C71.4955 66.5891 66.5846 71.5 60.5267 71.5H19.4642C13.4064 71.5 8.49551 66.5891 8.49548 60.5312V19.4688C8.49551 13.4109 13.4064 8.50003 19.4642 8.5Z" fill="#FFF2F8" stroke="#FD2882"/>
|
||||||
|
<path d="M40.9085 30.2778C42.7659 30.2778 43.4394 30.4712 44.1184 30.8344C44.7974 31.1975 45.3303 31.7304 45.6934 32.4094C46.0566 33.0884 46.25 33.7619 46.25 35.6193V44.3808C46.25 46.2382 46.0566 46.9117 45.6934 47.5907C45.3303 48.2697 44.7974 48.8026 44.1184 49.1658C43.4394 49.5289 42.7659 49.7223 40.9085 49.7223H30.7581C28.9007 49.7223 28.2272 49.5289 27.5482 49.1658C26.8692 48.8026 26.3363 48.2697 25.9732 47.5907C25.61 46.9117 25.4166 46.2382 25.4166 44.3808V35.6193C25.4166 33.7619 25.61 33.0884 25.9732 32.4094C26.3363 31.7304 26.8692 31.1975 27.5482 30.8344C28.2272 30.4712 28.9007 30.2778 30.7581 30.2778H40.9085ZM54.3049 34.3013C54.4856 34.5419 54.5833 34.8346 54.5833 35.1354V44.8648C54.5833 45.6318 53.9615 46.2537 53.1944 46.2537C52.8936 46.2537 52.6008 46.156 52.3603 45.9753L49.3051 43.6806C49.1305 43.5495 49.0277 43.3438 49.0277 43.1254V36.8748C49.0277 36.6563 49.1305 36.4507 49.3051 36.3195L52.3603 34.0249C52.9736 33.5642 53.8443 33.688 54.3049 34.3013Z" fill="#FD2882"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#5CBB6C"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66883 34.1 7.15V0ZM14.0415 13.7511H18.997L22.0201 18.3948L25.115 13.7692H30.0001L24.2212 21.5886L30.2575 30.2318H25.7565L21.9698 24.8198L19.8042 28.0437L21.9992 28.0464V30.2492H13.7432L19.7481 21.6389L14.0418 13.7511H14.0415Z" fill="#00660A"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 669 B |
@@ -1,8 +1,8 @@
|
|||||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#F1C569"/>
|
<path d="M23.9998 8.67676H55.9998C62.7928 8.67676 68.2995 14.1836 68.2996 20.9766V59.377C68.2995 66.17 62.7928 71.6768 55.9998 71.6768H23.9998C17.2068 71.6767 11.7001 66.1699 11.7 59.377V20.9766C11.7001 14.1836 17.2068 8.67686 23.9998 8.67676Z" fill="#F9F3FF" stroke="#A033FF"/>
|
||||||
<path d="M21.863 32.0727C23.727 32.0678 25.2494 30.5821 25.3 28.7188L24.4485 21.336C24.3498 20.3762 23.5543 19.6385 22.5898 19.6123H21.1257C20.1821 19.6343 19.3943 20.3385 19.267 21.2737L18.426 28.5423C18.4036 29.4691 18.7555 30.3658 19.4022 31.0301C20.0489 31.6944 20.9359 32.0702 21.863 32.0727ZM20.0354 28.48L20.1185 27.7323C20.1888 26.8238 20.9465 26.1224 21.8578 26.1224C22.769 26.1224 23.5268 26.8238 23.597 27.7323L23.6801 28.48C23.7414 28.9037 23.6128 29.3328 23.3286 29.653C23.0445 29.9732 22.6336 30.1519 22.2056 30.1414H21.5099C21.0725 30.1509 20.6538 29.9643 20.3684 29.6326C20.083 29.301 19.9609 28.8592 20.0354 28.4281V28.48ZM20.8246 22.5405V22.1148C20.8761 21.6173 21.2953 21.2392 21.7955 21.2392C22.2956 21.2392 22.7148 21.6173 22.7663 22.1148L22.8183 22.5405C22.8522 22.778 22.7792 23.0183 22.6188 23.1967C22.4585 23.3751 22.2273 23.4732 21.9876 23.4647H21.6034C21.3727 23.4581 21.1557 23.3534 21.007 23.177C20.8583 23.0005 20.792 22.769 20.8246 22.5405Z" fill="white"/>
|
<path d="M40.4007 60.7999C43.2204 60.7925 45.5235 58.5619 45.6 55.7643L44.3119 44.6797C44.1626 43.2387 42.9593 42.1312 41.5002 42.0918H39.2855C37.8581 42.1248 36.6663 43.1821 36.4738 44.5862L35.2015 55.4993C35.1677 56.8908 35.7 58.2372 36.6783 59.2345C37.6565 60.2319 38.9983 60.7961 40.4007 60.7999ZM37.6362 55.4057L37.7618 54.2832C37.8681 52.9191 39.0143 51.866 40.3929 51.866C41.7714 51.866 42.9176 52.9191 43.0239 54.2832L43.1496 55.4057C43.2423 56.0419 43.0477 56.6862 42.6179 57.167C42.188 57.6477 41.5665 57.9159 40.9191 57.9001H39.8666C39.205 57.9144 38.5715 57.6342 38.1398 57.1364C37.7081 56.6385 37.5233 55.975 37.6362 55.3278V55.4057ZM38.8299 46.4882V45.849C38.9079 45.1021 39.542 44.5345 40.2986 44.5345C41.0552 44.5345 41.6893 45.1021 41.7673 45.849L41.8458 46.4882C41.8972 46.8447 41.7867 47.2055 41.5442 47.4734C41.3016 47.7412 40.9518 47.8886 40.5892 47.8757H40.008C39.6591 47.8659 39.3309 47.7087 39.1059 47.4438C38.881 47.1788 38.7806 46.8312 38.8299 46.4882Z" fill="#A033FF"/>
|
||||||
<path d="M21.4527 11.8252H19.9678C19.5234 11.8252 19.1631 12.1855 19.1631 12.6299C19.1631 13.0744 19.5234 13.4347 19.9678 13.4347H21.4527C21.8971 13.4347 22.2574 13.0744 22.2574 12.6299C22.2574 12.1855 21.8971 11.8252 21.4527 11.8252Z" fill="white"/>
|
<path d="M39.7801 30.3999H37.5339C36.8616 30.3999 36.3166 30.9408 36.3166 31.6081C36.3166 32.2754 36.8616 32.8164 37.5339 32.8164H39.7801C40.4524 32.8164 40.9975 32.2754 40.9975 31.6081C40.9975 30.9408 40.4524 30.3999 39.7801 30.3999Z" fill="#A033FF"/>
|
||||||
<path d="M23.1037 13.4346H21.6188C21.1744 13.4346 20.8141 13.7949 20.8141 14.2393C20.8141 14.6837 21.1744 15.044 21.6188 15.044H23.1037C23.5481 15.044 23.9084 14.6837 23.9084 14.2393C23.9084 13.7949 23.5481 13.4346 23.1037 13.4346Z" fill="white"/>
|
<path d="M42.2776 32.8165H40.0314C39.3591 32.8165 38.8141 33.3574 38.8141 34.0247C38.8141 34.692 39.3591 35.233 40.0314 35.233H42.2776C42.95 35.233 43.495 34.692 43.495 34.0247C43.495 33.3574 42.95 32.8165 42.2776 32.8165Z" fill="#A033FF"/>
|
||||||
<path d="M21.4527 15.0332H19.9678C19.5234 15.0332 19.1631 15.3935 19.1631 15.8379C19.1631 16.2824 19.5234 16.6427 19.9678 16.6427H21.4527C21.8971 16.6427 22.2574 16.2824 22.2574 15.8379C22.2574 15.3935 21.8971 15.0332 21.4527 15.0332Z" fill="white"/>
|
<path d="M39.7801 35.2171H37.5339C36.8616 35.2171 36.3166 35.758 36.3166 36.4253C36.3166 37.0926 36.8616 37.6335 37.5339 37.6335H39.7801C40.4524 37.6335 40.9975 37.0926 40.9975 36.4253C40.9975 35.758 40.4524 35.2171 39.7801 35.2171Z" fill="#A033FF"/>
|
||||||
<path d="M23.1037 16.6426H21.6188C21.1744 16.6426 20.8141 17.0029 20.8141 17.4473C20.8141 17.8918 21.1744 18.252 21.6188 18.252H23.1037C23.5481 18.252 23.9084 17.8918 23.9084 17.4473C23.9084 17.0029 23.5481 16.6426 23.1037 16.6426Z" fill="white"/>
|
<path d="M42.2776 37.633H40.0314C39.3591 37.633 38.8141 38.1739 38.8141 38.8412C38.8141 39.5085 39.3591 40.0495 40.0314 40.0495H42.2776C42.95 40.0495 43.495 39.5085 43.495 38.8412C43.495 38.1739 42.95 37.633 42.2776 37.633Z" fill="#A033FF"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,60 +1,8 @@
|
|||||||
class SupportedPreviewFileTypes {
|
class SupportedPreviewFileTypes {
|
||||||
static const imageMimeTypes = [
|
|
||||||
'image/bmp',
|
|
||||||
'image/jpeg',
|
|
||||||
'image/gif',
|
|
||||||
'image/webp',
|
|
||||||
'image/png',
|
|
||||||
'image/svg+xml',
|
|
||||||
'image/x-icon',
|
|
||||||
'image/tiff',
|
|
||||||
'image/heif',
|
|
||||||
'image/avif'
|
|
||||||
];
|
|
||||||
|
|
||||||
static const textMimeTypes = [
|
|
||||||
'text/plain',
|
|
||||||
'text/markdown',
|
|
||||||
];
|
|
||||||
|
|
||||||
static const jsonMimeTypes = [
|
static const jsonMimeTypes = [
|
||||||
'application/json',
|
'application/json',
|
||||||
];
|
];
|
||||||
|
|
||||||
static const docMimeTypes = [
|
|
||||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
||||||
'application/vnd.oasis.opendocument.text',
|
|
||||||
'application/vnd.oasis.opendocument.text-template',
|
|
||||||
'application/vnd.oasis.opendocument.text-web',
|
|
||||||
'application/vnd.oasis.opendocument.text-master',
|
|
||||||
'application/msword',
|
|
||||||
'application/vnd.ms-works'];
|
|
||||||
|
|
||||||
static const rtfMimeTypes = ['application/rtf'];
|
|
||||||
|
|
||||||
static const xlsMimeTypes = [
|
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
||||||
'application/vnd.oasis.opendocument.spreadsheet',
|
|
||||||
'application/vnd.oasis.opendocument.spreadsheet-template',
|
|
||||||
'application/vnd.oasis.opendocument.chart',
|
|
||||||
'application/vnd.oasis.opendocument.formula',
|
|
||||||
'application/vnd.ms-excel'];
|
|
||||||
|
|
||||||
static const pptMimeTypes = [
|
|
||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
||||||
'application/vnd.oasis.opendocument.presentation',
|
|
||||||
'application/vnd.oasis.opendocument.presentation-template',
|
|
||||||
'application/vnd.ms-powerpoint'];
|
|
||||||
|
|
||||||
static const zipMimeTypes = [
|
|
||||||
'application/zip',
|
|
||||||
'application/x-tar',
|
|
||||||
'application/x-gtar',
|
|
||||||
'application/x-gzip',
|
|
||||||
'application/x-compressed',
|
|
||||||
'application/x-zip-compressed',
|
|
||||||
'application/java-archive'];
|
|
||||||
|
|
||||||
static const iOSSupportedTypes = {
|
static const iOSSupportedTypes = {
|
||||||
'text/plain' : 'public.plain-text',
|
'text/plain' : 'public.plain-text',
|
||||||
'text/html' : 'public.html',
|
'text/html' : 'public.html',
|
||||||
@@ -83,50 +31,4 @@ class SupportedPreviewFileTypes {
|
|||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation' : 'com.microsoft.powerpoint.ppt',
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation' : 'com.microsoft.powerpoint.ppt',
|
||||||
'application/pdf' : 'com.adobe.pdf',
|
'application/pdf' : 'com.adobe.pdf',
|
||||||
};
|
};
|
||||||
|
|
||||||
static const androidSupportedTypes = [
|
|
||||||
'image/bmp',
|
|
||||||
'image/jpeg',
|
|
||||||
'image/gif',
|
|
||||||
'image/png',
|
|
||||||
'text/plain',
|
|
||||||
'text/html',
|
|
||||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
||||||
'application/msword',
|
|
||||||
'application/vnd.ms-excel',
|
|
||||||
'application/vnd.ms-powerpoint',
|
|
||||||
'application/vnd.ms-outlook',
|
|
||||||
'application/vnd.ms-works',
|
|
||||||
'application/vnd.mpohun.certificate',
|
|
||||||
'application/vnd.android.package-archive',
|
|
||||||
'application/octet-stream',
|
|
||||||
'application/x-tar',
|
|
||||||
'application/x-gtar',
|
|
||||||
'application/x-gzip',
|
|
||||||
'application/x-javascript',
|
|
||||||
'application/x-compressed',
|
|
||||||
'application/x-zip-compressed',
|
|
||||||
'application/java-archive',
|
|
||||||
'application/pdf',
|
|
||||||
'application/rtf',
|
|
||||||
'audio/x-mpegurl',
|
|
||||||
'video/x-m4v',
|
|
||||||
'video/x-ms-asf',
|
|
||||||
'video/x-msvideo',
|
|
||||||
'audio/x-mpeg',
|
|
||||||
'audio/mp4a-latm',
|
|
||||||
'video/vnd.mpegurl',
|
|
||||||
'video/quicktime',
|
|
||||||
'video/mp4',
|
|
||||||
'video/3gpp',
|
|
||||||
'video/mpeg',
|
|
||||||
'audio/mpeg',
|
|
||||||
'audio/ogg',
|
|
||||||
'audio/x-pn-realaudio',
|
|
||||||
'audio/x-wav',
|
|
||||||
'audio/x-ms-wma',
|
|
||||||
'audio/x-ms-wmv',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,18 @@
|
|||||||
import 'package:core/data/constants/constant.dart';
|
import 'package:core/data/constants/constant.dart';
|
||||||
import 'package:core/domain/preview/document_uti.dart';
|
import 'package:core/domain/preview/document_uti.dart';
|
||||||
import 'package:core/domain/preview/supported_preview_file_types.dart';
|
import 'package:core/domain/preview/supported_preview_file_types.dart';
|
||||||
import 'package:core/presentation/extensions/string_extension.dart';
|
import 'package:core/presentation/model/file_category.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:http_parser/http_parser.dart';
|
import 'package:http_parser/http_parser.dart';
|
||||||
|
|
||||||
extension MediaTypeExtension on MediaType {
|
extension MediaTypeExtension on MediaType {
|
||||||
bool isAndroidSupportedPreview() => SupportedPreviewFileTypes.androidSupportedTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isIOSSupportedPreview() => SupportedPreviewFileTypes.iOSSupportedTypes.containsKey(mimeType);
|
|
||||||
|
|
||||||
bool isImageFile() => SupportedPreviewFileTypes.imageMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isDocFile() => SupportedPreviewFileTypes.docMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isPowerPointFile() => SupportedPreviewFileTypes.pptMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isExcelFile() => SupportedPreviewFileTypes.xlsMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isZipFile() => SupportedPreviewFileTypes.zipMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isRtfFile() => SupportedPreviewFileTypes.rtfMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isTextFile() => SupportedPreviewFileTypes.textMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
bool isJsonFile() => SupportedPreviewFileTypes.jsonMimeTypes.contains(mimeType);
|
bool isJsonFile() => SupportedPreviewFileTypes.jsonMimeTypes.contains(mimeType);
|
||||||
|
|
||||||
DocumentUti getDocumentUti() => DocumentUti(SupportedPreviewFileTypes.iOSSupportedTypes[mimeType]);
|
DocumentUti getDocumentUti() => DocumentUti(SupportedPreviewFileTypes.iOSSupportedTypes[mimeType]);
|
||||||
|
|
||||||
String getIcon(ImagePaths imagePaths, {String? fileName}) {
|
String getIcon(ImagePaths imagePaths, {String? fileName}) {
|
||||||
if (isPDFFile(fileName: fileName) == true || isRtfFile()) {
|
final category = getFileCategory(fileName: fileName);
|
||||||
return imagePaths.icFilePdf;
|
return category.getIconPath(imagePaths);
|
||||||
} else if (isDocFile()) {
|
|
||||||
return imagePaths.icFileDocx;
|
|
||||||
} else if (isExcelFile()) {
|
|
||||||
return imagePaths.icFileXlsx;
|
|
||||||
} else if (isPowerPointFile()) {
|
|
||||||
return imagePaths.icFilePptx;
|
|
||||||
} else if (isZipFile()) {
|
|
||||||
return imagePaths.icFileZip;
|
|
||||||
} else if (isImageSupportedPreview(fileName: fileName)) {
|
|
||||||
return imagePaths.icFilePng;
|
|
||||||
} else {
|
|
||||||
return imagePaths.icFileEPup;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPDFFile({required String? fileName}) =>
|
bool isPDFFile({required String? fileName}) =>
|
||||||
@@ -58,10 +27,132 @@ extension MediaTypeExtension on MediaType {
|
|||||||
(mimeType == Constant.octetStreamMimeType &&
|
(mimeType == Constant.octetStreamMimeType &&
|
||||||
fileName?.endsWith(Constant.htmlExtension) == true);
|
fileName?.endsWith(Constant.htmlExtension) == true);
|
||||||
|
|
||||||
bool isImageSupportedPreview({required String? fileName}) =>
|
FileCategory getFileCategory({String? fileName}) {
|
||||||
isImageFile() ||
|
String? ext;
|
||||||
(mimeType == Constant.octetStreamMimeType &&
|
|
||||||
fileName != null &&
|
if (fileName != null && fileName.contains('.')) {
|
||||||
SupportedPreviewFileTypes.imageMimeTypes
|
ext = fileName.split('.').last.toLowerCase();
|
||||||
.contains(fileName.imageMimeType));
|
}
|
||||||
|
|
||||||
|
switch (ext) {
|
||||||
|
case 'pdf':
|
||||||
|
return FileCategory.pdf;
|
||||||
|
case 'doc':
|
||||||
|
case 'docx':
|
||||||
|
case 'rtf':
|
||||||
|
return FileCategory.document;
|
||||||
|
case 'odt':
|
||||||
|
return FileCategory.documentODT;
|
||||||
|
case 'xls':
|
||||||
|
case 'xlsx':
|
||||||
|
case 'csv':
|
||||||
|
case 'tsv':
|
||||||
|
return FileCategory.spreadsheet;
|
||||||
|
case 'ods':
|
||||||
|
return FileCategory.spreadsheetODS;
|
||||||
|
case 'ppt':
|
||||||
|
case 'pptx':
|
||||||
|
return FileCategory.presentation;
|
||||||
|
case 'odp':
|
||||||
|
return FileCategory.presentationODP;
|
||||||
|
case 'jpg':
|
||||||
|
case 'jpeg':
|
||||||
|
case 'png':
|
||||||
|
case 'gif':
|
||||||
|
case 'bmp':
|
||||||
|
case 'svg':
|
||||||
|
case 'webp':
|
||||||
|
case 'heic':
|
||||||
|
case 'heif':
|
||||||
|
case 'avif':
|
||||||
|
case 'tiff':
|
||||||
|
return FileCategory.image;
|
||||||
|
case 'mp3':
|
||||||
|
case 'wav':
|
||||||
|
case 'ogg':
|
||||||
|
case 'm4a':
|
||||||
|
case 'aac':
|
||||||
|
case 'flac':
|
||||||
|
return FileCategory.audio;
|
||||||
|
case 'mp4':
|
||||||
|
case 'mov':
|
||||||
|
case 'avi':
|
||||||
|
case 'mkv':
|
||||||
|
case 'webm':
|
||||||
|
case 'wmv':
|
||||||
|
return FileCategory.video;
|
||||||
|
case 'zip':
|
||||||
|
case 'rar':
|
||||||
|
case '7z':
|
||||||
|
case 'tar':
|
||||||
|
case 'gz':
|
||||||
|
case 'bz2':
|
||||||
|
return FileCategory.archive;
|
||||||
|
case 'txt':
|
||||||
|
case 'md':
|
||||||
|
case 'log':
|
||||||
|
return FileCategory.text;
|
||||||
|
case 'js':
|
||||||
|
case 'ts':
|
||||||
|
case 'json':
|
||||||
|
case 'html':
|
||||||
|
case 'css':
|
||||||
|
case 'xml':
|
||||||
|
case 'java':
|
||||||
|
case 'kt':
|
||||||
|
case 'dart':
|
||||||
|
case 'py':
|
||||||
|
case 'c':
|
||||||
|
case 'cpp':
|
||||||
|
case 'h':
|
||||||
|
case 'cs':
|
||||||
|
case 'swift':
|
||||||
|
case 'go':
|
||||||
|
case 'rb':
|
||||||
|
case 'php':
|
||||||
|
case 'sh':
|
||||||
|
case 'yml':
|
||||||
|
case 'yaml':
|
||||||
|
return FileCategory.code;
|
||||||
|
case 'apk':
|
||||||
|
case 'ipa':
|
||||||
|
case 'exe':
|
||||||
|
case 'dmg':
|
||||||
|
return FileCategory.other;
|
||||||
|
}
|
||||||
|
|
||||||
|
final lowerType = mimeType.toLowerCase();
|
||||||
|
|
||||||
|
if (lowerType == 'application/pdf') return FileCategory.pdf;
|
||||||
|
if (lowerType.startsWith('image/')) return FileCategory.image;
|
||||||
|
if (lowerType.startsWith('audio/')) return FileCategory.audio;
|
||||||
|
if (lowerType.startsWith('video/')) return FileCategory.video;
|
||||||
|
if (lowerType.startsWith('text/')) return FileCategory.text;
|
||||||
|
|
||||||
|
if (lowerType.contains('zip') || lowerType.contains('compressed')) {
|
||||||
|
return FileCategory.archive;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowerType.contains('msword') ||
|
||||||
|
lowerType.contains('wordprocessingml')) {
|
||||||
|
return FileCategory.document;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowerType.contains('spreadsheetml') ||
|
||||||
|
lowerType.contains('excel') ||
|
||||||
|
lowerType.contains('csv')) {
|
||||||
|
return FileCategory.spreadsheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowerType.contains('presentationml') ||
|
||||||
|
lowerType.contains('powerpoint')) {
|
||||||
|
return FileCategory.presentation;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowerType == 'application/octet-stream') {
|
||||||
|
return FileCategory.other;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FileCategory.other;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
|
|
||||||
|
enum FileCategory {
|
||||||
|
pdf,
|
||||||
|
document,
|
||||||
|
documentODT,
|
||||||
|
spreadsheet,
|
||||||
|
spreadsheetODS,
|
||||||
|
presentation,
|
||||||
|
presentationODP,
|
||||||
|
image,
|
||||||
|
video,
|
||||||
|
audio,
|
||||||
|
archive,
|
||||||
|
text,
|
||||||
|
code,
|
||||||
|
other;
|
||||||
|
|
||||||
|
String getIconPath(ImagePaths imagePaths) {
|
||||||
|
switch (this) {
|
||||||
|
case FileCategory.pdf:
|
||||||
|
return imagePaths.icFilePdf;
|
||||||
|
case FileCategory.document:
|
||||||
|
return imagePaths.icFileDoc;
|
||||||
|
case FileCategory.documentODT:
|
||||||
|
return imagePaths.icFileODT;
|
||||||
|
case FileCategory.spreadsheet:
|
||||||
|
return imagePaths.icFileExcel;
|
||||||
|
case FileCategory.spreadsheetODS:
|
||||||
|
return imagePaths.icFileODS;
|
||||||
|
case FileCategory.presentation:
|
||||||
|
return imagePaths.icFilePowerPoint;
|
||||||
|
case FileCategory.presentationODP:
|
||||||
|
return imagePaths.icFileODP;
|
||||||
|
case FileCategory.image:
|
||||||
|
return imagePaths.icFileImage;
|
||||||
|
case FileCategory.video:
|
||||||
|
return imagePaths.icFileVideo;
|
||||||
|
case FileCategory.audio:
|
||||||
|
return imagePaths.icFileAudio;
|
||||||
|
case FileCategory.archive:
|
||||||
|
return imagePaths.icFileZip;
|
||||||
|
case FileCategory.text:
|
||||||
|
return imagePaths.icFileText;
|
||||||
|
case FileCategory.code:
|
||||||
|
return imagePaths.icFileCode;
|
||||||
|
case FileCategory.other:
|
||||||
|
return imagePaths.icFileDefault;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,13 +101,20 @@ class ImagePaths {
|
|||||||
String get icSelectedSB => _getImagePath('ic_selected_sb.svg');
|
String get icSelectedSB => _getImagePath('ic_selected_sb.svg');
|
||||||
String get icUserSB => _getImagePath('ic_user_sb.svg');
|
String get icUserSB => _getImagePath('ic_user_sb.svg');
|
||||||
String get icComposeWeb => _getImagePath('ic_compose_web.svg');
|
String get icComposeWeb => _getImagePath('ic_compose_web.svg');
|
||||||
String get icFileDocx => _getImagePath('ic_file_docx.svg');
|
String get icFileDoc => _getImagePath('ic_file_doc.svg');
|
||||||
String get icFileZip => _getImagePath('ic_file_zip.svg');
|
String get icFileZip => _getImagePath('ic_file_zip.svg');
|
||||||
String get icFileXlsx => _getImagePath('ic_file_xlsx.svg');
|
String get icFileExcel => _getImagePath('ic_file_excel.svg');
|
||||||
String get icFilePng => _getImagePath('ic_file_png.svg');
|
String get icFileImage => _getImagePath('ic_file_image.svg');
|
||||||
String get icFilePdf => _getImagePath('ic_file_pdf.svg');
|
String get icFilePdf => _getImagePath('ic_file_pdf.svg');
|
||||||
String get icFilePptx => _getImagePath('ic_file_pptx.svg');
|
String get icFilePowerPoint => _getImagePath('ic_file_power_point.svg');
|
||||||
String get icFileEPup => _getImagePath('ic_file_epup.svg');
|
String get icFileDefault => _getImagePath('ic_file_default.svg');
|
||||||
|
String get icFileAudio => _getImagePath('ic_file_audio.svg');
|
||||||
|
String get icFileCode => _getImagePath('ic_file_code.svg');
|
||||||
|
String get icFileODP => _getImagePath('ic_file_odp.svg');
|
||||||
|
String get icFileODS => _getImagePath('ic_file_ods.svg');
|
||||||
|
String get icFileODT => _getImagePath('ic_file_odt.svg');
|
||||||
|
String get icFileText => _getImagePath('ic_file_text.svg');
|
||||||
|
String get icFileVideo => _getImagePath('ic_file_video.svg');
|
||||||
String get icLanguage => _getImagePath('ic_language.svg');
|
String get icLanguage => _getImagePath('ic_language.svg');
|
||||||
String get icChecked => _getImagePath('ic_checked.svg');
|
String get icChecked => _getImagePath('ic_checked.svg');
|
||||||
String get icStyleBold => _getImagePath('ic_style_bold.svg');
|
String get icStyleBold => _getImagePath('ic_style_bold.svg');
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
List<String>? emailAddressSender,
|
List<String>? emailAddressSender,
|
||||||
ScrollController? scrollController,
|
ScrollController? scrollController,
|
||||||
}) {
|
}) {
|
||||||
|
final isMobile = controller.responsiveUtils.isMobile(context);
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -285,8 +286,8 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
controller.mailboxDashBoardController.mapMailboxById,
|
controller.mailboxDashBoardController.mapMailboxById,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
if (!controller.responsiveUtils.isMobile(context))
|
if (!isMobile)
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 16),
|
||||||
Obx(() => MailUnsubscribedBanner(
|
Obx(() => MailUnsubscribedBanner(
|
||||||
presentationEmail: controller.currentEmail,
|
presentationEmail: controller.currentEmail,
|
||||||
emailUnsubscribe: controller.emailUnsubscribe.value
|
emailUnsubscribe: controller.emailUnsubscribe.value
|
||||||
@@ -294,6 +295,8 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
Obx(() => EmailViewLoadingBarWidget(
|
Obx(() => EmailViewLoadingBarWidget(
|
||||||
viewState: controller.emailLoadedViewState.value
|
viewState: controller.emailLoadedViewState.value
|
||||||
)),
|
)),
|
||||||
|
if (!isMobile)
|
||||||
|
_buildAttachmentsList(context),
|
||||||
if (calendarEvent != null)
|
if (calendarEvent != null)
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -437,46 +440,51 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
height: 5,
|
height: 5,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
Obx(() {
|
if (isMobile)
|
||||||
if (controller.attachments.isNotEmpty) {
|
_buildAttachmentsList(context),
|
||||||
return EmailAttachmentsWidget(
|
|
||||||
responsiveUtils: controller.responsiveUtils,
|
|
||||||
attachments: controller.attachments,
|
|
||||||
imagePaths: controller.imagePaths,
|
|
||||||
onDragStarted: controller
|
|
||||||
.mailboxDashBoardController.enableAttachmentDraggableApp,
|
|
||||||
onDragEnd: (_) {
|
|
||||||
controller
|
|
||||||
.mailboxDashBoardController
|
|
||||||
.disableAttachmentDraggableApp();
|
|
||||||
},
|
|
||||||
downloadAttachmentAction: (attachment) =>
|
|
||||||
controller.handleDownloadAttachmentAction(attachment),
|
|
||||||
viewAttachmentAction: (attachment) =>
|
|
||||||
controller.handleViewAttachmentAction(
|
|
||||||
context,
|
|
||||||
attachment,
|
|
||||||
),
|
|
||||||
onTapShowAllAttachmentFile: () => controller.openAttachmentList(
|
|
||||||
context,
|
|
||||||
controller.attachments,
|
|
||||||
),
|
|
||||||
showDownloadAllAttachmentsButton:
|
|
||||||
controller.downloadAllButtonIsEnabled(),
|
|
||||||
onTapDownloadAllButton: () =>
|
|
||||||
controller.handleDownloadAllAttachmentsAction(
|
|
||||||
'TwakeMail-${DateTime.now()}',
|
|
||||||
),
|
|
||||||
singleEmailControllerTag: tag,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildAttachmentsList(BuildContext context) {
|
||||||
|
return Obx(() {
|
||||||
|
if (controller.attachments.isNotEmpty) {
|
||||||
|
return EmailAttachmentsWidget(
|
||||||
|
responsiveUtils: controller.responsiveUtils,
|
||||||
|
attachments: controller.attachments,
|
||||||
|
imagePaths: controller.imagePaths,
|
||||||
|
onDragStarted: controller
|
||||||
|
.mailboxDashBoardController.enableAttachmentDraggableApp,
|
||||||
|
onDragEnd: (_) {
|
||||||
|
controller
|
||||||
|
.mailboxDashBoardController
|
||||||
|
.disableAttachmentDraggableApp();
|
||||||
|
},
|
||||||
|
downloadAttachmentAction: (attachment) =>
|
||||||
|
controller.handleDownloadAttachmentAction(attachment),
|
||||||
|
viewAttachmentAction: (attachment) =>
|
||||||
|
controller.handleViewAttachmentAction(
|
||||||
|
context,
|
||||||
|
attachment,
|
||||||
|
),
|
||||||
|
onTapShowAllAttachmentFile: () => controller.openAttachmentList(
|
||||||
|
context,
|
||||||
|
controller.attachments,
|
||||||
|
),
|
||||||
|
showDownloadAllAttachmentsButton:
|
||||||
|
controller.downloadAllButtonIsEnabled(),
|
||||||
|
onTapDownloadAllButton: () =>
|
||||||
|
controller.handleDownloadAllAttachmentsAction(
|
||||||
|
'TwakeMail-${DateTime.now()}',
|
||||||
|
),
|
||||||
|
singleEmailControllerTag: tag,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool _validateDisplayEventActionBanner({
|
bool _validateDisplayEventActionBanner({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required CalendarEvent event,
|
required CalendarEvent event,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:core/data/constants/constant.dart';
|
import 'package:core/data/constants/constant.dart';
|
||||||
import 'package:core/presentation/extensions/media_type_extension.dart';
|
import 'package:core/presentation/extensions/media_type_extension.dart';
|
||||||
|
import 'package:core/presentation/model/file_category.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:model/download/download_task_id.dart';
|
import 'package:model/download/download_task_id.dart';
|
||||||
@@ -8,7 +9,7 @@ import 'package:tmail_ui_user/main/routes/app_routes.dart';
|
|||||||
import 'package:tmail_ui_user/main/routes/route_utils.dart';
|
import 'package:tmail_ui_user/main/routes/route_utils.dart';
|
||||||
|
|
||||||
extension AttachmentExtension on Attachment {
|
extension AttachmentExtension on Attachment {
|
||||||
String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileEPup;
|
String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileDefault;
|
||||||
|
|
||||||
bool get isPDFFile => type?.isPDFFile(fileName: name) ?? false;
|
bool get isPDFFile => type?.isPDFFile(fileName: name) ?? false;
|
||||||
|
|
||||||
@@ -41,11 +42,9 @@ extension AttachmentExtension on Attachment {
|
|||||||
|
|
||||||
bool get isHTMLFile => type?.isHTMLFile(fileName: name) ?? false;
|
bool get isHTMLFile => type?.isHTMLFile(fileName: name) ?? false;
|
||||||
|
|
||||||
bool get isImage => type?.isImageSupportedPreview(fileName: name) ?? false;
|
bool get isImage => type?.getFileCategory(fileName: name) == FileCategory.image;
|
||||||
|
|
||||||
bool get isText => (type?.isTextFile() ?? false)
|
bool get isText => type?.getFileCategory(fileName: name) == FileCategory.text;
|
||||||
|| name?.endsWith('.txt') == true
|
|
||||||
|| name?.endsWith('.md') == true;
|
|
||||||
|
|
||||||
bool get isJson => (type?.isJsonFile() ?? false)
|
bool get isJson => (type?.isJsonFile() ?? false)
|
||||||
|| name?.endsWith('.json') == true;
|
|| name?.endsWith('.json') == true;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import 'package:tmail_ui_user/main/routes/route_utils.dart';
|
|||||||
class EmailUtils {
|
class EmailUtils {
|
||||||
static const double desktopItemMaxWidth = 260;
|
static const double desktopItemMaxWidth = 260;
|
||||||
static const double desktopMoreButtonMaxWidth = 70;
|
static const double desktopMoreButtonMaxWidth = 70;
|
||||||
static const double maxMobileVisibleAttachments = 3;
|
static const double attachmentItemSpacing = 8;
|
||||||
|
static const int maxMobileVisibleAttachments = 3;
|
||||||
|
|
||||||
EmailUtils._();
|
EmailUtils._();
|
||||||
|
|
||||||
@@ -248,21 +249,35 @@ class EmailUtils {
|
|||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return attachments.length <= maxMobileVisibleAttachments
|
return attachments.length <= maxMobileVisibleAttachments
|
||||||
? attachments
|
? attachments
|
||||||
: attachments.sublist(0, 3);
|
: attachments.sublist(0, maxMobileVisibleAttachments);
|
||||||
}
|
}
|
||||||
|
|
||||||
final displayedCount = maxWidth ~/ desktopItemMaxWidth;
|
final totalNeededWidth = attachments.length * desktopItemMaxWidth +
|
||||||
if (displayedCount == attachments.length) {
|
(attachments.length - 1) * attachmentItemSpacing;
|
||||||
|
if (totalNeededWidth <= maxWidth) {
|
||||||
return attachments;
|
return attachments;
|
||||||
} else {
|
|
||||||
final int possibleDisplayedCount =
|
|
||||||
((maxWidth - desktopMoreButtonMaxWidth) ~/ desktopItemMaxWidth)
|
|
||||||
.clamp(0, attachments.length);
|
|
||||||
|
|
||||||
return possibleDisplayedCount == 0
|
|
||||||
? [attachments.first]
|
|
||||||
: attachments.sublist(0, possibleDisplayedCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final availableWidth =
|
||||||
|
maxWidth - desktopMoreButtonMaxWidth - attachmentItemSpacing;
|
||||||
|
|
||||||
|
double usedWidth = 0;
|
||||||
|
int visibleCount = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < attachments.length; i++) {
|
||||||
|
final nextWidth =
|
||||||
|
desktopItemMaxWidth + (i > 0 ? attachmentItemSpacing : 0);
|
||||||
|
if (usedWidth + nextWidth <= availableWidth) {
|
||||||
|
usedWidth += nextWidth;
|
||||||
|
visibleCount++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibleCount == 0) visibleCount = 1;
|
||||||
|
|
||||||
|
return attachments.sublist(0, visibleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getDomainByEmailAddress(String emailAddress) {
|
static String getDomainByEmailAddress(String emailAddress) {
|
||||||
|
|||||||
@@ -52,79 +52,40 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
style: ThemeUtils.textStyleInter400.copyWith(
|
style: ThemeUtils.textStyleInter400.copyWith(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
height: 20 / 15,
|
height: 20 / 15,
|
||||||
|
letterSpacing: -0.24,
|
||||||
color: AppColor.gray99A2AD,
|
color: AppColor.gray99A2AD,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (responsiveUtils.isMobile(context)) {
|
return Row(
|
||||||
return Row(
|
children: [
|
||||||
children: [
|
iconAttachment,
|
||||||
iconAttachment,
|
Expanded(
|
||||||
Expanded(
|
child: Padding(
|
||||||
child: Padding(
|
padding: const EdgeInsetsDirectional.only(start: 8, end: 3),
|
||||||
padding: const EdgeInsetsDirectional.only(start: 8, end: 3),
|
child: titleHeaderAttachment,
|
||||||
child: titleHeaderAttachment,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (displayShowAll && numberOfAttachments > 3)
|
),
|
||||||
_buildShowAllButton(context),
|
if (onTapDownloadAllButton != null)
|
||||||
],
|
TMailButtonWidget(
|
||||||
);
|
text: AppLocalizations.of(context).archiveAndDownload,
|
||||||
} else {
|
icon: imagePaths.icDownloadAll,
|
||||||
return Row(
|
iconSize: 20,
|
||||||
children: [
|
iconColor: AppColor.steelGrayA540,
|
||||||
iconAttachment,
|
iconAlignment: TextDirection.rtl,
|
||||||
Expanded(
|
backgroundColor: Colors.transparent,
|
||||||
child: Row(
|
borderRadius: 5,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
flexibleText: true,
|
||||||
Flexible(
|
maxLines: 1,
|
||||||
child: Padding(
|
maxWidth: 300,
|
||||||
padding: const EdgeInsetsDirectional.only(start: 8, end: 3),
|
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
||||||
child: titleHeaderAttachment,
|
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
||||||
),
|
color: AppColor.steelGray400,
|
||||||
),
|
|
||||||
if (displayShowAll && numberOfAttachments > 4)
|
|
||||||
_buildShowAllButton(context),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
onTapActionCallback: onTapDownloadAllButton,
|
||||||
),
|
),
|
||||||
if (onTapDownloadAllButton != null)
|
],
|
||||||
TMailButtonWidget(
|
|
||||||
text: AppLocalizations.of(context).archiveAndDownload,
|
|
||||||
icon: imagePaths.icDownloadAll,
|
|
||||||
iconSize: 20,
|
|
||||||
iconColor: AppColor.steelGrayA540,
|
|
||||||
iconAlignment: TextDirection.rtl,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
borderRadius: 5,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
flexibleText: true,
|
|
||||||
maxLines: 1,
|
|
||||||
maxWidth: 300,
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
|
||||||
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
|
||||||
color: AppColor.steelGray400,
|
|
||||||
),
|
|
||||||
onTapActionCallback: onTapDownloadAllButton,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildShowAllButton(BuildContext context) {
|
|
||||||
return TMailButtonWidget.fromText(
|
|
||||||
text: AppLocalizations.of(context).showAll,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
|
||||||
color: AppColor.steelGray400,
|
|
||||||
),
|
|
||||||
borderRadius: 5,
|
|
||||||
maxLines: 1,
|
|
||||||
maxWidth: 120,
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
|
||||||
onTapActionCallback: onTapShowAllAttachmentFile,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import 'package:core/presentation/action/action_callback_define.dart';
|
import 'package:core/presentation/action/action_callback_define.dart';
|
||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/presentation/utils/theme_utils.dart';
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
import 'package:core/presentation/views/dialog/confirm_dialog_button.dart';
|
||||||
import 'package:core/utils/app_logger.dart';
|
import 'package:core/utils/app_logger.dart';
|
||||||
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:filesize/filesize.dart';
|
import 'package:filesize/filesize.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:model/email/attachment.dart';
|
import 'package:model/email/attachment.dart';
|
||||||
@@ -41,7 +41,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
this.viewAttachmentAction,
|
this.viewAttachmentAction,
|
||||||
this.onTapShowAllAttachmentFile,
|
this.onTapShowAllAttachmentFile,
|
||||||
this.showDownloadAllAttachmentsButton = false,
|
this.showDownloadAllAttachmentsButton = false,
|
||||||
this.isDisplayAllAttachments = true,
|
this.isDisplayAllAttachments = false,
|
||||||
this.onTapDownloadAllButton,
|
this.onTapDownloadAllButton,
|
||||||
this.singleEmailControllerTag,
|
this.singleEmailControllerTag,
|
||||||
});
|
});
|
||||||
@@ -68,20 +68,17 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
final hiddenItemsCount = attachmentRecord.hiddenItemsCount;
|
final hiddenItemsCount = attachmentRecord.hiddenItemsCount;
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(top: 12, bottom: 24),
|
padding: const EdgeInsetsDirectional.only(
|
||||||
|
start: 16,
|
||||||
|
end: 16,
|
||||||
|
bottom: 24,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
attachmentHeader,
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 12),
|
padding: const EdgeInsetsDirectional.only(top: 4),
|
||||||
child: attachmentHeader,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.only(
|
|
||||||
start: 12,
|
|
||||||
end: 12,
|
|
||||||
top: 4,
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: displayedAttachments.map((attachment) {
|
children: displayedAttachments.map((attachment) {
|
||||||
return AttachmentItemWidget(
|
return AttachmentItemWidget(
|
||||||
@@ -95,189 +92,106 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 8),
|
||||||
if (hiddenItemsCount > 0 && showDownloadAllAttachmentsButton)
|
if (hiddenItemsCount > 0)
|
||||||
Padding(
|
SizedBox(
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 8),
|
height: 36,
|
||||||
child: Row(
|
width: double.infinity,
|
||||||
children: [
|
child: ConfirmDialogButton(
|
||||||
TMailButtonWidget.fromText(
|
label: AppLocalizations.of(context).moreAttachments(
|
||||||
text: AppLocalizations.of(context).moreAttachments(
|
hiddenItemsCount,
|
||||||
hiddenItemsCount,
|
),
|
||||||
),
|
backgroundColor: Theme.of(context).colorScheme.outline.withValues(
|
||||||
backgroundColor: Colors.transparent,
|
alpha: 0.08,
|
||||||
borderRadius: 5,
|
),
|
||||||
maxWidth: 120,
|
textStyle: ThemeUtils.textStyleM3TitleSmall,
|
||||||
maxLines: 1,
|
radius: 5,
|
||||||
textStyle: ThemeUtils.textStyleM3TitleSmall,
|
onTapAction: onTapShowAllAttachmentFile,
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 3,
|
|
||||||
horizontal: 5,
|
|
||||||
),
|
|
||||||
onTapActionCallback: onTapShowAllAttachmentFile,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: TMailButtonWidget(
|
|
||||||
text: AppLocalizations
|
|
||||||
.of(context)
|
|
||||||
.archiveAndDownload,
|
|
||||||
icon: imagePaths.icDownloadAll,
|
|
||||||
iconSize: 20,
|
|
||||||
iconColor: AppColor.steelGrayA540,
|
|
||||||
iconAlignment: TextDirection.rtl,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
borderRadius: 5,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
maxLines: 1,
|
|
||||||
flexibleText: true,
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 3,
|
|
||||||
horizontal: 5,
|
|
||||||
),
|
|
||||||
textStyle: ThemeUtils.textStyleBodyBody1()
|
|
||||||
.copyWith(color: AppColor.steelGray400),
|
|
||||||
onTapActionCallback: onTapDownloadAllButton,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else if (hiddenItemsCount > 0)
|
|
||||||
TMailButtonWidget.fromText(
|
|
||||||
text: AppLocalizations.of(context).moreAttachments(
|
|
||||||
hiddenItemsCount,
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
borderRadius: 5,
|
|
||||||
maxLines: 1,
|
|
||||||
textStyle: ThemeUtils.textStyleM3TitleSmall,
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 3,
|
|
||||||
horizontal: 5,
|
|
||||||
),
|
|
||||||
margin: const EdgeInsetsDirectional.symmetric(horizontal: 8),
|
|
||||||
onTapActionCallback: onTapShowAllAttachmentFile,
|
|
||||||
)
|
|
||||||
else if (showDownloadAllAttachmentsButton)
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: TMailButtonWidget(
|
|
||||||
text: AppLocalizations.of(context).archiveAndDownload,
|
|
||||||
icon: imagePaths.icDownloadAll,
|
|
||||||
iconSize: 20,
|
|
||||||
iconColor: AppColor.steelGrayA540,
|
|
||||||
iconAlignment: TextDirection.rtl,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
borderRadius: 5,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
maxLines: 1,
|
|
||||||
flexibleText: true,
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 3,
|
|
||||||
horizontal: 5,
|
|
||||||
),
|
|
||||||
margin: const EdgeInsetsDirectional.symmetric(
|
|
||||||
horizontal: 8,
|
|
||||||
),
|
|
||||||
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
|
||||||
color: AppColor.steelGray400,
|
|
||||||
),
|
|
||||||
onTapActionCallback: onTapDownloadAllButton,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(
|
padding: const EdgeInsetsDirectional.only(
|
||||||
start: 16,
|
start: 8,
|
||||||
end: 16,
|
end: 8,
|
||||||
top: 16,
|
top: 12,
|
||||||
bottom: 28,
|
bottom: 16,
|
||||||
),
|
),
|
||||||
child: LayoutBuilder(
|
child: Column(
|
||||||
builder: (context, constraints) {
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
final attachmentRecord = _getDisplayedAndHiddenAttachment(
|
children: [
|
||||||
context,
|
Padding(
|
||||||
constraints.maxWidth,
|
padding: const EdgeInsetsDirectional.symmetric(horizontal: 12),
|
||||||
);
|
child: attachmentHeader,
|
||||||
final displayedAttachments = attachmentRecord.displayedAttachments;
|
),
|
||||||
final hiddenItemsCount = attachmentRecord.hiddenItemsCount;
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.only(
|
||||||
|
start: 12,
|
||||||
|
end: 12,
|
||||||
|
top: 12,
|
||||||
|
),
|
||||||
|
child: LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
|
final attachmentRecord = _getDisplayedAndHiddenAttachment(
|
||||||
|
context,
|
||||||
|
constraints.maxWidth,
|
||||||
|
);
|
||||||
|
final displayedAttachments = attachmentRecord.displayedAttachments;
|
||||||
|
final hiddenItemsCount = attachmentRecord.hiddenItemsCount;
|
||||||
|
|
||||||
return Column(
|
return Wrap(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
spacing: EmailUtils.attachmentItemSpacing,
|
||||||
children: [
|
runSpacing: isDisplayAllAttachments
|
||||||
Padding(
|
? EmailUtils.attachmentItemSpacing
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 12),
|
: 0,
|
||||||
child: attachmentHeader,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
),
|
children: [
|
||||||
Padding(
|
...displayedAttachments.map((attachment) {
|
||||||
padding: const EdgeInsetsDirectional.only(
|
if (PlatformInfo.isWeb &&
|
||||||
start: 12,
|
responsiveUtils.isDesktop(context)) {
|
||||||
end: 12,
|
return DraggableAttachmentItemWidget(
|
||||||
top: 12,
|
attachment: attachment,
|
||||||
),
|
imagePaths: imagePaths,
|
||||||
child: Wrap(
|
width: EmailUtils.desktopItemMaxWidth,
|
||||||
spacing: 8,
|
onDragStarted: onDragStarted,
|
||||||
runSpacing: isDisplayAllAttachments ? 8 : 0,
|
onDragEnd: onDragEnd,
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
downloadAttachmentAction: downloadAttachmentAction,
|
||||||
children: [
|
viewAttachmentAction: viewAttachmentAction,
|
||||||
...displayedAttachments.map((attachment) {
|
singleEmailControllerTag: singleEmailControllerTag,
|
||||||
if (responsiveUtils.isDesktop(context)) {
|
);
|
||||||
return DraggableAttachmentItemWidget(
|
} else {
|
||||||
attachment: attachment,
|
return AttachmentItemWidget(
|
||||||
imagePaths: imagePaths,
|
attachment: attachment,
|
||||||
width: EmailUtils.desktopItemMaxWidth,
|
imagePaths: imagePaths,
|
||||||
onDragStarted: onDragStarted,
|
width: EmailUtils.desktopItemMaxWidth,
|
||||||
onDragEnd: onDragEnd,
|
downloadAttachmentAction: downloadAttachmentAction,
|
||||||
downloadAttachmentAction: downloadAttachmentAction,
|
viewAttachmentAction: viewAttachmentAction,
|
||||||
viewAttachmentAction: viewAttachmentAction,
|
singleEmailControllerTag: singleEmailControllerTag,
|
||||||
singleEmailControllerTag: singleEmailControllerTag,
|
);
|
||||||
);
|
}
|
||||||
} else {
|
}).toList(),
|
||||||
return AttachmentItemWidget(
|
if (hiddenItemsCount > 0)
|
||||||
attachment: attachment,
|
SizedBox(
|
||||||
imagePaths: imagePaths,
|
height: 36,
|
||||||
width: EmailUtils.desktopItemMaxWidth,
|
child: ConfirmDialogButton(
|
||||||
downloadAttachmentAction: downloadAttachmentAction,
|
label: '+$hiddenItemsCount',
|
||||||
viewAttachmentAction: viewAttachmentAction,
|
backgroundColor: Theme.of(context).colorScheme.outline.withValues(
|
||||||
singleEmailControllerTag: singleEmailControllerTag,
|
alpha: 0.08,
|
||||||
);
|
),
|
||||||
}
|
textStyle: ThemeUtils.textStyleM3TitleSmall,
|
||||||
}).toList(),
|
radius: 5,
|
||||||
if (hiddenItemsCount > 0)
|
onTapAction: onTapShowAllAttachmentFile,
|
||||||
TMailButtonWidget.fromText(
|
),
|
||||||
text: '+ $hiddenItemsCount',
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
borderRadius: 5,
|
|
||||||
maxWidth: EmailUtils.desktopMoreButtonMaxWidth,
|
|
||||||
maxLines: 1,
|
|
||||||
textStyle: ThemeUtils.textStyleM3TitleSmall,
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 3,
|
|
||||||
horizontal: 5,
|
|
||||||
),
|
),
|
||||||
onTapActionCallback: onTapShowAllAttachmentFile,
|
],
|
||||||
),
|
);
|
||||||
],
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
|
||||||
}
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class _EmailReceiverWidgetState extends State<EmailReceiverWidget> {
|
|||||||
fontSize: 15
|
fontSize: 15
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
||||||
onTapActionCallback: () => setState(() => _isDisplayAll = false),
|
onTapActionCallback: () => setState(() => _isDisplayAll = false),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ class UploadFileState with EquatableMixin {
|
|||||||
if (mediaType == null && file != null) {
|
if (mediaType == null && file != null) {
|
||||||
mediaType = MediaType.parse(file!.mimeType);
|
mediaType = MediaType.parse(file!.mimeType);
|
||||||
}
|
}
|
||||||
return mediaType?.getIcon(imagePaths, fileName: fileName) ?? imagePaths.icFileEPup;
|
return mediaType?.getIcon(imagePaths, fileName: fileName) ?? imagePaths.icFileDefault;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError('UploadFileState::getIcon: Exception: $e');
|
logError('UploadFileState::getIcon: Exception: $e');
|
||||||
return imagePaths.icFileEPup;
|
return imagePaths.icFileDefault;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,48 @@ void main() {
|
|||||||
);
|
);
|
||||||
expect(result, attachments);
|
expect(result, attachments);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('returns all if total width <= maxWidth', () {
|
||||||
|
final attachments = generateAttachments(5);
|
||||||
|
final result = EmailUtils.getAttachmentDisplayed(
|
||||||
|
maxWidth: 1400,
|
||||||
|
attachments: attachments,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
expect(result.length, attachments.length);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('returns some items when total width > maxWidth', () {
|
||||||
|
final attachments = generateAttachments(5);
|
||||||
|
final result = EmailUtils.getAttachmentDisplayed(
|
||||||
|
maxWidth: 600,
|
||||||
|
attachments: attachments,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
expect(result.length, 1);
|
||||||
|
expect(result.first.name, 'A0');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('returns 2 items if enough for 2 + button', () {
|
||||||
|
final attachments = generateAttachments(5);
|
||||||
|
final result = EmailUtils.getAttachmentDisplayed(
|
||||||
|
maxWidth: 800,
|
||||||
|
attachments: attachments,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
expect(result.length, 2);
|
||||||
|
expect(result.map((e) => e.name), ['A0', 'A1']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('returns at least 1 even if not enough for one item + button', () {
|
||||||
|
final attachments = generateAttachments(5);
|
||||||
|
final result = EmailUtils.getAttachmentDisplayed(
|
||||||
|
maxWidth: 100,
|
||||||
|
attachments: attachments,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
expect(result.length, 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||