From dd9392e9a072bf6a3493fa3b2a7a78430c47f615 Mon Sep 17 00:00:00 2001 From: imaNNeoFighT Date: Tue, 17 Dec 2024 23:07:42 +0100 Subject: [PATCH] Add Bitcoin price history as a line chart sample --- example/assets/data/btc_last_year_price.json | 3 + .../lib/presentation/presentation_utils.dart | 15 ++ .../presentation/samples/chart_samples.dart | 2 + .../samples/line/line_chart_sample12.dart | 219 ++++++++++++++++++ example/macos/Podfile.lock | 2 +- example/macos/Runner/AppDelegate.swift | 4 + example/pubspec.yaml | 2 + 7 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 example/assets/data/btc_last_year_price.json create mode 100644 example/lib/presentation/presentation_utils.dart create mode 100644 example/lib/presentation/samples/line/line_chart_sample12.dart diff --git a/example/assets/data/btc_last_year_price.json b/example/assets/data/btc_last_year_price.json new file mode 100644 index 000000000..b514faf8e --- /dev/null +++ b/example/assets/data/btc_last_year_price.json @@ -0,0 +1,3 @@ +{ + "prices":[[1702944000000,39078.47891755909],[1703030400000,38477.47402170458],[1703116800000,39864.87762044923],[1703203200000,39838.679877640185],[1703289600000,39908.58005878162],[1703376000000,39678.979321595696],[1703462400000,39062.32681431535],[1703548800000,39597.85927945271],[1703635200000,38502.06842500796],[1703721600000,39086.65066359461],[1703808000000,38491.64747698571],[1703894400000,38057.70863986569],[1703980800000,38189.68296890573],[1704067200000,38240.20908960317],[1704153600000,40022.56708386281],[1704240000000,41121.44236936086],[1704326400000,39193.97344095043],[1704412800000,40376.019880448854],[1704499200000,40269.190802082194],[1704585600000,40125.3447966974],[1704672000000,40118.34311925359],[1704758400000,42857.43103594771],[1704844800000,42178.411061608065],[1704931200000,42492.38965139214],[1705017600000,42171.814324539526],[1705104000000,39122.52373887039],[1705190400000,39081.06524302686],[1705276800000,38190.210045708205],[1705363200000,38908.89747537756],[1705449600000,39668.76253090919],[1705536000000,39242.29028152058],[1705622400000,37938.77972050555],[1705708800000,38150.14288219012],[1705795200000,38173.221525259156],[1705881600000,38141.44573510522],[1705968000000,36313.41944934261],[1706054400000,36689.35973905385],[1706140800000,36871.20615880076],[1706227200000,36811.15855147119],[1706313600000,38535.125270419456],[1706400000000,38771.39629759249],[1706486400000,38759.18018541519],[1706572800000,39930.07569963493],[1706659200000,39555.50605607913],[1706745600000,39390.4556124346],[1706832000000,39601.98542555142],[1706918400000,39978.18836096943],[1707004800000,39798.71036813004],[1707091200000,39517.8500683694],[1707177600000,39701.74708708336],[1707264000000,40053.71777001113],[1707350400000,41066.29173159883],[1707436800000,42076.0465628706],[1707523200000,43713.572063470674],[1707609600000,44293.80084671968],[1707696000000,44634.239554822176],[1707782400000,46463.69349243575],[1707868800000,46442.363953357555],[1707955200000,48260.30672871491],[1708041600000,48219.73170515296],[1708128000000,48405.75606037122],[1708214400000,47958.58062660045],[1708300800000,48348.85208766836],[1708387200000,48043.59788234124],[1708473600000,48367.898535816996],[1708560000000,47916.29005429376],[1708646400000,47410.49380112791],[1708732800000,46933.94401263771],[1708819200000,47591.24123045009],[1708905600000,47833.38664994704],[1708992000000,50208.13598783667],[1709078400000,52573.782674551876],[1709164800000,57717.736388579004],[1709251200000,56734.564615792624],[1709337600000,57560.48389994141],[1709424000000,57229.6765848964],[1709510400000,58157.09485482637],[1709596800000,62819.675032831015],[1709683200000,59216.16978710529],[1709769600000,60688.021041080945],[1709856000000,61130.91471064688],[1709942400000,62425.38416118097],[1710028800000,62601.51789297492],[1710115200000,63133.50171410394],[1710201600000,65996.21012712058],[1710288000000,65396.96618741416],[1710374400000,66750.17623162274],[1710460800000,65624.65332089699],[1710547200000,63816.32105192292],[1710633600000,59954.666681584524],[1710720000000,62871.803645507665],[1710806400000,62274.42066839416],[1710892800000,57178.75390064521],[1710979200000,62011.64214760789],[1711065600000,60327.113345413214],[1711152000000,58488.654960729786],[1711238400000,59204.01008039168],[1711324800000,62277.19869537941],[1711411200000,64530.77647863455],[1711497600000,64695.8250958296],[1711584000000,64211.47397847694],[1711670400000,65526.713768406174],[1711756800000,64739.24207573283],[1711843200000,64538.55260842681],[1711929600000,66012.15293045473],[1712016000000,64987.58440425927],[1712102400000,60773.862930874704],[1712188800000,61012.09522243375],[1712275200000,63241.87913574653],[1712361600000,62689.87435787321],[1712448000000,63632.39935297565],[1712534400000,64086.823460256426],[1712620800000,65931.06490439967],[1712707200000,63687.50350010323],[1712793600000,65668.16571700791],[1712880000000,65354.13336928861],[1712966400000,63099.287555906376],[1713052800000,60427.82751512378],[1713139200000,61736.684829580605],[1713225600000,59686.89912995451],[1713312000000,59995.209903171795],[1713398400000,57478.36312839251],[1713484800000,59623.56249209243],[1713571200000,60012.93722485975],[1713657600000,60862.26888013952],[1713744000000,60924.51880957888],[1713830400000,62738.59113235908],[1713916800000,62051.58606093932],[1714003200000,60081.61563815237],[1714089600000,60110.989276790104],[1714176000000,59659.006735859955],[1714262400000,59381.3230914825],[1714348800000,58876.98016307695],[1714435200000,59532.80475223963],[1714521600000,56955.30306317563],[1714608000000,54392.86086133425],[1714694400000,55109.42816389191],[1714780800000,58355.75377420205],[1714867200000,59266.86265965134],[1714953600000,59488.78971098448],[1715040000000,58653.24832859499],[1715126400000,57997.6431882983],[1715212800000,56957.965704980525],[1715299200000,58566.91642282563],[1715385600000,56489.04308941497],[1715472000000,56385.835846451875],[1715558400000,57100.99619053609],[1715644800000,58257.94727352527],[1715731200000,56927.17129981614],[1715817600000,60811.29527582236],[1715904000000,60054.301551755365],[1715990400000,61631.8782491127],[1716076800000,61502.73339909207],[1716163200000,60924.86820709035],[1716249600000,65770.16026770095],[1716336000000,64653.893276922405],[1716422400000,63912.083874721946],[1716508800000,62795.077789946045],[1716595200000,63150.07451451353],[1716681600000,63850.68338638202],[1716768000000,63150.48139241663],[1716854400000,63871.133659487794],[1716940800000,62950.705715262724],[1717027200000,62561.005165216935],[1717113600000,63123.741723088686],[1717200000000,62145.91785386879],[1717286400000,62362.92899401087],[1717372800000,62419.71597472404],[1717459200000,63083.78769270654],[1717545600000,64881.83386232028],[1717632000000,65462.71014376164],[1717718400000,64964.377920006424],[1717804800000,64146.75781805342],[1717891200000,64137.2658453789],[1717977600000,64623.80690329454],[1718064000000,64559.64845115045],[1718150400000,62689.904415286815],[1718236800000,63085.64417953837],[1718323200000,62107.46654002352],[1718409600000,61562.52612996296],[1718496000000,61759.23292317989],[1718582400000,62231.3694306833],[1718668800000,61877.28055510076],[1718755200000,60621.91572601943],[1718841600000,60398.36957706064],[1718928000000,60572.188509925974],[1719014400000,59924.844689378995],[1719100800000,60079.40613872267],[1719187200000,59147.18345045349],[1719273600000,56243.927094112085],[1719360000000,57677.50624706287],[1719446400000,56873.38456798354],[1719532800000,57491.13821425305],[1719619200000,56265.05472146868],[1719705600000,56775.63073475873],[1719792000000,58430.814422068135],[1719878400000,58509.4401642161],[1719964800000,57718.07416888454],[1720051200000,55833.80621748973],[1720137600000,52904.90433375453],[1720224000000,52307.68520432331],[1720310400000,53715.700026296974],[1720396800000,51613.90871758563],[1720483200000,52316.60116848915],[1720569600000,53621.436327802985],[1720656000000,53272.288732207024],[1720742400000,52781.06838693916],[1720828800000,53014.0364517072],[1720915200000,54166.67728993813],[1721001600000,55984.24278202276],[1721088000000,59500.95530894624],[1721174400000,59763.54497883689],[1721260800000,58625.721758164145],[1721347200000,58665.955279138856],[1721433600000,61224.60704078251],[1721520000000,61705.0466917566],[1721606400000,62467.87253811925],[1721692800000,62073.819234324954],[1721779200000,60765.80580937294],[1721865600000,60341.49772175119],[1721952000000,60594.574722199846],[1722038400000,62469.76061302131],[1722124800000,62599.81463153654],[1722211200000,62873.08389964636],[1722297600000,61707.72841612238],[1722384000000,61216.26793898385],[1722470400000,59750.92079501405],[1722556800000,60586.10315866606],[1722643200000,56231.21313117775],[1722729600000,55639.42359487421],[1722816000000,53169.53306907562],[1722902400000,49271.40149467704],[1722988800000,51222.280928669235],[1723075200000,50411.00101226333],[1723161600000,56671.842504303975],[1723248000000,55761.51548402803],[1723334400000,55729.910819518554],[1723420800000,53884.90745860033],[1723507200000,54270.12342034756],[1723593600000,55114.14602647766],[1723680000000,53343.88139134332],[1723766400000,52521.96236743676],[1723852800000,53376.171320376874],[1723939200000,53873.71546267861],[1724025600000,53006.74653077159],[1724112000000,53742.26074312489],[1724198400000,53072.96487740486],[1724284800000,54811.25973940124],[1724371200000,54317.08310206506],[1724457600000,57173.9518647258],[1724544000000,57319.03380665118],[1724630400000,57448.04865756021],[1724716800000,56355.54477751003],[1724803200000,53250.67556605576],[1724889600000,53049.55806257478],[1724976000000,53564.80049060293],[1725062400000,53481.26904169355],[1725148800000,53307.011182245114],[1725235200000,51929.8407759559],[1725321600000,53412.30560377036],[1725408000000,52046.1502790778],[1725494400000,52329.681939274866],[1725580800000,50518.54680242768],[1725667200000,48622.690205035346],[1725753600000,48827.90111822669],[1725840000000,49416.66965979366],[1725926400000,51694.7737107547],[1726012800000,52293.63869759159],[1726099200000,52115.49563129617],[1726185600000,52451.75030832475],[1726272000000,54674.77446852742],[1726358400000,54142.357125255534],[1726444800000,53407.547394791305],[1726531200000,52308.16606889451],[1726617600000,54228.992673647364],[1726704000000,55288.44506329167],[1726790400000,56427.20338319878],[1726876800000,56488.082242429715],[1726963200000,56759.67683409224],[1727049600000,56960.916902308025],[1727136000000,56989.44770900782],[1727222400000,57493.81502099898],[1727308800000,56737.43484845022],[1727395200000,58275.038981340615],[1727481600000,58891.82868753552],[1727568000000,59019.92695395789],[1727654400000,58791.91905839133],[1727740800000,56785.567724519715],[1727827200000,55018.60488254399],[1727913600000,54905.83731260847],[1728000000000,55029.88993283354],[1728086400000,56557.5221526609],[1728172800000,56539.73406535857],[1728259200000,57252.32733417741],[1728345600000,56754.33895468004],[1728432000000,56657.33655044081],[1728518400000,55382.099090773205],[1728604800000,55055.71620633765],[1728691200000,57015.18140309107],[1728777600000,57760.33532582211],[1728864000000,57417.523313436555],[1728950400000,60551.20074941091],[1729036800000,61522.6779321783],[1729123200000,62295.13515961688],[1729209600000,62168.14661024002],[1729296000000,62971.25326535072],[1729382400000,62900.664368658116],[1729468800000,63461.0436312693],[1729555200000,62314.63337960675],[1729641600000,62379.86708703343],[1729728000000,61857.31577287963],[1729814400000,62996.90492256556],[1729900800000,61649.93632490859],[1729987200000,62050.376516974386],[1730073600000,62938.34448352703],[1730160000000,64580.714702132216],[1730246400000,67268.45323344307],[1730332800000,66618.65645361826],[1730419200000,64550.8369757725],[1730505600000,63941.79763295739],[1730592000000,63726.32978776158],[1730678400000,63270.25948561604],[1730764800000,62346.71648632486],[1730851200000,63437.06088138662],[1730937600000,70456.7357599368],[1731024000000,70367.30136816247],[1731110400000,71385.26799176612],[1731196800000,71493.3957234108],[1731283200000,75100.39122172692],[1731369600000,83136.67035524877],[1731456000000,83116.39043645399],[1731542400000,85646.80574476697],[1731628800000,83012.8378117053],[1731715200000,86243.41823875198],[1731801600000,85927.71877600063],[1731888000000,85275.3689714038],[1731974400000,85439.42645883636],[1732060800000,86966.37073765934],[1732147200000,89326.4051029836],[1732233600000,94069.11559788969],[1732320000000,94955.55602347082],[1732406400000,93760.27068972368],[1732492800000,93546.11482101932],[1732579200000,88960.11249694412],[1732665600000,87635.2127980843],[1732752000000,90869.12691365478],[1732838400000,90578.80838013266],[1732924800000,92112.0297646138],[1733011200000,91239.47122285848],[1733097600000,92304.33867392405],[1733184000000,91254.9956460552],[1733270400000,91374.28893844674],[1733356800000,94065.64524925785],[1733443200000,91830.04825245812],[1733529600000,94532.37474294563],[1733616000000,94396.5048454845],[1733702400000,95806.82736572677],[1733788800000,92230.50083900787],[1733875200000,91771.99667795865],[1733961600000,96256.94286515891],[1734048000000,95478.4718086457],[1734134400000,96474.24824906969],[1734220800000,96521.66753667717],[1734307200000,99631.30349379999],[1734393600000,100856.74619693069],[1734396005000,100857.82408798973]],"market_caps":[[1702944000000,764045559429.9309],[1703030400000,753661901693.3868],[1703116800000,780530401149.5747],[1703203200000,779398921861.9735],[1703289600000,781618872485.1848],[1703376000000,777082690166.5908],[1703462400000,767022708939.5092],[1703548800000,775395628458.022],[1703635200000,753811358997.4457],[1703721600000,764431847914.952],[1703808000000,755499387426.541],[1703894400000,744365987728.8765],[1703980800000,747690300646.6624],[1704067200000,749793913990.623],[1704153600000,782654769238.5906],[1704240000000,802781005990.2638],[1704326400000,767255728861.6259],[1704412800000,791548580238.1727],[1704499200000,788420193391.969],[1704585600000,786156615466.8936],[1704672000000,783483447081.5107],[1704758400000,839801871053.8757],[1704844800000,825360034647.3444],[1704931200000,834081331690.4401],[1705017600000,828583454756.0026],[1705104000000,764669480252.108],[1705190400000,765413030638.2758],[1705276800000,751728074198.5833],[1705363200000,763009829957.6416],[1705449600000,777614406833.8657],[1705536000000,769011178459.9075],[1705622400000,743690861843.4908],[1705708800000,747617250694.5536],[1705795200000,749429420625.5665],[1705881600000,748057990952.723],[1705968000000,712368205942.2236],[1706054400000,717595846224.838],[1706140800000,723122348942.4839],[1706227200000,722256139684.4453],[1706313600000,755726914732.5784],[1706400000000,760573087967.9829],[1706486400000,760145533102.0594],[1706572800000,783768195098.995],[1706659200000,773940797300.2744],[1706745600000,772787325782.8993],[1706832000000,776719396542.2999],[1706918400000,783958733249.4813],[1707004800000,780353189423.5363],[1707091200000,775166129480.905],[1707177600000,778777836396.1644],[1707264000000,785970965415.3887],[1707350400000,806224953741.7788],[1707436800000,826409667638.9438],[1707523200000,858208751753.8303],[1707609600000,869955939250.7516],[1707696000000,875978364782.8907],[1707782400000,911118983788.3319],[1707868800000,909849453848.8177],[1707955200000,948242282042.772],[1708041600000,947310107637.3593],[1708128000000,950197730601.678],[1708214400000,942550827895.1658],[1708300800000,949322898904.7262],[1708387200000,942991011917.1135],[1708473600000,949540001949.272],[1708560000000,941627317726.0989],[1708646400000,930501637905.6324],[1708732800000,922355633704.3813],[1708819200000,934676374407.968],[1708905600000,939479759011.2206],[1708992000000,986997076569.4227],[1709078400000,1031955351342.0142],[1709164800000,1130411922559.5562],[1709251200000,1117043914029.6543],[1709337600000,1132012429589.901],[1709424000000,1124332376821.0593],[1709510400000,1140239593736.3315],[1709596800000,1228771711791.6702],[1709683200000,1165166845467.8345],[1709769600000,1190756605244.6602],[1709856000000,1203016564461.5864],[1709942400000,1225358206016.94],[1710028800000,1229978177507.9448],[1710115200000,1240532622108.6042],[1710201600000,1297198119272.7556],[1710288000000,1284621855311.5063],[1710374400000,1311710453331.1807],[1710460800000,1289935627507.947],[1710547200000,1255862277359.9707],[1710633600000,1177567732739.3704],[1710720000000,1235543252546.1501],[1710806400000,1224902554138.9043],[1710892800000,1126404736225.0005],[1710979200000,1218425490228.851],[1711065600000,1185130051154.7644],[1711152000000,1148762056120.8308],[1711238400000,1164746053086.3816],[1711324800000,1224549270763.7375],[1711411200000,1265735595022.6558],[1711497600000,1270001087597.4917],[1711584000000,1257948244675.7322],[1711670400000,1289062232208.1372],[1711756800000,1272808920844.3113],[1711843200000,1268735443309.547],[1711929600000,1298379310622.5427],[1712016000000,1279434155078.9397],[1712102400000,1196304599517.0796],[1712188800000,1201042014718.3618],[1712275200000,1244181203942.2173],[1712361600000,1233398772850.8083],[1712448000000,1252853847882.3098],[1712534400000,1262195994485.1626],[1712620800000,1298271561930.8398],[1712707200000,1254048562016.6165],[1712793600000,1291829474485.008],[1712880000000,1286022438247.104],[1712966400000,1240036468179.4954],[1713052800000,1191586427540.0698],[1713139200000,1214419196128.5972],[1713225600000,1174217480691.2903],[1713312000000,1180219579685.6067],[1713398400000,1131391929592.0496],[1713484800000,1174027153438.296],[1713571200000,1184813761326.875],[1713657600000,1198537261371.2727],[1713744000000,1200575636208.7861],[1713830400000,1236171486303.3884],[1713916800000,1221220335945.559],[1714003200000,1182986317158.927],[1714089600000,1183322986546.24],[1714176000000,1174004613361.7327],[1714262400000,1168134415693.9995],[1714348800000,1159037915185.4558],[1714435200000,1173144443638.821],[1714521600000,1122733421392.7615],[1714608000000,1074539282758.3136],[1714694400000,1085640313340.4697],[1714780800000,1151356095639.7876],[1714867200000,1167823420330.3193],[1714953600000,1170693158689.583],[1715040000000,1155394777129.147],[1715126400000,1143529004292.6711],[1715212800000,1120237757734.764],[1715299200000,1150877656960.4106],[1715385600000,1112737515566.075],[1715472000000,1110612255834.1973],[1715558400000,1124453150567.785],[1715644800000,1148051981903.983],[1715731200000,1121416977137.8594],[1715817600000,1200367522106.6362],[1715904000000,1183686599329.002],[1715990400000,1212577969927.9417],[1716076800000,1213212301806.6638],[1716163200000,1199871409788.1362],[1716249600000,1295016060059.1472],[1716336000000,1273106118664.916],[1716422400000,1258222473590.343],[1716508800000,1235720348593.309],[1716595200000,1244542923268.9268],[1716681600000,1257314123353.6438],[1716768000000,1243813340333.789],[1716854400000,1258601999436.9578],[1716940800000,1241636599638.2234],[1717027200000,1232802172226.9258],[1717113600000,1242748884197.98],[1717200000000,1226438800629.8735],[1717286400000,1228433941518.9446],[1717372800000,1231006583667.743],[1717459200000,1242762702466.981],[1717545600000,1278263906372.3005],[1717632000000,1287689992253.43],[1717718400000,1280663158196.4136],[1717804800000,1264299316495.0254],[1717891200000,1264020591899.3923],[1717977600000,1273609983761.1584],[1718064000000,1272210501370.2603],[1718150400000,1236256618655.0908],[1718236800000,1244029473920.9504],[1718323200000,1226474851982.018],[1718409600000,1214209737400.5469],[1718496000000,1217046635445.1626],[1718582400000,1227595179188.131],[1718668800000,1219051116802.9226],[1718755200000,1193916188008.191],[1718841600000,1189652390521.7627],[1718928000000,1195025470628.2522],[1719014400000,1181499377294.3064],[1719100800000,1184321835834.7974],[1719187200000,1167675702293.7664],[1719273600000,1107858256415.485],[1719360000000,1137194446940.2493],[1719446400000,1121746795196.9453],[1719532800000,1133540553897.4954],[1719619200000,1109655746534.5195],[1719705600000,1119192024599.859],[1719792000000,1151840688521.5325],[1719878400000,1153842325231.202],[1719964800000,1137636248797.9766],[1720051200000,1099959601411.4194],[1720137600000,1045455213793.5796],[1720224000000,1031120886833.7273],[1720310400000,1058232307989.9891],[1720396800000,1016418261442.7322],[1720483200000,1031886535204.6488],[1720569600000,1058511512538.3088],[1720656000000,1051818926340.8833],[1720742400000,1040185593841.387],[1720828800000,1045247628106.2981],[1720915200000,1069888561366.5227],[1721001600000,1106207687377.5999],[1721088000000,1172591088151.519],[1721174400000,1178656334961.6272],[1721260800000,1157075741795.815],[1721347200000,1157133857736.086],[1721433600000,1208294383639.0444],[1721520000000,1217149815021.6057],[1721606400000,1232461528971.5544],[1721692800000,1224219293321.9321],[1721779200000,1198835347285.7869],[1721865600000,1190570334458.9207],[1721952000000,1195542086259.1108],[1722038400000,1232400087482.9558],[1722124800000,1235238043388.1118],[1722211200000,1240304376596.7764],[1722297600000,1217681073144.4795],[1722384000000,1208037973353.6438],[1722470400000,1178510499183.3403],[1722556800000,1194838474557.0352],[1722643200000,1109705678810.4106],[1722729600000,1097387256676.079],[1722816000000,1052498007467.1093],[1722902400000,972427918423.3748],[1722988800000,1010553135277.3352],[1723075200000,995829528973.5793],[1723161600000,1116222608474.5273],[1723248000000,1096966222757.3721],[1723334400000,1100012902964.6958],[1723420800000,1062177229408.719],[1723507200000,1071240180223.895],[1723593600000,1087488608146.0857],[1723680000000,1053042558016.0778],[1723766400000,1036457024309.6311],[1723852800000,1053996298299.8085],[1723939200000,1063563839568.8687],[1724025600000,1048736410107.2246],[1724112000000,1061067922878.8774],[1724198400000,1047855615204.1729],[1724284800000,1082245173425.6625],[1724371200000,1072480197942.716],[1724457600000,1126449704877.065],[1724544000000,1130137190128.4998],[1724630400000,1134445401094.1704],[1724716800000,1112777064777.5403],[1724803200000,1052696200890.6747],[1724889600000,1048104543360.7959],[1724976000000,1057603318248.8383],[1725062400000,1056174914763.6614],[1725148800000,1052644976421.7173],[1725235200000,1025971504101.7284],[1725321600000,1055774373172.189],[1725408000000,1029402103522.1177],[1725494400000,1033215644314.5056],[1725580800000,998279096382.0908],[1725667200000,960727122442.3049],[1725753600000,963876478138.5984],[1725840000000,978789756851.9156],[1725926400000,1021080494896.519],[1726012800000,1032514469645.9021],[1726099200000,1030116857690.4011],[1726185600000,1036768569791.1576],[1726272000000,1080345335187.4402],[1726358400000,1069483699270.5634],[1726444800000,1054918116527.0073],[1726531200000,1033801760122.5457],[1726617600000,1071488975861.3236],[1726704000000,1090617713058.4265],[1726790400000,1114446751303.7446],[1726876800000,1115365405107.757],[1726963200000,1122693086016.0098],[1727049600000,1125222965632.3362],[1727136000000,1125923016568.3755],[1727222400000,1136025045157.7083],[1727308800000,1119165941254.2256],[1727395200000,1151723722886.6248],[1727481600000,1163414323043.4895],[1727568000000,1166555764895.319],[1727654400000,1162004270981.7502],[1727740800000,1121955923185.1003],[1727827200000,1087242811870.4403],[1727913600000,1085088202725.9215],[1728000000000,1087741100651.1527],[1728086400000,1117128576184.053],[1728172800000,1117066123002.787],[1728259200000,1131919568773.6216],[1728345600000,1121655031340.7485],[1728432000000,1120296945863.3242],[1728518400000,1094687997044.0862],[1728604800000,1088058691272.9097],[1728691200000,1127062755021.9717],[1728777600000,1141359509847.64],[1728864000000,1134323870057.25],[1728950400000,1197356598803.713],[1729036800000,1215867091585.8062],[1729123200000,1231494200521.79],[1729209600000,1228557191099.4949],[1729296000000,1244920069909.3826],[1729382400000,1243448974215.4006],[1729468800000,1253692236055.3801],[1729555200000,1231860087149.921],[1729641600000,1233160899216.1892],[1729728000000,1222780930737.8003],[1729814400000,1244798930657.2415],[1729900800000,1216575374276.9106],[1729987200000,1226960927651.153],[1730073600000,1244481292778.0234],[1730160000000,1276885375262.7925],[1730246400000,1330292730940.5366],[1730332800000,1317853770698.0745],[1730419200000,1277141006442.827],[1730505600000,1264603721992.7305],[1730592000000,1260304002327.4312],[1730678400000,1252514111441.5698],[1730764800000,1232424950327.2417],[1730851200000,1254425017928.7395],[1730937600000,1394022982578.445],[1731024000000,1391245051949.168],[1731110400000,1411897389187.6711],[1731196800000,1417614104649.186],[1731283200000,1484434748459.1074],[1731369600000,1647828731487.2427],[1731456000000,1640041552819.5366],[1731542400000,1694929711862.1062],[1731628800000,1639737492315.8826],[1731715200000,1706203252031.6326],[1731801600000,1697962280123.0564],[1731888000000,1686578526653.0322],[1731974400000,1689949263959.0898],[1732060800000,1720695713494.1255],[1732147200000,1766101580550.202],[1732233600000,1861205978707.735],[1732320000000,1879473647269.3767],[1732406400000,1853767867711.6104],[1732492800000,1850862266537.5037],[1732579200000,1757981270636.0205],[1732665600000,1734807678369.8247],[1732752000000,1798047653070.2747],[1732838400000,1791871712985.0552],[1732924800000,1821220595631.0247],[1733011200000,1805655347652.551],[1733097600000,1826712092790.8245],[1733184000000,1805973641926.7527],[1733270400000,1808870011532.4983],[1733356800000,1861950970195.8547],[1733443200000,1814513963950.151],[1733529600000,1870708184255.423],[1733616000000,1868160448106.8904],[1733702400000,1895819284477.133],[1733788800000,1824685578367.7026],[1733875200000,1816541694218.0803],[1733961600000,1905410387343.5999],[1734048000000,1889662319163.5203],[1734134400000,1908887834839.7786],[1734220800000,1911680889414.6633],[1734307200000,1974756090871.2612],[1734393600000,1994542016925.7861],[1734396005000,1997412290393.3455]],"total_volumes":[[1702944000000,24236756809.610874],[1703030400000,21312795316.66426],[1703116800000,25887016911.17018],[1703203200000,19940952368.916634],[1703289600000,18895067898.906437],[1703376000000,8953022262.130066],[1703462400000,16623374495.489248],[1703548800000,17009181022.074778],[1703635200000,18544256378.162125],[1703721600000,20925648865.060066],[1703808000000,18375029769.578327],[1703894400000,22461574030.714294],[1703980800000,13321172326.845724],[1704067200000,12850316555.324738],[1704153600000,15367058214.745464],[1704240000000,35725011405.88339],[1704326400000,39491078579.2771],[1704412800000,23866156229.01105],[1704499200000,26805544307.690857],[1704585600000,10809150081.41469],[1704672000000,13845181930.24744],[1704758400000,37274113826.374435],[1704844800000,36490066076.38239],[1704931200000,47410932764.19392],[1705017600000,44797651373.354866],[1705104000000,41876420338.82902],[1705190400000,17716846311.352158],[1705276800000,15503197379.230145],[1705363200000,20679492660.517693],[1705449600000,20247282080.206425],[1705536000000,19567983377.45631],[1705622400000,23134362082.989418],[1705708800000,22383239893.13225],[1705795200000,8742685618.842075],[1705881600000,7375172401.676388],[1705968000000,28682189093.05966],[1706054400000,27340392964.10615],[1706140800000,20416186504.057236],[1706227200000,12329524792.522268],[1706313600000,20878573788.263638],[1706400000000,9844140113.16917],[1706486400000,12607124883.848349],[1706572800000,19085104248.29378],[1706659200000,22618759527.17684],[1706745600000,20533587440.086643],[1706832000000,20636966305.840107],[1706918400000,17247488100.16845],[1707004800000,7204501674.165378],[1707091200000,10436964474.709417],[1707177600000,17391461496.537296],[1707264000000,15924809340.146698],[1707350400000,19676663584.994637],[1707436800000,25715815919.968224],[1707523200000,38938892280.48865],[1707609600000,15263610371.064165],[1707696000000,12223157201.843592],[1707782400000,34984086720.421394],[1707868800000,34861630132.88448],[1707955200000,38955768310.822464],[1708041600000,29689990497.43616],[1708128000000,23058964466.517426],[1708214400000,18420761945.184425],[1708300800000,15788371337.35062],[1708387200000,20933904079.177547],[1708473600000,31913880466.34793],[1708560000000,28304827430.508766],[1708646400000,21925852529.42366],[1708732800000,20897974088.66788],[1708819200000,14334928103.442892],[1708905600000,14284884544.825203],[1708992000000,32632631614.771385],[1709078400000,47944138521.27305],[1709164800000,80469773523.04562],[1709251200000,62652966681.79769],[1709337600000,33838491238.65334],[1709424000000,23234013063.10625],[1709510400000,25003431615.645008],[1709596800000,68683749167.89397],[1709683200000,88793359828.09514],[1709769600000,67115921901.30683],[1709856000000,44611078613.12767],[1709942400000,57885098776.72138],[1710028800000,19518157761.86789],[1710115200000,33506857287.23204],[1710201600000,60984557068.80768],[1710288000000,59112467277.932526],[1710374400000,47399187528.719086],[1710460800000,57955447999.744316],[1710547200000,74565965097.54878],[1710633600000,45237986618.562836],[1710720000000,43360819029.21664],[1710806400000,47000236982.08203],[1710892800000,73786793068.606],[1710979200000,64770977376.002335],[1711065600000,44547287696.10954],[1711152000000,39081986975.866745],[1711238400000,23474954022.615948],[1711324800000,25997014256.79051],[1711411200000,41354490140.194534],[1711497600000,33470731576.137875],[1711584000000,38323058412.463455],[1711670400000,28222733898.22986],[1711756800000,23875651073.0657],[1711843200000,15193189000.910406],[1711929600000,18273877855.502132],[1712016000000,33562044549.864765],[1712102400000,41940693527.11473],[1712188800000,32810919678.179626],[1712275200000,34615710161.11247],[1712361600000,32399476179.27087],[1712448000000,17631945851.64823],[1712534400000,16561889813.524487],[1712620800000,30480013239.47029],[1712707200000,33601878224.764893],[1712793600000,35733622227.3955],[1712880000000,28076812702.66515],[1712966400000,40787556830.5058],[1713052800000,46175487248.79834],[1713139200000,37831941525.483795],[1713225600000,40270749314.591446],[1713312000000,39692534875.41359],[1713398400000,38541431787.99773],[1713484800000,33730360102.954216],[1713571200000,48982665986.2395],[1713657600000,15570292448.765707],[1713744000000,18381678273.477943],[1713830400000,26045239342.36995],[1713916800000,21708521696.923584],[1714003200000,28919311055.77435],[1714089600000,23029161947.69737],[1714176000000,21788821603.454067],[1714262400000,17940895060.380325],[1714348800000,15114077954.721254],[1714435200000,25421790237.986824],[1714521600000,37064033196.407425],[1714608000000,47686124997.17279],[1714694400000,26331959408.546562],[1714780800000,31194900456.511097],[1714867200000,19047182119.65269],[1714953600000,16836129152.427391],[1715040000000,16635968731.550478],[1715126400000,18530378080.389984],[1715212800000,18891699679.907948],[1715299200000,23963094002.49368],[1715385600000,22254420525.397045],[1715472000000,11244904093.616146],[1715558400000,12111167668.150711],[1715644800000,25701869152.978073],[1715731200000,19954749749.200596],[1715817600000,34989448098.62592],[1715904000000,26791795060.979183],[1715990400000,23344382280.64292],[1716076800000,11972376997.253046],[1716163200000,8343132501.680276],[1716249600000,33076900352.36851],[1716336000000,37863059660.65226],[1716422400000,28693829269.986565],[1716508800000,36282391585.036026],[1716595200000,25915528544.90744],[1716681600000,14683494912.702457],[1716768000000,10364325595.831345],[1716854400000,17479681941.591335],[1716940800000,28821382088.28565],[1717027200000,22515367160.244823],[1717113600000,23398765116.409836],[1717200000000,18130599420.539665],[1717286400000,9878000585.622467],[1717372800000,14869923072.588507],[1717459200000,27377900221.38685],[1717545600000,29004797739.730236],[1717632000000,29943165536.127033],[1717718400000,21678984842.985905],[1717804800000,17208262650.83919],[1717891200000,9889885385.793055],[1717977600000,9705557901.477417],[1718064000000,17963155583.8117],[1718150400000,35859341572.46878],[1718236800000,33314086852.608078],[1718323200000,27612809188.818436],[1718409600000,26082269218.757824],[1718496000000,12570767640.817629],[1718582400000,11817587184.625206],[1718668800000,27381634087.485992],[1718755200000,38534540549.638336],[1718841600000,20174670906.88063],[1718928000000,24288361251.269745],[1719014400000,23096069748.525814],[1719100800000,5929957294.213889],[1719187200000,10055620107.878874],[1719273600000,39167894649.76987],[1719360000000,19707107706.19171],[1719446400000,21446724014.390743],[1719532800000,17608135427.23568],[1719619200000,22760288280.98671],[1719705600000,10666911569.81817],[1719792000000,16181763633.619421],[1719878400000,23818378375.692726],[1719964800000,16838886952.541449],[1720051200000,28126682562.287437],[1720137600000,39882312622.7753],[1720224000000,55388162417.01709],[1720310400000,19642932662.272545],[1720396800000,18668734939.988163],[1720483200000,38420746451.49442],[1720569600000,26274120844.467396],[1720656000000,23991700389.182217],[1720742400000,26852746247.844795],[1720828800000,23352541611.613438],[1720915200000,15352362821.061203],[1721001600000,19562980897.157185],[1721088000000,34699131677.40675],[1721174400000,37524680143.79378],[1721260800000,30584615622.361465],[1721347200000,23826232916.692142],[1721433600000,33963050379.528145],[1721520000000,15932968631.498928],[1721606400000,24843581686.185513],[1721692800000,39625015138.62209],[1721779200000,33266571810.64418],[1721865600000,26460367769.009254],[1721952000000,33026960946.45104],[1722038400000,28347985942.522514],[1722124800000,28493532219.991848],[1722211200000,15823930171.331104],[1722297600000,39304449047.5405],[1722384000000,26709586357.683525],[1722470400000,29010595429.980762],[1722556800000,36070582812.4214],[1722643200000,35716608343.00602],[1722729600000,30124639091.24687],[1722816000000,30857488073.92184],[1722902400000,109805375344.71971],[1722988800000,48165283096.90922],[1723075200000,38065296810.65033],[1723161600000,45075752485.89274],[1723248000000,30945556000.44254],[1723334400000,12282202454.06668],[1723420800000,19899321258.11229],[1723507200000,36030650038.289856],[1723593600000,29062190504.223873],[1723680000000,25500715375.97391],[1723766400000,30524957963.753498],[1723852800000,27528656719.12384],[1723939200000,11301669424.835934],[1724025600000,16014988081.814625],[1724112000000,21678542798.058605],[1724198400000,28280403717.648746],[1724284800000,29546835293.844273],[1724371200000,25338482846.447086],[1724457600000,40203764990.14742],[1724544000000,19681198155.428112],[1724630400000,15978900606.43484],[1724716800000,16027077290.044294],[1724803200000,34111499405.192535],[1724889600000,37771373954.530266],[1724976000000,29388408896.179905],[1725062400000,39813795557.68244],[1725148800000,10306119140.205893],[1725235200000,23055759148.414356],[1725321600000,25313134436.021263],[1725408000000,24283254518.8608],[1725494400000,33886402300.26096],[1725580800000,27004866037.61644],[1725667200000,45320178289.28158],[1725753600000,15372585933.106846],[1725840000000,16815561367.908846],[1725926400000,32308980055.771793],[1726012800000,26930906291.377064],[1726099200000,34299672189.86188],[1726185600000,30851533892.901806],[1726272000000,28788956794.35168],[1726358400000,14256812437.764132],[1726444800000,15593989422.240282],[1726531200000,28931645426.28441],[1726617600000,30740118553.114304],[1726704000000,36395588024.81709],[1726790400000,37601462347.57837],[1726876800000,31844524527.859264],[1726963200000,11582366076.384974],[1727049600000,18230121450.62975],[1727136000000,21597115107.60136],[1727222400000,28142705656.780155],[1727308800000,23437869613.173584],[1727395200000,33996117325.546436],[1727481600000,29239510929.881367],[1727568000000,13733976640.534172],[1727654400000,11593612614.885637],[1727740800000,31537924652.0654],[1727827200000,49034177042.745705],[1727913600000,37901679060.51742],[1728000000000,34172777744.048645],[1728086400000,27639040540.389217],[1728172800000,10103308836.609213],[1728259200000,13300847513.28617],[1728345600000,30869381700.261482],[1728432000000,26081711472.44388],[1728518400000,26075363404.124302],[1728604800000,26964801126.052986],[1728691200000,29250057048.886543],[1728777600000,16143457901.477922],[1728864000000,15338765154.550152],[1728950400000,42678099498.38608],[1729036800000,47590231395.44467],[1729123200000,37424938104.72408],[1729209600000,31867101644.482155],[1729296000000,36776163863.41151],[1729382400000,12978490558.257559],[1729468800000,15877367461.98269],[1729555200000,37433699396.538925],[1729641600000,29080874803.888737],[1729728000000,30311730450.974777],[1729814400000,33147468234.34605],[1729900800000,44837230618.6183],[1729987200000,19600259820.499084],[1730073600000,15316545074.05997],[1730160000000,38825503403.448814],[1730246400000,60527540932.56764],[1730332800000,40056440641.14229],[1730419200000,42173773194.33304],[1730505600000,50469710696.11748],[1730592000000,13526495563.210878],[1730678400000,34630826043.86812],[1730764800000,42472713673.43949],[1730851200000,36620093013.85483],[1730937600000,119717779475.74457],[1731024000000,61665436983.2205],[1731110400000,47267635583.06925],[1731196800000,29323966699.251873],[1731283200000,87239403420.88857],[1731369600000,125646393751.07103],[1731456000000,143470295938.74728],[1731542400000,128767560174.35379],[1731628800000,94639219723.79593],[1731715200000,80017548477.67146],[1731801600000,46711735711.32105],[1731888000000,46088268734.089355],[1731974400000,73036195338.83128],[1732060800000,75881616541.24971],[1732147200000,76555842681.1068],[1732233600000,112837970883.96764],[1732320000000,82303465655.24199],[1732406400000,45511800251.80984],[1732492800000,48355173230.56986],[1732579200000,85585174959.04805],[1732665600000,92837558437.63956],[1732752000000,77130214035.7825],[1732838400000,46460805592.15066],[1732924800000,70577516541.62772],[1733011200000,41198720283.14104],[1733097600000,46618694880.34837],[1733184000000,96193940544.53133],[1733270400000,83671044173.51279],[1733356800000,93446650410.37816],[1733443200000,179935267250.6917],[1733529600000,109509066272.2067],[1733616000000,57765605617.94603],[1733702400000,59316795003.98513],[1733788800000,139118734393.82437],[1733875200000,119485287617.8021],[1733961600000,112782750873.94843],[1734048000000,95565580844.76036],[1734134400000,75010198346.95139],[1734220800000,54581936836.852325],[1734307200000,67211229482.25423],[1734393600000,109519261247.90494],[1734396005000,105347250732.53983]] +} diff --git a/example/lib/presentation/presentation_utils.dart b/example/lib/presentation/presentation_utils.dart new file mode 100644 index 000000000..60967d4a0 --- /dev/null +++ b/example/lib/presentation/presentation_utils.dart @@ -0,0 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:intl/intl.dart'; + +class AppUtils { + static String getFormattedCurrency(BuildContext context, + double value, { + bool noDecimals = true, + }) { + final germanFormat = NumberFormat.currency( + symbol: '€', + decimalDigits: noDecimals && value % 1 == 0 ? 0 : 2, + ); + return germanFormat.format(value); + } +} diff --git a/example/lib/presentation/samples/chart_samples.dart b/example/lib/presentation/samples/chart_samples.dart index 98e090148..e058a1e8d 100644 --- a/example/lib/presentation/samples/chart_samples.dart +++ b/example/lib/presentation/samples/chart_samples.dart @@ -12,6 +12,7 @@ import 'chart_sample.dart'; import 'line/line_chart_sample1.dart'; import 'line/line_chart_sample10.dart'; import 'line/line_chart_sample11.dart'; +import 'line/line_chart_sample12.dart'; import 'line/line_chart_sample2.dart'; import 'line/line_chart_sample3.dart'; import 'line/line_chart_sample4.dart'; @@ -41,6 +42,7 @@ class ChartSamples { LineChartSample(9, (context) => LineChartSample9()), LineChartSample(10, (context) => const LineChartSample10()), LineChartSample(11, (context) => const LineChartSample11()), + LineChartSample(12, (context) => const LineChartSample12()), ], ChartType.bar: [ BarChartSample(1, (context) => BarChartSample1()), diff --git a/example/lib/presentation/samples/line/line_chart_sample12.dart b/example/lib/presentation/samples/line/line_chart_sample12.dart new file mode 100644 index 000000000..12faa6735 --- /dev/null +++ b/example/lib/presentation/samples/line/line_chart_sample12.dart @@ -0,0 +1,219 @@ +import 'dart:convert'; + +import 'package:fl_chart/fl_chart.dart'; +import 'package:fl_chart_app/presentation/presentation_utils.dart'; +import 'package:fl_chart_app/presentation/resources/app_colors.dart'; +import 'package:fl_chart_app/util/extensions/color_extensions.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class LineChartSample12 extends StatefulWidget { + const LineChartSample12({super.key}); + + @override + State createState() => _LineChartSample12State(); +} + +class _LineChartSample12State extends State { + List<(DateTime, double)>? _bitcoinPriceHistory; + + @override + void initState() { + _reloadData(); + super.initState(); + } + + void _reloadData() async { + final dataStr = await rootBundle.loadString( + 'assets/data/btc_last_year_price.json', + ); + final json = jsonDecode(dataStr) as Map; + setState(() { + _bitcoinPriceHistory = (json['prices'] as List).map((item) { + final timestamp = item[0] as int; + final price = item[1] as double; + return (DateTime.fromMillisecondsSinceEpoch(timestamp), price); + }).toList(); + }); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + const SizedBox(height: 14), + const Text( + 'Bitcoin Price History', + style: TextStyle( + color: AppColors.contentColorYellow, + fontWeight: FontWeight.bold, + fontSize: 18 + ), + ), + const Text( + '2023/12/19 - 2024/12/17', + style: TextStyle( + color: AppColors.contentColorGreen, + fontWeight: FontWeight.bold, + fontSize: 14 + ), + ), + const SizedBox(height: 14), + AspectRatio( + aspectRatio: 1.5, + child: Padding( + padding: const EdgeInsets.only( + top: 0.0, + right: 18.0, + ), + child: LineChart( + LineChartData( + lineBarsData: [ + LineChartBarData( + spots: _bitcoinPriceHistory?.asMap().entries.map((e) { + final index = e.key; + final item = e.value; + final value = item.$2; + return FlSpot(index.toDouble(), value); + }).toList() ?? + [], + dotData: const FlDotData(show: false), + color: AppColors.contentColorYellow, + barWidth: 1, + shadow: const Shadow( + color: AppColors.contentColorYellow, + blurRadius: 2, + ), + belowBarData: BarAreaData( + show: true, + gradient: LinearGradient( + colors: [ + AppColors.contentColorYellow.withValues(alpha: 0.2), + AppColors.contentColorYellow.withValues(alpha: 0.0), + ], + stops: const [0.5, 1.0], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + ], + lineTouchData: LineTouchData( + touchSpotThreshold: 1, + getTouchLineStart: (_, __) => -double.infinity, + getTouchLineEnd: (_, __) => double.infinity, + getTouchedSpotIndicator: + (LineChartBarData barData, List spotIndexes) { + return spotIndexes.map((spotIndex) { + return TouchedSpotIndicatorData( + const FlLine( + color: AppColors.contentColorRed, + strokeWidth: 1.5, + dashArray: [8, 2], + ), + FlDotData( + show: true, + getDotPainter: (spot, percent, barData, index) { + return FlDotCirclePainter( + radius: 6, + color: AppColors.contentColorYellow, + strokeWidth: 0, + strokeColor: AppColors.contentColorYellow, + ); + }, + ), + ); + }).toList(); + }, + touchTooltipData: LineTouchTooltipData( + getTooltipItems: (List touchedBarSpots) { + return touchedBarSpots.map((barSpot) { + final price = barSpot.y; + final date = + _bitcoinPriceHistory![barSpot.x.toInt()].$1; + return LineTooltipItem( + '', + const TextStyle( + color: AppColors.contentColorBlack, + fontWeight: FontWeight.bold, + ), + children: [ + TextSpan( + text: '${date.year}/${date.month}/${date.day}', + style: TextStyle( + color: AppColors.contentColorGreen.darken(20), + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + TextSpan( + text: '\n${AppUtils.getFormattedCurrency( + context, + price, + noDecimals: true, + )}', + style: const TextStyle( + color: AppColors.contentColorYellow, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + ], + ); + }).toList(); + }, + getTooltipColor: (LineBarSpot barSpot) => + AppColors.contentColorBlack, + ), + ), + titlesData: FlTitlesData( + show: true, + rightTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + leftTitles: const AxisTitles( + drawBelowEverything: true, + sideTitles: SideTitles( + showTitles: true, + reservedSize: 52, + maxIncluded: false, + minIncluded: false, + ), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + reservedSize: 38, + maxIncluded: false, + getTitlesWidget: (double value, TitleMeta meta) { + final date = _bitcoinPriceHistory![value.toInt()].$1; + return SideTitleWidget( + axisSide: meta.axisSide, + child: Transform.rotate( + angle: -45 * 3.14 / 180, + child: Text( + '${date.month}/${date.day}', + style: const TextStyle( + color: AppColors.contentColorGreen, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ), + ); + }, + ), + ), + ), + ), + duration: Duration.zero, + ), + ), + ), + ], + ); + } +} diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 8fc3fc4ef..a36b9516f 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -32,4 +32,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift index 8e02df288..b3c176141 100644 --- a/example/macos/Runner/AppDelegate.swift +++ b/example/macos/Runner/AppDelegate.swift @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 76b7c4143..b2f5fe697 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -23,6 +23,7 @@ dependencies: flutter_bloc: ^8.1.6 package_info_plus: ^8.0.2 equatable: ^2.0.5 + intl: ^0.20.1 dev_dependencies: flutter_test: @@ -39,3 +40,4 @@ flutter: assets: - assets/icons/ - assets/fonts/ + - assets/data/