Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,720 --> 00:00:10,550
In our application here, there's also one thing I want to improve. If I have a transaction with a pretty
2
00:00:10,970 --> 00:00:12,140
big amount here,
3
00:00:12,140 --> 00:00:20,000
so if we enter a big number, then we of course know that we would have grown our bar here without
4
00:00:20,000 --> 00:00:21,830
the fixes we applied earlier.
5
00:00:21,830 --> 00:00:30,040
One thing we can still see is that now, these weekday shortcuts here are not really aligned
6
00:00:30,130 --> 00:00:38,230
and in addition, we also see that the bar here, the first bar is actually starting a bit earlier than
7
00:00:38,230 --> 00:00:40,840
the other ones, it's not in line with the other bars.
8
00:00:40,840 --> 00:00:45,840
The reason for that of course is that we shrank our text and therefore the height of this text
9
00:00:45,850 --> 00:00:49,840
also changed and hence this whole bar is moved up a bit.
10
00:00:49,870 --> 00:00:54,930
Obviously, that's not a behavior I want here. Now to fix that behavior,
11
00:00:54,940 --> 00:01:04,340
we can go to our chart bar widget here and simply wrap a container around our FittedBox here and
12
00:01:04,430 --> 00:01:10,480
in that container here, we can give this a height of let's say 20.
13
00:01:10,530 --> 00:01:15,890
Now the text here at the top will always have a height of 20 no matter how much height it needs
14
00:01:16,080 --> 00:01:17,730
and therefore the text is now aligned,
15
00:01:17,760 --> 00:01:21,470
the bars are aligned and the text here at the bottom is also aligned
16
00:01:21,570 --> 00:01:26,400
and that of course looks better than bars jumping randomly around.
17
00:01:26,430 --> 00:01:32,400
Now one other thing we can improve on this chart here is the order of days.
18
00:01:32,460 --> 00:01:38,130
It's a pure cosmetic thing and you might not even want this but at the moment, the current day, toay
19
00:01:38,250 --> 00:01:41,990
is here on the left and the oldest date is on the right.
20
00:01:42,180 --> 00:01:48,870
To me it's more natural that the day one week ago should be on the left and today should be all the
21
00:01:48,870 --> 00:01:51,280
way on the right.
22
00:01:51,290 --> 00:01:57,110
Now again, it's totally up to you if that's what you want but if you want that, it's relatively easy to
23
00:01:57,110 --> 00:01:57,980
achieve,
24
00:01:58,070 --> 00:02:07,070
all you have to do is you go to your chart.dart file where you derive your grouped transaction values
25
00:02:07,430 --> 00:02:10,080
and there, we build this list for our weekdays.
26
00:02:10,280 --> 00:02:18,080
In the end, the way we have our algorithm here means that we generate today as the first day in
27
00:02:18,080 --> 00:02:18,740
line
28
00:02:18,800 --> 00:02:21,000
and it's hard to change that.
29
00:02:21,080 --> 00:02:26,900
The easiest way to change the resulting list however is to simply add something on the list which is
30
00:02:26,900 --> 00:02:34,190
generated here, we can call reversed here and reverse gives us a new iterable so we can then call to
31
00:02:34,190 --> 00:02:35,080
list on that
32
00:02:35,120 --> 00:02:37,230
and now we get a reversed list.
33
00:02:37,250 --> 00:02:39,470
So now we build a list, then we reverse it
34
00:02:39,470 --> 00:02:43,750
with the help of reverse which gives us our list, just in the opposite order
35
00:02:43,970 --> 00:02:46,430
and it doesn't give us a list but actually an iterable
36
00:02:46,520 --> 00:02:50,410
and therefore just as for map and so on, we have to call to list.
37
00:02:50,540 --> 00:02:52,420
And if you do that and you save this,
38
00:02:52,580 --> 00:02:58,940
now you see the bars switched order and we have the oldest date or the oldest day on the left and
39
00:02:58,940 --> 00:02:59,940
today on the right.
40
00:02:59,990 --> 00:03:04,940
Again it's up to you if you want that behavior, here I do want that and therefore this is the change that
41
00:03:04,940 --> 00:03:06,140
I think makes sense here.
4226
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.