-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps.txt
56 lines (48 loc) · 2.71 KB
/
steps.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Section 14 Boss Level Challenge - Bitcoin Ticker:
1. L-147/148/149: The MaterialDropdownButton
1.1 in price_screen: add dropdown button with DropdownMeuItems, change onChanged to display button
1.2 add value prop (starting value - usually first item in list) with 'USD'
1.3 on change, update value of dropdown button
1.3 (a) add prop selectedCurrency to class with starting value 'USD'
1.3 (b) replace value 'USD' with selectedCurrency
1.3 (c) change onChanged to set selectedCurrency to value -> setState()
1.4 add all currencies as list to DropdownMenuItem
1.4 (a) import coin_data.dart
1.4 (b) in price_screen.dart create getDropDownItems()
1.4 (c) call method from DropdownButton<String>(items)
2. L-150: Introducing Cupertino Widgets
Task: on iOS use PickerView instead of DropDownMenuButton
2.1 exchange DropDownMenu for CupertinoPicker - in price_screen.dart
2.1 (a) cut DropDrownButton from Container and paste at bottom as comments
2.1 (b) import Cupertino.dart
2.1 (c) add Cupertino widget as child to Container
2.2 populate Cupertino Picker with List of currencies
2.2 (a) add method getPickerItems
2.2 (b) call method from CupertinoPicker children prop
3. L-151: Building Platform Specific UI (iOS & Android)
Task: display CupertinoPicker in iOS devices and DropdownMenuButton in Android Devices
3.1 add method androidDropDown that returns a DropDownButton<String> in class
3.2 refactor getDropDownItems into androidDropDown
3.3 add method iOSPicker that returns a CupertinoPicker
3.4 cut and paste CupertinoPicker into this new method
3.5 refactor getPickerItems into iOSPicker method
3.6 make choice between AndroidDropDown and iOSPicker based on OS:
3.6 (a) import platform from dart:io to access OS (no pubspec.yaml)
3.6 (b) use if/elseif in separate method selectButton()
3.6 (c) call selectButton () from Container child
3.6 (d) replace 3.6(c) with ternary operator
4. L-153: Challenge Bronze Level: Get USD Bitcoin Price from API and display
4.1 in coin_data.dart add imports for http.dart & dart.convert
4.2 add url const
4.3 in class CoinData add logic to get USD data via API
4.4 add String for USD BTC value and set to '?' for initial
4.5 add getData method to get data via CoinData class
4.6 create initState() and call getData() from initState
4.7 add $bitCoinValueinUSD to Button
5. L-154: Challenge Silver Level: add functionality to currency selector
5.1 update selectedCurrency init to AUD
5.2 call getData from onChanged | setState in DropDownButton
5.3 save the selected Currency to selectedCurrency IOS style in onSelectedItemChanged
5.4 call getData from onSelectedItemChanged in cupertinoPicker
5.5 modify getData)to pass selectedCurrency
5.6 update Text() widget for BTC Card