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

Function createList

guenstigsteTankstelle.js:62–80  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

60}
61
62function createList(data) {
63 const list = new ListWidget()
64 list.setPadding(0, 4, 1, 4)
65
66 const gradient = new LinearGradient()
67 gradient.locations = [0, 1]
68 gradient.colors = [
69 backColor,
70 backColor2
71 ]
72 list.backgroundGradient = gradient
73
74 if (data.error) {
75 let errorMessage = list.addText('No station in selected radius found. Please set a greater radius in widget parameters')
76 errorMessage.font = Font.boldSystemFont(12)
77 errorMessage.textColor = textColor
78 }
79 return list
80}
81
82async function createWidget(data) {
83 let list = createList(data);

Callers 1

createWidgetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected