Skip to content

ramin/merge_dev_into_master #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 153 commits into from
Oct 17, 2023

Conversation

ramin-deriv
Copy link
Contributor

No description provided.

morteza-binary and others added 30 commits July 16, 2020 12:13
* Morteza/add_ci_config (#6)

* Added coverage to ignored list

* Added CI config to build the example app

* Morteza/add ci config (#8)

* Added coverage to ignored list

* Added CI config to build the example app

* Fixed the issue of working directory

* Set to always deploy the test coverage

* Added coveralls badge
* Adding loading before the first tick

* Limit scroll to the left

* Triggering onLoad callback

* Using Flutter deriv-api

* minor refactor

* Prepending historical data to candles

* Check to not make a history call more that once

* drawing loading bars

* Adding animation to loading

* Loading animation in half of height square

* Loading animation for the other half

* Getting history by setting count instead of start_time
 - Granularity may be wrong in the response got by setting start_time

* Loading in 75% of the screen

* Handling rightEpoch's lowerLimit not being passed by zoom gesture

* Fixed loading animation

* Fixed loading bar width & extracted paint func into a file

* Minor code cleanup

* Minor refactor

* Renamed onLoadMore to onLoadHistory

* Moved callback logic onScaleAndPanUpdate

* Fixing loading animation

* Fixed empty space in loading aniamtion on landscape

* Limit rightBoundEpoch lower limit in pan and panAndScale

* showing full-screen loading if candles are empty

* right epoch lower limit be as 2 screen width

* Minor refactor

* Minor refactor in paintLoading func

* Removed redundant check in if condition

* Fixed Jut-out in loading animation bars

* Minor refactor

* Minor improvment

* Minor fix

* Moved OnLoadHistory to a separate file

Co-authored-by: Morteza Tavanarad <[email protected]>
* Animating to current tick when arrow button is clicked

* Animation duration relative to distance so it animate by a similar pace every time

* Using a Tween Animation instead

* idea/codeStyle in gitignore

* Using only AnimationController again and have animation duration relative

* Removed relative duration.

* Hiding scrollToNow button while already animating

* Adding the animation time to its upperbound

* A separate getter to check arrow button be visible

* Minor refactor
* Find closest candle util function

* Return candle with closest epoch

* Prepare to split painter

* Extract current tick painter

* Extract grid painter

* Reduce chart painter dependencies

* Cleanup imports

* Rename custom gesture detector

* Add longpress callbacks

* TDD canvasXToEpoch

* Vertical line that snaps to candle on long press

* Move chart HUD outside chart area

* Extract paintText

* Tick crosshair label

* Rename function

* Candle crosshair

* Style and refactor candle details

* Switching between candle/line crosshair

* Move to widgets folder

* Handle longpress ourselves, to prevent zoom and pan lag when scale and long press gestures "fight on arena"

* Fix bug when crosshair is left behind, when all fingers lift off

* Refactor method called after number of fingers changed

* Vibrate on switching to crosshair mode

* IQ options style candle details

* Pass style

* Line style crosshair details

* Fix line style details background gradient

* Crosshair line gradient

* Refactor longpress handlers

* Animate scroll to now button

* Zoom out in crosshair mode

* Update crosshair when it is on last candle and candle values change

* Fix typo

* Tweak crosshair details style

* Morteza/add_ci_config (#6)

* Added coverage to ignored list

* Added CI config to build the example app

* Morteza/add ci config (#8)

* Added coverage to ignored list

* Added CI config to build the example app

* Fixed the issue of working directory

* Set to always deploy the test coverage

* Added coveralls badge

* Requested changes

* Fix: Current tick dot is missing on first tick after loading

* Remove invisible button (remove animation for now)

* Repaint loading animation only when it is visible

* Reduce crosshair details shadow

* Add const to Durations

Co-authored-by: Morteza Tavanarad <[email protected]>
* Changed the location of the apk file.

* Upgraded to the latest version of flutter-deriv-api
* Fix grid epochs for 24h interval

* Include left bound epoch for day intervals

* Refactor to represent interval as Duration

* Fix broken tests

* Update comment

* Use daysPerWeek static const instead of a literal

* Enforce output epochs to be sorted

* Add green tests

* Add green tests for 2h interval

* Add green tests for 4h interval

* Return start of Mondays for week interval

* Minor refactor

* Refactor

* Return as DateTime objects instead of epochs

* Add month interval

* Calc days until monday instead of while loop

* Add year, month and date time labels

* Update test name

* Update flutter-deriv-api

* Requested changes

* Refactor to use DateTime constructor cleverness

* Switch to UTC

* Missed UTC conversion

* Remove function names from test names, simplify test names
* Add ananlysis_options.yaml

* Add flutter analyze to CI (Ignoring lib and example for now to pass CI)

* Apply requested changes
* Adding MarketSelector

* Categorizing the list of markets and submarket

* Created the markets categorized list view

* Filtering list by typing in search bar

* Not showing submarket name when its list is empty

* not showing market name when its submarkets are filtered out

* Minor refactor

* Added OnAssetClicked callback

* Minor UI change

* used showBottomSheet to show market selector

* Adding search bar

* Switch to search mode and back

* Click callback for favorite

* Added symbols icons

* A little highlight on serach text sustring

* Placeholder for icons if its png not exist

* Some UI refactoring

* Fetch active symbols in example app

* Added symbol model

* Market selector button according to the design

* Some code refactoring

* Some code refactroing
 - Fixed padding in some png icons
 - More intervals in quote grid

* Minor code cleanup

* Fixed wrong quote label width in some symbols

* Fix review comments

* A typo fix

* Fix review comment

* Removed Project.xml

* Toggling asset's isFavorite in MarketSelector for now

* Animate to the selected symbol in MarketSelector

* Added AnimatedHighlight widget to highlight selected symbol in MarketSelector

* Used DraggableScrollableSheet to have drag to dismiss functionallity

* Fixed using selected symbol for API call

* Code cleanup

* Use the recent change flutter-deriv-api for initializing API

* Minor refactor

* Minor refactor

* Custom OverScroll Drag to dismiss

* Extracted drag-to-dismiss functionality into a separate widget

* Some code cleanup

* Completed search bar

* Cleanup SearchBar widget

* Added favorites list on top

* Add remove to favorites list with animation

* Intro animation for market selector (Default bottom sheet animation is a bit fast)

* Get the list of favorites from the outside too.

* Can pan to top again when over-scrolling to bottom

* Minor refactor

* Added widget test for MarketSelector

* Minor fix to avoid unwanted fling to bottom at start

* Minor change in onNotfication. (Not blocking scroll notification from bubbling up in widget tree)

* Test for assets filter search

* Code cleanup

* close search bar text controller on dispose

* Dispose FocusNode as well

* Fix widget test descriptions

* Fix not over-scrolling in iOS

* Fix requested changes

* requested changes

* Include Market and SubMarket titles in search

* Refactord checking contains text for in search

* Added NoResultPage for search

* Minor UI change

* Minor code cleanup

* Minor change.(requested comment)

* Fix NoResultPage icon size

* Added some documentations

* removed unused import

* Minor fix in some comments

* Fix review comments

* Fixed padding from top for NoResultPage

* Test case to check selected asset being highlighted

* Changed text favorites to favourites

* Changed to favourite spelling for varaibles, methods etc

Co-authored-by: Morteza Tavanarad <[email protected]>
* New way to call api initializer

* Preserve scroll momentum

* Use a single Stack

* Prepare for GestureManager extraction

* Register gesture callbacks using gesture manager

* Reduce boilerplate with a template method

* Remove gesture callbacks on dispose

* Refactor crosshair feature (few things left)

* Clean up imports

* Move update crosshair on last candle to CrosshairArea

* Move crosshair_painter

* Add todos

* Call passed callback when crosshair appears

* Mark all chart params for removal in crosshair

* Refactor crosshair zoom in/out

* Improve docs

* Clean up, stop momentum on touch

* Remove cascade invocations

* Remove unnecessary check

* Convert to const

* Update candles after applying momentum to remove gaps

* Reduce scrolling back limit

* Stop momentum when hitting a bound

* Add finals

* Stop existing momentum on scroll to now

* Update crosshairMode bool, add TODOs

* Chain calls to gesture manager

* Stick to one callback naming convention

* Call onLoadHistory after flinging and hitting the left limit

* Refactor scroll momentum callback

* Better var name

* Add doc comment to  CrosshairArea

* Add explanatory comments to gesture manager/detector

* Use AnimationController for simulation

* Update ios .pbxproj, ignore last build generated file

* Apply limits on momentum

* Move visible candles & quote targets update in build

This is to avoid gaps on the edges, when rightBoundEpoch is updated after visible candles. _onNewFrame, which previously updated visible candles, is called before all animation listeners, because listeners are registered after it and "transient callbacks" are called in registration order (see https://api.flutter.dev/flutter/widgets/WidgetsBinding/drawFrame.html for mode details).

* Stop momentum immediately on touch

* Load history as soon as missing data is visible

* Refactor history loading

* Use better var name

* Remove unnecessary call

Co-authored-by: Morteza Tavanarad <[email protected]>
* Added theme interface and example theme classes

* Minor refactor

* Adding painting style classes

* Use grid and CurrentTick style

* Add ChartPainting style to pass to ChartPainter and CrossHairPainter

* Use CandleStyle in paintCandle

* Dashed line for current tick indicator based on the design

* Background color for chart with Ink widget

* Some doc comments

* Test for ChartDefaultTheme

* Code cleanup

* Default values for style classes

* TODO to add cross-hair style later

* Fixed some requested changes

* Add default light and dark themes

* Add painting styles to theme

* Fix themes class documentation

* Fix LightTheme base08 color

* Minor refactor

* Define ChartTheme in MarketSelector widget

* Use theme in MarketSelector widgets

* Getting MarketSelectorButton style by constructor

* Code format and fix imports

* Moved assigning default theme to Chart widget build

* Made paintDashedLine a general function

* Moved _setChartPaintingStyle to initState

* Added documenation for painting style classes

* Added some TODOs

* A TODO in crosshair_details.dart

* A TODO in crosshair_painter.dart

* Add dimens to the ChartTheme
* New way to call api initializer

* Preserve scroll momentum

* Use a single Stack

* Prepare for GestureManager extraction

* Register gesture callbacks using gesture manager

* Reduce boilerplate with a template method

* Remove gesture callbacks on dispose

* Refactor crosshair feature (few things left)

* Clean up imports

* Move update crosshair on last candle to CrosshairArea

* Move crosshair_painter

* Add todos

* Call passed callback when crosshair appears

* Mark all chart params for removal in crosshair

* Refactor crosshair zoom in/out

* Improve docs

* Clean up, stop momentum on touch

* Remove cascade invocations

* Remove unnecessary check

* Convert to const

* Update candles after applying momentum to remove gaps

* Reduce scrolling back limit

* Stop momentum when hitting a bound

* Add finals

* Stop existing momentum on scroll to now

* Update crosshairMode bool, add TODOs

* Chain calls to gesture manager

* Move maxCurrentTickOffset

* Fix todos

* Move interval constants

* Provide model, move one var to the model

* Stick to one callback naming convention

* Call onLoadHistory after flinging and hitting the left limit

* Refactor scroll momentum callback

* Better var name

* Ignore .last_build_id

* Update project.pbxproj

* Move scale state to xAxisModel

* Use existing method to compute granularity

* Add doc comment to  CrosshairArea

* Add explanatory comments to gesture manager/detector

* Use AnimationController for simulation

* Update ios .pbxproj, ignore last build generated file

* Apply limits on momentum

* Move visible candles & quote targets update in build

This is to avoid gaps on the edges, when rightBoundEpoch is updated after visible candles. _onNewFrame, which previously updated visible candles, is called before all animation listeners, because listeners are registered after it and "transient callbacks" are called in registration order (see https://api.flutter.dev/flutter/widgets/WidgetsBinding/drawFrame.html for mode details).

* Stop momentum immediately on touch

* Load history as soon as missing data is visible

* Refactor history loading

* Use better var name

* Remove unnecessary call

* Add scale start handler

* Pass details

* Move scale update handler to x axis model

* Notify listeners

* Add x axis widget to register/remove gesture callbacks

* Add XAxis getter

* Store granularity in xaxis model

* Move defaultScale computation to xAxisModel

* Encapsulate granularity

* Simplify getters

* Add docs

* Make interval var private

* Move convertion method to xaxis model

* Use convertPxToMs directly

* Use convertMsToPx directly

* Use convert method

* Remove unused argument

* Use a method directly

* Use xaxis granularity

* Move rightBoundEpoch to  xAxis model

* Move some pan update logic

* Move nowEpoch

* Update x axis with canvas width

* Extract leftBoundEpoch computation

* Move scaleWithNowFixed

* Move scaleWithFocalPointFixed

* Move autopan state

* Crosshair area asks x axis model to stop autopan when crosshair is visible

* Add explanatory comment

* Extract remaining bits of scale logic

* Use XAxis widget that manages axis lifecycle

* Extract autopanning

* Extract x axis init

* Fix typo

* Extract maxRightBoundEpoch

* Move pan reset to updateGranularity

* Name bool

* Rename x axis width property

* Extract vertical scale method for readability

* Rename method

* Add missing notifyListeners call

* Pass firstCandleEpoch to x axis

* Make nowEpoch private

* Fix lint

* Remove breaking notifyListener

* Fixed crash on empty candles

* Call onNewTick each time candles update

* Move condition to updateGranularity

* Don't show scroll to now button when chart is empty

* Pass granularity to XAxis widget

* Move x axis init

* Use constructor instead of init

* Move granularity update handler to x axis widget

* Add todo

* Use named arguments

* Pass first candle epoch to x axis model

* Update first candle epoch in model

* Chain calls

* Add minRightBoundEpoch getter

* Get min scroll bound from x axis model

* Remove unused method

* Extract second responsibility

* Rename methods

* Only wrap changes in setState

* Move pan clamping to x axis model

* Move pan callback registration to x axis widget

* Move hasHitLimit getter to model

* Move epoch <-> x position convertion to model

* Use methods from provided model

* Switch Align with Center

* Add getter and setter for rightBoundEpoch

* Move rightBoundEpoch clamping to setter

* Use existing getter

* Use constructor initializers

* Set up another animation controller in x axis widget

* Copy scroll to now method

* Give controller to x axis model

* Fix null ref error

* Move scroll to now

* Fix compilation errors

* Add todo

* Refactor quote label area recalculation

* Grammar

* Move scroll momentum to x axis model

* Remove pan animation controller from chart.dart

* Make momentum method private

* Add doc comments

* Fix blunder

* Remove optional arg

* Extract into method for readability

* Add todo

* Add todo

* Better name

* Disable panning without data

* Expose only 1 bool if x axis is being animated

* Dispose of ticker

* Move autopan ticker to x axis

* Call datetime from constructor

* Refactor constructor

* Make scrolling limits private

* Add doc comment

* Group all private vars

* Make msPerPx private

* Move time grid interval to xaxis model, hide msPerPx

* Add doc

* Sort params

* Expose scale value instead of adding more responsibilities

* Simplify ticker callback

* Remove unused import

* Separate x and y axis grid paint functions

* Move x grid to x axis widget

* Create x_axis folder

* Separate x and y grid painters into files

* Separate x  and y grid paint functions into files

* Move x axis related files

* Break up large file

* Remove dependency

* Remove unnecessary assignment

* Fix tests

* Fix lint

* Use same fix as Ramin

* Remove todo

* Add docs

* Fix lint

* Add docs

* Fix lint

* Make fiels private

* Improve doc

* Add todos

* Add  test file

* Update lib/src/chart.dart

Co-authored-by: Morteza Tavanarad <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: Morteza Tavanarad <[email protected]>

* Move comment

* Clarify comment

* Use arrow functions

* Remove -1 granularity

* X-axis model docs

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Review change

* Add todos

* Delete broken test

* Provide theme

* Use provided theme

Co-authored-by: Morteza Tavanarad <[email protected]>
Co-authored-by: raminvakili-fs <[email protected]>
* Add docs

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Morteza Tavanarad <[email protected]>

* Update README.md

* Update README.md

Co-authored-by: Morteza Tavanarad <[email protected]>
* Pass granularity to chart instead of calculating

* Change comment

* Improve doc

* Stick to one term

* Update README.md
* Using ConnectionBloc to ws reconnecting

* Initialize ConnectionService in project

* Resume tick history and stream from where we disconnected

* Some UI refactoring

* Minor refactor

* Removed initializing ConnectionService (Will be initialized in ConnectionBloc internally)

* Using future to know whether previouse request was completed to make a new one

* Minor change in request completer flow

* Complete request after resuming connection too

* Moved assigning candles list inside setState

* await on previous request to complete and then request for the new one

* Fixed passing loadingRightBoundX

* Code cleanup

* Removed unused import

* Use TickHistorSubscription object instead of TickBase to unsubscirbe

* Remove hardcode R_50 and use symbol name instead

* Pass the pipSize gotten from API to the Chart

* Use the main flutter-deriv-api (WS and ConnectionBloc changes PR got merged)

* Fix not switching after previous subcription had and error

* Load first open symbol as the starting default

* Minor refactor

* Fixed calling getGranularityLabel func

* Replace print with dev.log

* Remove a redundant if condition

* Auto-scroll limit an offset from leftBoundEpoch

* await on _tickStreamSubscription.cancel()

* Merge functions _initTickStream and _resumeTickStream

* candles instead of firsEpochCandle for XAxisModel

* leftBoundEpoch getter instead of calculating

* Extract autoPan stop condition into a getter

* Combine _autoPanLimitHasReached and _autoPanning

* Clear candles after changing interval or symbol to show the loading animation

* Return in _handleTickStream when the condition is not met

* Return if _reuestCompleter is NOT completed

* Removed redundant setState

* Reversed if condition and return in ConnectionBloc.listen

* Added a TODO

* Hightlight selected asset in favorites list too if it was

* Update the broken test

* Added the removed setState with comment on connection change

* rename _autoPanLimitHasReached to _currentTickFarEnoughFromLeftBound

* Changed Disconnected status label text
* Extract function

* Only scale y when pan starts on price label area

Co-authored-by: Morteza Tavanarad <[email protected]>
* Remove start epoch history request check from example

* Remove redundant parameters

* Update docs

* Doc new line

* Fix history request rate

* Increase requested extension

* Remove loading logic from chart

* Remove no longer used state var

* Pass callback to xaxis

* Remove public rightBoundEpoch setter

* Add scroll and scale callbacks to model

* Load more data in example

* Only ui state changes in setstate

* Redundant remove

* Update readme

* Update README.md

Co-authored-by: raminvakili-fs <[email protected]>

Co-authored-by: raminvakili-fs <[email protected]>
* Added BaseSeries

* Added BaseRenderable

* Adding line series

* Minor refactor

* Refactored getMixMax method in BaseSeries

* Providing conversion functions for renderablea

* Replacing candles with BaseSeries

* Painting a line chart as POC

* Brought back cross-hair

* Calculate quoteLabelWidth incase mainSeries is not empty

* Code cleanup
 - Merge common codes for updating visibleEntries indices in BaseSeries

* visibleEntries getter for BaseSeries

* Minor fix
 - Fix special conditions in calculating lower/upper indices of visibleEntries

* Update docs of BaseSeries

* Generic type for BaseSeries

* Checkpoint: removing ChartStyle

* Styles for chart series

* CurrentTickStyle inside ChartPainting style

* Getting cross-hair info from the series itself

* Adding candle series

* Add CandleSeries
 - Paint candles in CandleRenderable
 - getMinMax method implememntation in CandleSeries
 - Switch between LineSeries and CandleSeries in example app

* Animate last candle paint in CandleRenderable

* Minor fix
 - Last visible candle was not painted if last candle wasn't in the frame

* Paint current tick dot

* Paint current tick indicator (label, dot, line)

* Code cleanup
- Fix imports
- Rename series update method

* Passing pipSize to get cross-hair info

* Fix animating last tick in LineSeries
 - Fix line area startX

* Code cleanup

* pipSize access in BaseRenderable

* Add secondarySeries
 - Added a sample MA to show multiple series usage

* Call didUpdate for secondarySeries as well

* Minor refactor in Indicators class

* Rename to base classes to Series & Renderable

* Remove left/right epochs from updateRenderable method

* Added MASeries

* Renderable of type Series

* Assigning visibleEntries of Series directly

* Removed visibleEntries param too from getMinMaxValues method

* Moved MASeries to indicators_series directory

* Sample Series & Renderable with multiple data series

* Add Chart Component

* doc update

* Use Compoenent in ChartPainter

* Minor refactor
 - _ChartImplementation only takes a list of Components which indludes on-chart indicators, markers, barriers,...

* Code cleanup

* Fix min/max value in SampleMultiSeries bing NaN sometimes

* Fix lint warnings in indicators.dart

* Calculating min/max by only one for loop on visibleEntries

* granularity in Series paint method

* Renamed Compoenent -> ChartData

* Updated doc

* Code cleanup

* updated README

* Minor refactor (renamed a method)

* Fix CandleSeries doc

* main visibleEntries as loadingRightBoundX

* Adding DataSeries

* Added DataSeries

* Removed duplicate code of calculating min/max in CandleSeries

* Code cleanup

* setState on clearing candles so Indicator's get clear too

* Made Chart series id optional
 - Using runtimeType if null

* Use MASeries inside SampleMultiSeries

* Default id for MASeries

* Update README

* Check min/maxQuote is valid before using it for AnimationControllers

* Added OHLCTypeSeries
 - To keep shared functionality between OHLC, CandelStick and Hollow

* OHLC type series folder structure

* Changed createRenderable method to return Renderable and set it in Series class

* Renamed Renderable -> SeriesPainter

* Removed Candle.tick constructor
 - Will be looking to chart data whether Candle or Tick as list of Tick.
* Added symbols SVG files

* Using SVGs + Removed PNGs

* Fix <defs> tag order in some SVG files

* Showing a message when Markets list is empty

* Placeholder for SVG icons while they're being parsed

* Fixed imports in market_selector directory

* MarketSelectorButton padding to 8

* Helper function to get path to the asset SVG

* A wrapper widget to add SvgPicture for MarketSelector symbols

* Latest version of flutter_svg

* Update doc in symbol_svg_picture

Co-authored-by: Morteza Tavanarad <[email protected]>
* Fixed off-screen loading

* Minor code cleanup

* Removed redundant leftPointY variable

* Fix lint warnings
* Show closed tag next to closed symbols

* Get history without subscription for closed symbols

* Added Platinum/USD icon

* cancle StreamSubscription on _initTickStream start

* adjustStartTime in request because of closed markets

* Added ChartController
 - scrollToNow after loading an asst

* Default value for Asset isOpen

* Check if Historical data isEmpty

* Adding TradingTimesReminder

* Filling map of market status changes

* Time to UTC

* Not adding change times that are alreay passed

* Use RegExp to check if time in String is valid

* Reinitiating current symbol when its status changes

* Code cleanup

* Minor change

* trading times reminder test

* Minor change on trading_times test

* Docs for trading_times.dart

* Ignore allDayClosed/allDayOpen symbols

* Removed SymbolStatusChange, Using Map instead

* Refresh market selector on market status change

* Jump option for scrollToNow

* Fix getting open/close times since was fixed in flutter-deriv_api

* Fixed updating _activeSymbols list

* Adding isLive property

* Update closed tag based on the design

* 0.5 opacity when isLive is false

* Disable current tick blinking when isLive is false

* Moved setup market reminder to a method

* resetting previous reminder when setting up a new one

* Changed endpoint to blue.binaryws.com

* Disabled opacity only for Chart data

* Code cleanup on market change reminder

* Callback method for getting TradingTimes

* Null check for secondarySeries

* Set reminder to rest on the next day

* Add doc for MarketChangeReminder

* scrollToNow method take bool animate

* ServerTime and status change times in UTC

* Format some files to have extra line at the end

* Add 5sec to timer finish time to make sure market change happened

* Minor fix in doc comment

* Requested changes

* Requested change for checking isScrollToLastTickAvailbale

* Minor review comment change

* _isLive null check

* isLive instead of _isLive

* Using BottomSheetController to update it after market status change

* fromJSON and toJSON for Asset class

* Unit test for showing closed tag

* Minor code cleanup

* ChartController callback not be private, No need for getter/setter

* addPostFrameCallback for calling scrollToLastTick

* Minor refactor: Directly use Future rather than using Completer

* Connect to QA45

* Connect to QA15
* Add function stubs

* Handle epoch gap of 0

* Calc px distance without gaps

* Test when gaps dont overlap

* Handle the case when gap covers whole range

* Rename class

* Add more tests with gaps

* Rename function, pass range instead of left and right

* Extract ms width

* Fix overlap calc

* Fix lint

* Assert time range is valid

* Fix name in tests

* Add pxBetween to x axis

* Use pxFromMs for scale

* Enhance doc

* Add todos

* Take gaps into account in xFromEpoch

* Remove old test

* Handle x coordinates outside canvas

* Add todo

* Handle px shift of 0

* Extract time range into a file

* Handle future shift without gaps

* Remove pxToMs dependency

* Add negative shift test

* Handle epoch at the start of the gap

* Handle epoch in the middle of a gap

* Overlap returns time range

* Handle gap after epoch

* Handle far gap after epoch

* Handle two near gaps

* Add test with 3 gaps

* Handle near gap before

* Add failing test

* Switch near/far terms to obstructing/non-obstructing

* New algorithm (pass last test)

* Use for loop instead of while

* Add failing test

* Pass test

* Use gap method

* Exit early if once not overlapping next gap

* Add epoch shift to xaxis model

* Use shiftEpoch to calc leftbound

* Use shiftEpoch to calc scroll bounds

* Use shift on pan update

* Use shift on scalewithnowfixed

* Use shift on another scale

* Remove msFromPx! 🎉

* Handle gaps when converting x to epoch

* Pass dummy timegaps for testing

* Add todo

* Clamp pan update

* Handle gaps on scroll to now

* Take gaps into account on scroll momentum

* Remove print

* Remove dead code

* Ignore vscode launch config

* Dartfmt

* Consistent method name

* Reorder

* Find gaps stub

* New failing test

* Add toString to timerange

* Find gaps implementation

* Always return same epoch when pxShift is 0

* Fix conversion algorithm

* Update gaps

* Detect history load

* Detect tick load and reload

* Clean up

* Only check new data for gaps when history is loaded

* Add doc

* Graphical test description for epoch shift

* Partial algorith

* Right shift algorithm

* Find nearest gap

* Handle left shift

* Add comments

* Remove test time gap

* Docs about call order

* Prep to remove timegaps

* Remove dead function

* Add docs

* More docs

* Remove msToPx

* Remove time labels inside gaps

* Outline new algorithm

* Expose timegaps

* Remove overlapping time labels

* Extract constant

* Remove unused getter

* Update lib/src/logic/find_gaps.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Update lib/src/x_axis/x_axis_model.dart

Co-authored-by: raminvakili-fs <[email protected]>

* Add docs to time range

* Make shiftEpoch private

* Fix bad state

* Use production server

Co-authored-by: raminvakili-fs <[email protected]>
* Adding barriers

* A test horizontal barrier

* Annotations extend from Series

* Added BarrierPainter

* Barrier and HorizontalBarrier

* Painting H barrier label and value

* Add BarrierStyle
 - DataSeriesStyle instead of ChartPaintingStyle and ChartPaintingStyle more general

* Adding vertical barrier

* Painting a vertical test line

* Dashed line painting general functions  in paint_line file

* isDashed option for barriers

* Fix padding in horizantal padding

* Added docs

* Label for vertical barrier

* minor cleanup

* Use barrier title for the default

* Barrier object in barrier_objects file

* Background color for horizontal barrier (They might overlap with Y-Axis label)

* Updated README

* Added paintTextFromRight

* Use paintTextFromRight in other places

* Painting labels inside barrier_painter itself

* Label for horizontal barriers

* Adding combined(V&H) barrier

* hasLine param for BarrierStyle

* No title on horizontal line in Combined barrier

* Paint dot for combined barrier

* Create Paint object in constructor

* Null check in CombinedBarrier

* Minor code cleanup

* Paint horizontal barrier upward arrows

* Downward arrows

* minor fix

* Corner radius for downward arrows

* Corner radius for upward arrows

* Fix lint warnings

* Keep VerticalBarrier title always on-screen when its line is visible

* LastTickIndicator as a barrier as well

* Code cleanup

* Correct order on Z for barriers

* Code refactoring

* Update last tick indicator label background

* Pass style to LastTickIndicator in DataSeries

* Code cleanup

* Start epoch for horizontal barrier

* Value for vertical barrier

* Circle on Vertical barrier value

* LastTickIndicator -> TickIndicator

* More properties for tick indicator

* Use style toString too for the default id so series be more distinguishable

* Minor change in example app barriers list

* Added Horizontal and vertical barriers style

* Option to make line of vertical from tick or from top

* Styling intersection dot

* LabelShape for Horizontal barrier

* Painting dot option for horizontal barrier as well

* Contributing Horizontal barrier in Y-axis range be conditional

* Tick indicator sub-class of Horizontal barrier

* Code cleanup

* Code cleanup

* Cleanup on horizontal_barrier_painter

* Updated toString method of Style classes

* H & V common fields in Barrier class

* Paint object in constructor

* Bring back H Barrier objects, need for its leftEpoch

* Minor changes in IntersectionDotStyle

* Removed valueBackgroundColor

* Fix comment

* Extract creating arrow path to a file

* Minor code cleanup in horizontal_barrier_painter

* Button for adding sample barriers

* Removed export CurrentTickStyle, its replaced by HorizontalBarrierStyle

* Remove intersection dot painting and styles

* Exclude horizontal barrier from chart data that define min/max quote
- Decide for barrier arrow type when we want to paint it and its out of view port

* Option to indicate inculde/exclude H barrier in defining chart's Y-Axis range

* Update example/main.dart

* Minor refactor

* Removed hasLine option property from BarrierStyle

* LTR & RTL DashedLine function

* V dashed line paint from bottom to top

* Checkbox for adding sample SL and TP

* Visibilty option for Horizontal barrier
 - Normal (invisble when is out of range)
 - AlwaysVisible (show arrow when its out-of-range)
 - ForceToStayOnRange

* Update a comment

* Default visiblity value for CombinedBarrier

* Default color of barrier title background

* Temopararily moved barrier arrow before title until design is ready

* Clear barriers on interval switch too

* Some code cleanup

* alwaysVisible -> keepBarrierLabelVisible

* Minor refactor in horizontal_barrier_painter

* Minor refactor in create_shape_path.dart

* Added ChartObject test

* Added isOnValueRange to ChartObject

* Code cleanup in ChartObject

* When chart object is bigger and covers entire visible range

* Test for isOnValueRange

* Paint label at the end for HorizontalBarrier

* flutter format on barrier related clases

* longLine param in CombinedBarrier

* Description change in BarrierObject test

* Fix backward scrollToNow exception
* Fix updating blinking animation controller on didUpdate

* Passing isLive to ChartImplementation
 - Its safer, it might be possible ChartImplementation.didUpdate get called before XAxis.didUpdate

* Update blinking animation status inside a method

* Just checking if isLive changed. (Less code)

* Getting opacity from outside

* scrollToLastTick, a situation where target < _rightBoundEpoch

* Different CustomPaint for mainSeries and other ChartData

* Requested review change

* Update opacity param used in example
* Chart marker model

* Marker series

* Ignore vscode config

* Show sample markers

* Extract marker draw

* Add marker style to theme

* Move test markers

* Change hardcoded default color values (temp fix)

* Draw up marker shape

* Draw down marker

* Refactor marker painting

* Draw arrow

* Rotate down arrow

* Remove unused import

* Add callback to model

* Center marker around purchase price

* Center arrow in marker

* Update tappable areas

* Reorder

* Refactor gesture detector

* Trigger tap up

* Fix long press

* Refactor some more

* Refactor some more

* Refactor pointer count change callbacks

* Marker buttons

* Named marker constructors

* Handle marker tap

* Increase tap area

* Extract marker radius as a prop

* Extend series

* Marker area

* Fix

* Implement min/max

* Draw markers

* Add function stub, test throws exception

* TDD findEpochIndex

* Update visible markers

* Refactor findClosestToEpoch

* Fix

* Active marker class

* Add active marker on marker tap

* Toggle marker opacity

* Store tap area in the marker for robustness

* Extract paint marker

* Draw active marker

* Move radius to style

* Only pass necessary info to active marker paitner

* Remove dead code

* Rename symbol

* Fix tap bug

* Extract active marker painter file

* Control text anchor point

* Paint active marker label

* Remove redundant prop

* Split paint text

* Draw marker body, shift icon

* Add text padding

* Handle active marker tap

* Animate opacity

* Set up animation controller

* Change longpress hold duration

* Fix lints

* Remove print

* Animate marker in

* Animate marker out

* Don't inflate marker tap  area

* Apply animation curve

* Change animation duration

* Transparent markers are not tappable

* Update doc

* Speed up animation

* Extract animated active marker widget

* Update marker icon

* Add readme docs

* Remove unused dependencies

* Fix build

* Fix build

* Add delete markers button

* Dont build marker area without markerseries

* Clear markers on interval/market change

* Dont calc marker min max

* Dont paint fully closed active marker

* Delete active marker

Co-authored-by: Morteza Tavanarad <[email protected]>
* Remove unused import

* Exit/entry tick

* Add entry marker style

* Add exit marker style

* Add styles to marker style

* Entry marker painter

* Paint exit marker

* Fix build

* Rename method

* Enhance doc

* Rename method

* Add headers to readme

* Readme docs for entry and exit tick markers
ramin-deriv and others added 27 commits January 18, 2022 14:37
* Fix dependencies

* Fix a lint warning

* Set Flutter version to 2.8.1. in CirclCi
* fixed  x axis start point

* Update lib/src/deriv_chart/chart/x_axis/x_axis.dart

Co-authored-by: raminvakili-fs <[email protected]>

Co-authored-by: raminvakili-fs <[email protected]>
- add closed market icon
- refactor painting markers
- add options (rise/fall markers)
- export MarkerIconPainter
- fix deriv_lint dependency
- minor fix in example app
- update deriv_lint dependency
- upgrade flutter version to 3.3.10
…t_package (#211)

* add accumulators horizontal barrier and entry spot

* adjust comments

* Trigger Build
…the_chart_package (#211)" (#217)

This reverts commit 13fbd66.
* Revert "hamed/upgrade_flutter_version_to_3.3.10 (#203)"

This reverts commit d88ceb3.

* change flutter version in ci config to 2.10.5
* update entry marker border color

* add a TODO

* update TODO message

* increase the size of the entry spot marker

* increase the size of the entry/exit marker, minor code cleanup

* code cleanup
* update icons

* revert flutter version

* revert json_annotation package version

* remove icon with wrong name

* add icons with their correct name

* remove wrong icon

* add correct icon
- add contribution guideline document
* :constrcution: WIP refactoring

* Use AnimatedPositioned

* Calculate cross hair text size

* Keep cross hair detail card inside chart area

* Detach line position from the card

* Fix a lint warning

* keep the cross hair postion when the touch is off the chart view port

* code cleanup

* minor refactor

* consider left+right and top+bottom padding when calculating crosshair size

* minor comment fix

* refactor cross hair animations durations to it's varialbe

* Add onTap callback to the WormChart until finding a solid solution for GestureDetector confilct

---------

Co-authored-by: Ramin Vakili <[email protected]>
Co-authored-by: Ramin <[email protected]>
- fix bug unsupported operation infinity or nan to int
* sahani/migrate_flutter_to_version_3_10 (#225)

- migrate flutter to version 3.10.0

* hamed/update_dependencies (#227)

- update dependencies

* fix test issues

* aliakbar/set_initial_bound_targets_to_avoid_annotations_overlapping (#240)

- set initial bound targets

* Osama/DERG-294/add VerticalBarrierLabelPosition property to the vertical barrier style (#226)

* add VerticalBarrierLabelPosition property to the vertical barrier style

* punctuation improvement

* Add vertical space for more readability.

* use dev branch of ta package (#255)

---------

Co-authored-by: sahani-deriv <[email protected]>
Co-authored-by: Hamed Rezaee <[email protected]>
Co-authored-by: Ali Akbar <[email protected]>
Co-authored-by: Osama Ghazal <[email protected]>
@ramin-deriv ramin-deriv merged commit b12c641 into deriv-com:master Oct 17, 2023
ramin-deriv added a commit that referenced this pull request Oct 17, 2023
@ramin-deriv ramin-deriv deleted the ramin/merge_dev_into_master branch November 29, 2023 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.