MCPcopy Create free account
hub / github.com/Necriso/ScriptableWidgets / createList

Function createList

guenstigsteTankstelleAT.js:56–74  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

54}
55
56function createList(data) {
57 const list = new ListWidget()
58 list.setPadding(0, 4, 1, 4)
59
60 const gradient = new LinearGradient()
61 gradient.locations = [0, 1]
62 gradient.colors = [
63 backColor,
64 backColor2
65 ]
66 list.backgroundGradient = gradient
67
68 if (data.error) {
69 let errorMessage = list.addText('No stations found.')
70 errorMessage.font = Font.boldSystemFont(12)
71 errorMessage.textColor = textColor
72 }
73 return list
74}
75
76async function createWidget(data, fuelType) {
77 let list = createList(data);

Callers 1

createWidgetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected