1
0

TupleViewChildren.swift 99 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946
  1. // This file was generated using gyb. Do not edit it directly. Edit
  2. // TupleViewChildren.swift.gyb instead.
  3. // swiftformat:options --allow-partial-wrapping true
  4. protocol TupleViewChildren: ViewGraphNodeChildren {
  5. @MainActor
  6. var stackLayoutCache: StackLayoutCache { get nonmutating set }
  7. }
  8. /// A helper function to shorten node initialisations to a single line. This
  9. /// helps compress the generated code a bit and minimise the number of additions
  10. /// and deletions caused by updating the generator.
  11. @MainActor
  12. private func node<V: View, Backend: BaseAppBackend>(
  13. for view: V,
  14. _ backend: Backend,
  15. _ snapshot: ViewGraphSnapshotter.NodeSnapshot?,
  16. _ environment: EnvironmentValues
  17. ) -> AnyViewGraphNode<V> {
  18. AnyViewGraphNode(
  19. for: view,
  20. backend: backend,
  21. snapshot: snapshot,
  22. environment: environment
  23. )
  24. }
  25. /// A fixed-length strongly-typed collection of 1 child nodes. A counterpart to
  26. /// ``TupleView1``.
  27. public class TupleViewChildren1<
  28. Child0: View
  29. >: TupleViewChildren {
  30. public var widgets: [AnyWidget] {
  31. return [child0.widget]
  32. }
  33. public var erasedNodes: [ErasedViewGraphNode] {
  34. return [
  35. ErasedViewGraphNode(wrapping: child0),
  36. ]
  37. }
  38. var stackLayoutCache = StackLayoutCache.initial
  39. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  40. public var child0: AnyViewGraphNode<Child0>
  41. /// Creates the nodes for 1 child views.
  42. public init<Backend: BaseAppBackend>(
  43. _ child0: Child0,
  44. backend: Backend,
  45. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  46. environment: EnvironmentValues
  47. ) {
  48. let viewTypeNames = [
  49. ViewGraphSnapshotter.name(of: Child0.self)
  50. ]
  51. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  52. self.child0 = node(for: child0, backend, snapshots[0], environment)
  53. }
  54. }
  55. /// A fixed-length strongly-typed collection of 2 child nodes. A counterpart to
  56. /// ``TupleView2``.
  57. public class TupleViewChildren2<
  58. Child0: View, Child1: View
  59. >: TupleViewChildren {
  60. public var widgets: [AnyWidget] {
  61. return [child0.widget, child1.widget]
  62. }
  63. public var erasedNodes: [ErasedViewGraphNode] {
  64. return [
  65. ErasedViewGraphNode(wrapping: child0),
  66. ErasedViewGraphNode(wrapping: child1),
  67. ]
  68. }
  69. var stackLayoutCache = StackLayoutCache.initial
  70. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  71. public var child0: AnyViewGraphNode<Child0>
  72. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  73. public var child1: AnyViewGraphNode<Child1>
  74. /// Creates the nodes for 2 child views.
  75. public init<Backend: BaseAppBackend>(
  76. _ child0: Child0, _ child1: Child1,
  77. backend: Backend,
  78. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  79. environment: EnvironmentValues
  80. ) {
  81. let viewTypeNames = [
  82. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self)
  83. ]
  84. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  85. self.child0 = node(for: child0, backend, snapshots[0], environment)
  86. self.child1 = node(for: child1, backend, snapshots[1], environment)
  87. }
  88. }
  89. /// A fixed-length strongly-typed collection of 3 child nodes. A counterpart to
  90. /// ``TupleView3``.
  91. public class TupleViewChildren3<
  92. Child0: View, Child1: View, Child2: View
  93. >: TupleViewChildren {
  94. public var widgets: [AnyWidget] {
  95. return [child0.widget, child1.widget, child2.widget]
  96. }
  97. public var erasedNodes: [ErasedViewGraphNode] {
  98. return [
  99. ErasedViewGraphNode(wrapping: child0),
  100. ErasedViewGraphNode(wrapping: child1),
  101. ErasedViewGraphNode(wrapping: child2),
  102. ]
  103. }
  104. var stackLayoutCache = StackLayoutCache.initial
  105. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  106. public var child0: AnyViewGraphNode<Child0>
  107. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  108. public var child1: AnyViewGraphNode<Child1>
  109. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  110. public var child2: AnyViewGraphNode<Child2>
  111. /// Creates the nodes for 3 child views.
  112. public init<Backend: BaseAppBackend>(
  113. _ child0: Child0, _ child1: Child1, _ child2: Child2,
  114. backend: Backend,
  115. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  116. environment: EnvironmentValues
  117. ) {
  118. let viewTypeNames = [
  119. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  120. ViewGraphSnapshotter.name(of: Child2.self)
  121. ]
  122. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  123. self.child0 = node(for: child0, backend, snapshots[0], environment)
  124. self.child1 = node(for: child1, backend, snapshots[1], environment)
  125. self.child2 = node(for: child2, backend, snapshots[2], environment)
  126. }
  127. }
  128. /// A fixed-length strongly-typed collection of 4 child nodes. A counterpart to
  129. /// ``TupleView4``.
  130. public class TupleViewChildren4<
  131. Child0: View, Child1: View, Child2: View, Child3: View
  132. >: TupleViewChildren {
  133. public var widgets: [AnyWidget] {
  134. return [child0.widget, child1.widget, child2.widget, child3.widget]
  135. }
  136. public var erasedNodes: [ErasedViewGraphNode] {
  137. return [
  138. ErasedViewGraphNode(wrapping: child0),
  139. ErasedViewGraphNode(wrapping: child1),
  140. ErasedViewGraphNode(wrapping: child2),
  141. ErasedViewGraphNode(wrapping: child3),
  142. ]
  143. }
  144. var stackLayoutCache = StackLayoutCache.initial
  145. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  146. public var child0: AnyViewGraphNode<Child0>
  147. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  148. public var child1: AnyViewGraphNode<Child1>
  149. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  150. public var child2: AnyViewGraphNode<Child2>
  151. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  152. public var child3: AnyViewGraphNode<Child3>
  153. /// Creates the nodes for 4 child views.
  154. public init<Backend: BaseAppBackend>(
  155. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3,
  156. backend: Backend,
  157. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  158. environment: EnvironmentValues
  159. ) {
  160. let viewTypeNames = [
  161. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  162. ViewGraphSnapshotter.name(of: Child2.self),
  163. ViewGraphSnapshotter.name(of: Child3.self)
  164. ]
  165. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  166. self.child0 = node(for: child0, backend, snapshots[0], environment)
  167. self.child1 = node(for: child1, backend, snapshots[1], environment)
  168. self.child2 = node(for: child2, backend, snapshots[2], environment)
  169. self.child3 = node(for: child3, backend, snapshots[3], environment)
  170. }
  171. }
  172. /// A fixed-length strongly-typed collection of 5 child nodes. A counterpart to
  173. /// ``TupleView5``.
  174. public class TupleViewChildren5<
  175. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View
  176. >: TupleViewChildren {
  177. public var widgets: [AnyWidget] {
  178. return [child0.widget, child1.widget, child2.widget, child3.widget, child4.widget]
  179. }
  180. public var erasedNodes: [ErasedViewGraphNode] {
  181. return [
  182. ErasedViewGraphNode(wrapping: child0),
  183. ErasedViewGraphNode(wrapping: child1),
  184. ErasedViewGraphNode(wrapping: child2),
  185. ErasedViewGraphNode(wrapping: child3),
  186. ErasedViewGraphNode(wrapping: child4),
  187. ]
  188. }
  189. var stackLayoutCache = StackLayoutCache.initial
  190. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  191. public var child0: AnyViewGraphNode<Child0>
  192. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  193. public var child1: AnyViewGraphNode<Child1>
  194. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  195. public var child2: AnyViewGraphNode<Child2>
  196. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  197. public var child3: AnyViewGraphNode<Child3>
  198. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  199. public var child4: AnyViewGraphNode<Child4>
  200. /// Creates the nodes for 5 child views.
  201. public init<Backend: BaseAppBackend>(
  202. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  203. backend: Backend,
  204. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  205. environment: EnvironmentValues
  206. ) {
  207. let viewTypeNames = [
  208. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  209. ViewGraphSnapshotter.name(of: Child2.self),
  210. ViewGraphSnapshotter.name(of: Child3.self),
  211. ViewGraphSnapshotter.name(of: Child4.self)
  212. ]
  213. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  214. self.child0 = node(for: child0, backend, snapshots[0], environment)
  215. self.child1 = node(for: child1, backend, snapshots[1], environment)
  216. self.child2 = node(for: child2, backend, snapshots[2], environment)
  217. self.child3 = node(for: child3, backend, snapshots[3], environment)
  218. self.child4 = node(for: child4, backend, snapshots[4], environment)
  219. }
  220. }
  221. /// A fixed-length strongly-typed collection of 6 child nodes. A counterpart to
  222. /// ``TupleView6``.
  223. public class TupleViewChildren6<
  224. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View
  225. >: TupleViewChildren {
  226. public var widgets: [AnyWidget] {
  227. return [
  228. child0.widget,
  229. child1.widget,
  230. child2.widget,
  231. child3.widget,
  232. child4.widget,
  233. child5.widget
  234. ]
  235. }
  236. public var erasedNodes: [ErasedViewGraphNode] {
  237. return [
  238. ErasedViewGraphNode(wrapping: child0),
  239. ErasedViewGraphNode(wrapping: child1),
  240. ErasedViewGraphNode(wrapping: child2),
  241. ErasedViewGraphNode(wrapping: child3),
  242. ErasedViewGraphNode(wrapping: child4),
  243. ErasedViewGraphNode(wrapping: child5),
  244. ]
  245. }
  246. var stackLayoutCache = StackLayoutCache.initial
  247. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  248. public var child0: AnyViewGraphNode<Child0>
  249. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  250. public var child1: AnyViewGraphNode<Child1>
  251. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  252. public var child2: AnyViewGraphNode<Child2>
  253. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  254. public var child3: AnyViewGraphNode<Child3>
  255. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  256. public var child4: AnyViewGraphNode<Child4>
  257. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  258. public var child5: AnyViewGraphNode<Child5>
  259. /// Creates the nodes for 6 child views.
  260. public init<Backend: BaseAppBackend>(
  261. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  262. _ child5: Child5,
  263. backend: Backend,
  264. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  265. environment: EnvironmentValues
  266. ) {
  267. let viewTypeNames = [
  268. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  269. ViewGraphSnapshotter.name(of: Child2.self),
  270. ViewGraphSnapshotter.name(of: Child3.self),
  271. ViewGraphSnapshotter.name(of: Child4.self),
  272. ViewGraphSnapshotter.name(of: Child5.self)
  273. ]
  274. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  275. self.child0 = node(for: child0, backend, snapshots[0], environment)
  276. self.child1 = node(for: child1, backend, snapshots[1], environment)
  277. self.child2 = node(for: child2, backend, snapshots[2], environment)
  278. self.child3 = node(for: child3, backend, snapshots[3], environment)
  279. self.child4 = node(for: child4, backend, snapshots[4], environment)
  280. self.child5 = node(for: child5, backend, snapshots[5], environment)
  281. }
  282. }
  283. /// A fixed-length strongly-typed collection of 7 child nodes. A counterpart to
  284. /// ``TupleView7``.
  285. public class TupleViewChildren7<
  286. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View, Child6: View
  287. >: TupleViewChildren {
  288. public var widgets: [AnyWidget] {
  289. return [
  290. child0.widget,
  291. child1.widget,
  292. child2.widget,
  293. child3.widget,
  294. child4.widget,
  295. child5.widget,
  296. child6.widget
  297. ]
  298. }
  299. public var erasedNodes: [ErasedViewGraphNode] {
  300. return [
  301. ErasedViewGraphNode(wrapping: child0),
  302. ErasedViewGraphNode(wrapping: child1),
  303. ErasedViewGraphNode(wrapping: child2),
  304. ErasedViewGraphNode(wrapping: child3),
  305. ErasedViewGraphNode(wrapping: child4),
  306. ErasedViewGraphNode(wrapping: child5),
  307. ErasedViewGraphNode(wrapping: child6),
  308. ]
  309. }
  310. var stackLayoutCache = StackLayoutCache.initial
  311. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  312. public var child0: AnyViewGraphNode<Child0>
  313. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  314. public var child1: AnyViewGraphNode<Child1>
  315. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  316. public var child2: AnyViewGraphNode<Child2>
  317. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  318. public var child3: AnyViewGraphNode<Child3>
  319. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  320. public var child4: AnyViewGraphNode<Child4>
  321. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  322. public var child5: AnyViewGraphNode<Child5>
  323. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  324. public var child6: AnyViewGraphNode<Child6>
  325. /// Creates the nodes for 7 child views.
  326. public init<Backend: BaseAppBackend>(
  327. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  328. _ child5: Child5, _ child6: Child6,
  329. backend: Backend,
  330. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  331. environment: EnvironmentValues
  332. ) {
  333. let viewTypeNames = [
  334. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  335. ViewGraphSnapshotter.name(of: Child2.self),
  336. ViewGraphSnapshotter.name(of: Child3.self),
  337. ViewGraphSnapshotter.name(of: Child4.self),
  338. ViewGraphSnapshotter.name(of: Child5.self),
  339. ViewGraphSnapshotter.name(of: Child6.self)
  340. ]
  341. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  342. self.child0 = node(for: child0, backend, snapshots[0], environment)
  343. self.child1 = node(for: child1, backend, snapshots[1], environment)
  344. self.child2 = node(for: child2, backend, snapshots[2], environment)
  345. self.child3 = node(for: child3, backend, snapshots[3], environment)
  346. self.child4 = node(for: child4, backend, snapshots[4], environment)
  347. self.child5 = node(for: child5, backend, snapshots[5], environment)
  348. self.child6 = node(for: child6, backend, snapshots[6], environment)
  349. }
  350. }
  351. /// A fixed-length strongly-typed collection of 8 child nodes. A counterpart to
  352. /// ``TupleView8``.
  353. public class TupleViewChildren8<
  354. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  355. Child6: View,
  356. Child7: View
  357. >: TupleViewChildren {
  358. public var widgets: [AnyWidget] {
  359. return [
  360. child0.widget,
  361. child1.widget,
  362. child2.widget,
  363. child3.widget,
  364. child4.widget,
  365. child5.widget,
  366. child6.widget,
  367. child7.widget
  368. ]
  369. }
  370. public var erasedNodes: [ErasedViewGraphNode] {
  371. return [
  372. ErasedViewGraphNode(wrapping: child0),
  373. ErasedViewGraphNode(wrapping: child1),
  374. ErasedViewGraphNode(wrapping: child2),
  375. ErasedViewGraphNode(wrapping: child3),
  376. ErasedViewGraphNode(wrapping: child4),
  377. ErasedViewGraphNode(wrapping: child5),
  378. ErasedViewGraphNode(wrapping: child6),
  379. ErasedViewGraphNode(wrapping: child7),
  380. ]
  381. }
  382. var stackLayoutCache = StackLayoutCache.initial
  383. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  384. public var child0: AnyViewGraphNode<Child0>
  385. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  386. public var child1: AnyViewGraphNode<Child1>
  387. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  388. public var child2: AnyViewGraphNode<Child2>
  389. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  390. public var child3: AnyViewGraphNode<Child3>
  391. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  392. public var child4: AnyViewGraphNode<Child4>
  393. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  394. public var child5: AnyViewGraphNode<Child5>
  395. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  396. public var child6: AnyViewGraphNode<Child6>
  397. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  398. public var child7: AnyViewGraphNode<Child7>
  399. /// Creates the nodes for 8 child views.
  400. public init<Backend: BaseAppBackend>(
  401. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  402. _ child5: Child5, _ child6: Child6, _ child7: Child7,
  403. backend: Backend,
  404. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  405. environment: EnvironmentValues
  406. ) {
  407. let viewTypeNames = [
  408. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  409. ViewGraphSnapshotter.name(of: Child2.self),
  410. ViewGraphSnapshotter.name(of: Child3.self),
  411. ViewGraphSnapshotter.name(of: Child4.self),
  412. ViewGraphSnapshotter.name(of: Child5.self),
  413. ViewGraphSnapshotter.name(of: Child6.self),
  414. ViewGraphSnapshotter.name(of: Child7.self)
  415. ]
  416. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  417. self.child0 = node(for: child0, backend, snapshots[0], environment)
  418. self.child1 = node(for: child1, backend, snapshots[1], environment)
  419. self.child2 = node(for: child2, backend, snapshots[2], environment)
  420. self.child3 = node(for: child3, backend, snapshots[3], environment)
  421. self.child4 = node(for: child4, backend, snapshots[4], environment)
  422. self.child5 = node(for: child5, backend, snapshots[5], environment)
  423. self.child6 = node(for: child6, backend, snapshots[6], environment)
  424. self.child7 = node(for: child7, backend, snapshots[7], environment)
  425. }
  426. }
  427. /// A fixed-length strongly-typed collection of 9 child nodes. A counterpart to
  428. /// ``TupleView9``.
  429. public class TupleViewChildren9<
  430. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  431. Child6: View,
  432. Child7: View, Child8: View
  433. >: TupleViewChildren {
  434. public var widgets: [AnyWidget] {
  435. return [
  436. child0.widget,
  437. child1.widget,
  438. child2.widget,
  439. child3.widget,
  440. child4.widget,
  441. child5.widget,
  442. child6.widget,
  443. child7.widget,
  444. child8.widget
  445. ]
  446. }
  447. public var erasedNodes: [ErasedViewGraphNode] {
  448. return [
  449. ErasedViewGraphNode(wrapping: child0),
  450. ErasedViewGraphNode(wrapping: child1),
  451. ErasedViewGraphNode(wrapping: child2),
  452. ErasedViewGraphNode(wrapping: child3),
  453. ErasedViewGraphNode(wrapping: child4),
  454. ErasedViewGraphNode(wrapping: child5),
  455. ErasedViewGraphNode(wrapping: child6),
  456. ErasedViewGraphNode(wrapping: child7),
  457. ErasedViewGraphNode(wrapping: child8),
  458. ]
  459. }
  460. var stackLayoutCache = StackLayoutCache.initial
  461. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  462. public var child0: AnyViewGraphNode<Child0>
  463. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  464. public var child1: AnyViewGraphNode<Child1>
  465. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  466. public var child2: AnyViewGraphNode<Child2>
  467. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  468. public var child3: AnyViewGraphNode<Child3>
  469. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  470. public var child4: AnyViewGraphNode<Child4>
  471. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  472. public var child5: AnyViewGraphNode<Child5>
  473. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  474. public var child6: AnyViewGraphNode<Child6>
  475. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  476. public var child7: AnyViewGraphNode<Child7>
  477. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  478. public var child8: AnyViewGraphNode<Child8>
  479. /// Creates the nodes for 9 child views.
  480. public init<Backend: BaseAppBackend>(
  481. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  482. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  483. backend: Backend,
  484. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  485. environment: EnvironmentValues
  486. ) {
  487. let viewTypeNames = [
  488. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  489. ViewGraphSnapshotter.name(of: Child2.self),
  490. ViewGraphSnapshotter.name(of: Child3.self),
  491. ViewGraphSnapshotter.name(of: Child4.self),
  492. ViewGraphSnapshotter.name(of: Child5.self),
  493. ViewGraphSnapshotter.name(of: Child6.self),
  494. ViewGraphSnapshotter.name(of: Child7.self),
  495. ViewGraphSnapshotter.name(of: Child8.self)
  496. ]
  497. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  498. self.child0 = node(for: child0, backend, snapshots[0], environment)
  499. self.child1 = node(for: child1, backend, snapshots[1], environment)
  500. self.child2 = node(for: child2, backend, snapshots[2], environment)
  501. self.child3 = node(for: child3, backend, snapshots[3], environment)
  502. self.child4 = node(for: child4, backend, snapshots[4], environment)
  503. self.child5 = node(for: child5, backend, snapshots[5], environment)
  504. self.child6 = node(for: child6, backend, snapshots[6], environment)
  505. self.child7 = node(for: child7, backend, snapshots[7], environment)
  506. self.child8 = node(for: child8, backend, snapshots[8], environment)
  507. }
  508. }
  509. /// A fixed-length strongly-typed collection of 10 child nodes. A counterpart to
  510. /// ``TupleView10``.
  511. public class TupleViewChildren10<
  512. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  513. Child6: View,
  514. Child7: View, Child8: View, Child9: View
  515. >: TupleViewChildren {
  516. public var widgets: [AnyWidget] {
  517. return [
  518. child0.widget,
  519. child1.widget,
  520. child2.widget,
  521. child3.widget,
  522. child4.widget,
  523. child5.widget,
  524. child6.widget,
  525. child7.widget,
  526. child8.widget,
  527. child9.widget
  528. ]
  529. }
  530. public var erasedNodes: [ErasedViewGraphNode] {
  531. return [
  532. ErasedViewGraphNode(wrapping: child0),
  533. ErasedViewGraphNode(wrapping: child1),
  534. ErasedViewGraphNode(wrapping: child2),
  535. ErasedViewGraphNode(wrapping: child3),
  536. ErasedViewGraphNode(wrapping: child4),
  537. ErasedViewGraphNode(wrapping: child5),
  538. ErasedViewGraphNode(wrapping: child6),
  539. ErasedViewGraphNode(wrapping: child7),
  540. ErasedViewGraphNode(wrapping: child8),
  541. ErasedViewGraphNode(wrapping: child9),
  542. ]
  543. }
  544. var stackLayoutCache = StackLayoutCache.initial
  545. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  546. public var child0: AnyViewGraphNode<Child0>
  547. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  548. public var child1: AnyViewGraphNode<Child1>
  549. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  550. public var child2: AnyViewGraphNode<Child2>
  551. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  552. public var child3: AnyViewGraphNode<Child3>
  553. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  554. public var child4: AnyViewGraphNode<Child4>
  555. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  556. public var child5: AnyViewGraphNode<Child5>
  557. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  558. public var child6: AnyViewGraphNode<Child6>
  559. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  560. public var child7: AnyViewGraphNode<Child7>
  561. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  562. public var child8: AnyViewGraphNode<Child8>
  563. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  564. public var child9: AnyViewGraphNode<Child9>
  565. /// Creates the nodes for 10 child views.
  566. public init<Backend: BaseAppBackend>(
  567. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  568. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  569. _ child9: Child9,
  570. backend: Backend,
  571. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  572. environment: EnvironmentValues
  573. ) {
  574. let viewTypeNames = [
  575. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  576. ViewGraphSnapshotter.name(of: Child2.self),
  577. ViewGraphSnapshotter.name(of: Child3.self),
  578. ViewGraphSnapshotter.name(of: Child4.self),
  579. ViewGraphSnapshotter.name(of: Child5.self),
  580. ViewGraphSnapshotter.name(of: Child6.self),
  581. ViewGraphSnapshotter.name(of: Child7.self),
  582. ViewGraphSnapshotter.name(of: Child8.self),
  583. ViewGraphSnapshotter.name(of: Child9.self)
  584. ]
  585. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  586. self.child0 = node(for: child0, backend, snapshots[0], environment)
  587. self.child1 = node(for: child1, backend, snapshots[1], environment)
  588. self.child2 = node(for: child2, backend, snapshots[2], environment)
  589. self.child3 = node(for: child3, backend, snapshots[3], environment)
  590. self.child4 = node(for: child4, backend, snapshots[4], environment)
  591. self.child5 = node(for: child5, backend, snapshots[5], environment)
  592. self.child6 = node(for: child6, backend, snapshots[6], environment)
  593. self.child7 = node(for: child7, backend, snapshots[7], environment)
  594. self.child8 = node(for: child8, backend, snapshots[8], environment)
  595. self.child9 = node(for: child9, backend, snapshots[9], environment)
  596. }
  597. }
  598. /// A fixed-length strongly-typed collection of 11 child nodes. A counterpart to
  599. /// ``TupleView11``.
  600. public class TupleViewChildren11<
  601. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  602. Child6: View,
  603. Child7: View, Child8: View, Child9: View, Child10: View
  604. >: TupleViewChildren {
  605. public var widgets: [AnyWidget] {
  606. return [
  607. child0.widget,
  608. child1.widget,
  609. child2.widget,
  610. child3.widget,
  611. child4.widget,
  612. child5.widget,
  613. child6.widget,
  614. child7.widget,
  615. child8.widget,
  616. child9.widget,
  617. child10.widget
  618. ]
  619. }
  620. public var erasedNodes: [ErasedViewGraphNode] {
  621. return [
  622. ErasedViewGraphNode(wrapping: child0),
  623. ErasedViewGraphNode(wrapping: child1),
  624. ErasedViewGraphNode(wrapping: child2),
  625. ErasedViewGraphNode(wrapping: child3),
  626. ErasedViewGraphNode(wrapping: child4),
  627. ErasedViewGraphNode(wrapping: child5),
  628. ErasedViewGraphNode(wrapping: child6),
  629. ErasedViewGraphNode(wrapping: child7),
  630. ErasedViewGraphNode(wrapping: child8),
  631. ErasedViewGraphNode(wrapping: child9),
  632. ErasedViewGraphNode(wrapping: child10),
  633. ]
  634. }
  635. var stackLayoutCache = StackLayoutCache.initial
  636. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  637. public var child0: AnyViewGraphNode<Child0>
  638. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  639. public var child1: AnyViewGraphNode<Child1>
  640. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  641. public var child2: AnyViewGraphNode<Child2>
  642. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  643. public var child3: AnyViewGraphNode<Child3>
  644. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  645. public var child4: AnyViewGraphNode<Child4>
  646. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  647. public var child5: AnyViewGraphNode<Child5>
  648. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  649. public var child6: AnyViewGraphNode<Child6>
  650. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  651. public var child7: AnyViewGraphNode<Child7>
  652. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  653. public var child8: AnyViewGraphNode<Child8>
  654. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  655. public var child9: AnyViewGraphNode<Child9>
  656. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  657. public var child10: AnyViewGraphNode<Child10>
  658. /// Creates the nodes for 11 child views.
  659. public init<Backend: BaseAppBackend>(
  660. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  661. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  662. _ child9: Child9,
  663. _ child10: Child10,
  664. backend: Backend,
  665. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  666. environment: EnvironmentValues
  667. ) {
  668. let viewTypeNames = [
  669. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  670. ViewGraphSnapshotter.name(of: Child2.self),
  671. ViewGraphSnapshotter.name(of: Child3.self),
  672. ViewGraphSnapshotter.name(of: Child4.self),
  673. ViewGraphSnapshotter.name(of: Child5.self),
  674. ViewGraphSnapshotter.name(of: Child6.self),
  675. ViewGraphSnapshotter.name(of: Child7.self),
  676. ViewGraphSnapshotter.name(of: Child8.self),
  677. ViewGraphSnapshotter.name(of: Child9.self),
  678. ViewGraphSnapshotter.name(of: Child10.self)
  679. ]
  680. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  681. self.child0 = node(for: child0, backend, snapshots[0], environment)
  682. self.child1 = node(for: child1, backend, snapshots[1], environment)
  683. self.child2 = node(for: child2, backend, snapshots[2], environment)
  684. self.child3 = node(for: child3, backend, snapshots[3], environment)
  685. self.child4 = node(for: child4, backend, snapshots[4], environment)
  686. self.child5 = node(for: child5, backend, snapshots[5], environment)
  687. self.child6 = node(for: child6, backend, snapshots[6], environment)
  688. self.child7 = node(for: child7, backend, snapshots[7], environment)
  689. self.child8 = node(for: child8, backend, snapshots[8], environment)
  690. self.child9 = node(for: child9, backend, snapshots[9], environment)
  691. self.child10 = node(for: child10, backend, snapshots[10], environment)
  692. }
  693. }
  694. /// A fixed-length strongly-typed collection of 12 child nodes. A counterpart to
  695. /// ``TupleView12``.
  696. public class TupleViewChildren12<
  697. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  698. Child6: View,
  699. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View
  700. >: TupleViewChildren {
  701. public var widgets: [AnyWidget] {
  702. return [
  703. child0.widget,
  704. child1.widget,
  705. child2.widget,
  706. child3.widget,
  707. child4.widget,
  708. child5.widget,
  709. child6.widget,
  710. child7.widget,
  711. child8.widget,
  712. child9.widget,
  713. child10.widget,
  714. child11.widget
  715. ]
  716. }
  717. public var erasedNodes: [ErasedViewGraphNode] {
  718. return [
  719. ErasedViewGraphNode(wrapping: child0),
  720. ErasedViewGraphNode(wrapping: child1),
  721. ErasedViewGraphNode(wrapping: child2),
  722. ErasedViewGraphNode(wrapping: child3),
  723. ErasedViewGraphNode(wrapping: child4),
  724. ErasedViewGraphNode(wrapping: child5),
  725. ErasedViewGraphNode(wrapping: child6),
  726. ErasedViewGraphNode(wrapping: child7),
  727. ErasedViewGraphNode(wrapping: child8),
  728. ErasedViewGraphNode(wrapping: child9),
  729. ErasedViewGraphNode(wrapping: child10),
  730. ErasedViewGraphNode(wrapping: child11),
  731. ]
  732. }
  733. var stackLayoutCache = StackLayoutCache.initial
  734. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  735. public var child0: AnyViewGraphNode<Child0>
  736. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  737. public var child1: AnyViewGraphNode<Child1>
  738. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  739. public var child2: AnyViewGraphNode<Child2>
  740. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  741. public var child3: AnyViewGraphNode<Child3>
  742. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  743. public var child4: AnyViewGraphNode<Child4>
  744. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  745. public var child5: AnyViewGraphNode<Child5>
  746. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  747. public var child6: AnyViewGraphNode<Child6>
  748. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  749. public var child7: AnyViewGraphNode<Child7>
  750. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  751. public var child8: AnyViewGraphNode<Child8>
  752. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  753. public var child9: AnyViewGraphNode<Child9>
  754. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  755. public var child10: AnyViewGraphNode<Child10>
  756. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  757. public var child11: AnyViewGraphNode<Child11>
  758. /// Creates the nodes for 12 child views.
  759. public init<Backend: BaseAppBackend>(
  760. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  761. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  762. _ child9: Child9,
  763. _ child10: Child10, _ child11: Child11,
  764. backend: Backend,
  765. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  766. environment: EnvironmentValues
  767. ) {
  768. let viewTypeNames = [
  769. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  770. ViewGraphSnapshotter.name(of: Child2.self),
  771. ViewGraphSnapshotter.name(of: Child3.self),
  772. ViewGraphSnapshotter.name(of: Child4.self),
  773. ViewGraphSnapshotter.name(of: Child5.self),
  774. ViewGraphSnapshotter.name(of: Child6.self),
  775. ViewGraphSnapshotter.name(of: Child7.self),
  776. ViewGraphSnapshotter.name(of: Child8.self),
  777. ViewGraphSnapshotter.name(of: Child9.self),
  778. ViewGraphSnapshotter.name(of: Child10.self),
  779. ViewGraphSnapshotter.name(of: Child11.self)
  780. ]
  781. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  782. self.child0 = node(for: child0, backend, snapshots[0], environment)
  783. self.child1 = node(for: child1, backend, snapshots[1], environment)
  784. self.child2 = node(for: child2, backend, snapshots[2], environment)
  785. self.child3 = node(for: child3, backend, snapshots[3], environment)
  786. self.child4 = node(for: child4, backend, snapshots[4], environment)
  787. self.child5 = node(for: child5, backend, snapshots[5], environment)
  788. self.child6 = node(for: child6, backend, snapshots[6], environment)
  789. self.child7 = node(for: child7, backend, snapshots[7], environment)
  790. self.child8 = node(for: child8, backend, snapshots[8], environment)
  791. self.child9 = node(for: child9, backend, snapshots[9], environment)
  792. self.child10 = node(for: child10, backend, snapshots[10], environment)
  793. self.child11 = node(for: child11, backend, snapshots[11], environment)
  794. }
  795. }
  796. /// A fixed-length strongly-typed collection of 13 child nodes. A counterpart to
  797. /// ``TupleView13``.
  798. public class TupleViewChildren13<
  799. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  800. Child6: View,
  801. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View
  802. >: TupleViewChildren {
  803. public var widgets: [AnyWidget] {
  804. return [
  805. child0.widget,
  806. child1.widget,
  807. child2.widget,
  808. child3.widget,
  809. child4.widget,
  810. child5.widget,
  811. child6.widget,
  812. child7.widget,
  813. child8.widget,
  814. child9.widget,
  815. child10.widget,
  816. child11.widget,
  817. child12.widget
  818. ]
  819. }
  820. public var erasedNodes: [ErasedViewGraphNode] {
  821. return [
  822. ErasedViewGraphNode(wrapping: child0),
  823. ErasedViewGraphNode(wrapping: child1),
  824. ErasedViewGraphNode(wrapping: child2),
  825. ErasedViewGraphNode(wrapping: child3),
  826. ErasedViewGraphNode(wrapping: child4),
  827. ErasedViewGraphNode(wrapping: child5),
  828. ErasedViewGraphNode(wrapping: child6),
  829. ErasedViewGraphNode(wrapping: child7),
  830. ErasedViewGraphNode(wrapping: child8),
  831. ErasedViewGraphNode(wrapping: child9),
  832. ErasedViewGraphNode(wrapping: child10),
  833. ErasedViewGraphNode(wrapping: child11),
  834. ErasedViewGraphNode(wrapping: child12),
  835. ]
  836. }
  837. var stackLayoutCache = StackLayoutCache.initial
  838. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  839. public var child0: AnyViewGraphNode<Child0>
  840. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  841. public var child1: AnyViewGraphNode<Child1>
  842. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  843. public var child2: AnyViewGraphNode<Child2>
  844. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  845. public var child3: AnyViewGraphNode<Child3>
  846. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  847. public var child4: AnyViewGraphNode<Child4>
  848. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  849. public var child5: AnyViewGraphNode<Child5>
  850. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  851. public var child6: AnyViewGraphNode<Child6>
  852. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  853. public var child7: AnyViewGraphNode<Child7>
  854. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  855. public var child8: AnyViewGraphNode<Child8>
  856. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  857. public var child9: AnyViewGraphNode<Child9>
  858. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  859. public var child10: AnyViewGraphNode<Child10>
  860. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  861. public var child11: AnyViewGraphNode<Child11>
  862. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  863. public var child12: AnyViewGraphNode<Child12>
  864. /// Creates the nodes for 13 child views.
  865. public init<Backend: BaseAppBackend>(
  866. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  867. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  868. _ child9: Child9,
  869. _ child10: Child10, _ child11: Child11, _ child12: Child12,
  870. backend: Backend,
  871. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  872. environment: EnvironmentValues
  873. ) {
  874. let viewTypeNames = [
  875. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  876. ViewGraphSnapshotter.name(of: Child2.self),
  877. ViewGraphSnapshotter.name(of: Child3.self),
  878. ViewGraphSnapshotter.name(of: Child4.self),
  879. ViewGraphSnapshotter.name(of: Child5.self),
  880. ViewGraphSnapshotter.name(of: Child6.self),
  881. ViewGraphSnapshotter.name(of: Child7.self),
  882. ViewGraphSnapshotter.name(of: Child8.self),
  883. ViewGraphSnapshotter.name(of: Child9.self),
  884. ViewGraphSnapshotter.name(of: Child10.self),
  885. ViewGraphSnapshotter.name(of: Child11.self),
  886. ViewGraphSnapshotter.name(of: Child12.self)
  887. ]
  888. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  889. self.child0 = node(for: child0, backend, snapshots[0], environment)
  890. self.child1 = node(for: child1, backend, snapshots[1], environment)
  891. self.child2 = node(for: child2, backend, snapshots[2], environment)
  892. self.child3 = node(for: child3, backend, snapshots[3], environment)
  893. self.child4 = node(for: child4, backend, snapshots[4], environment)
  894. self.child5 = node(for: child5, backend, snapshots[5], environment)
  895. self.child6 = node(for: child6, backend, snapshots[6], environment)
  896. self.child7 = node(for: child7, backend, snapshots[7], environment)
  897. self.child8 = node(for: child8, backend, snapshots[8], environment)
  898. self.child9 = node(for: child9, backend, snapshots[9], environment)
  899. self.child10 = node(for: child10, backend, snapshots[10], environment)
  900. self.child11 = node(for: child11, backend, snapshots[11], environment)
  901. self.child12 = node(for: child12, backend, snapshots[12], environment)
  902. }
  903. }
  904. /// A fixed-length strongly-typed collection of 14 child nodes. A counterpart to
  905. /// ``TupleView14``.
  906. public class TupleViewChildren14<
  907. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  908. Child6: View,
  909. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  910. Child13: View
  911. >: TupleViewChildren {
  912. public var widgets: [AnyWidget] {
  913. return [
  914. child0.widget,
  915. child1.widget,
  916. child2.widget,
  917. child3.widget,
  918. child4.widget,
  919. child5.widget,
  920. child6.widget,
  921. child7.widget,
  922. child8.widget,
  923. child9.widget,
  924. child10.widget,
  925. child11.widget,
  926. child12.widget,
  927. child13.widget
  928. ]
  929. }
  930. public var erasedNodes: [ErasedViewGraphNode] {
  931. return [
  932. ErasedViewGraphNode(wrapping: child0),
  933. ErasedViewGraphNode(wrapping: child1),
  934. ErasedViewGraphNode(wrapping: child2),
  935. ErasedViewGraphNode(wrapping: child3),
  936. ErasedViewGraphNode(wrapping: child4),
  937. ErasedViewGraphNode(wrapping: child5),
  938. ErasedViewGraphNode(wrapping: child6),
  939. ErasedViewGraphNode(wrapping: child7),
  940. ErasedViewGraphNode(wrapping: child8),
  941. ErasedViewGraphNode(wrapping: child9),
  942. ErasedViewGraphNode(wrapping: child10),
  943. ErasedViewGraphNode(wrapping: child11),
  944. ErasedViewGraphNode(wrapping: child12),
  945. ErasedViewGraphNode(wrapping: child13),
  946. ]
  947. }
  948. var stackLayoutCache = StackLayoutCache.initial
  949. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  950. public var child0: AnyViewGraphNode<Child0>
  951. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  952. public var child1: AnyViewGraphNode<Child1>
  953. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  954. public var child2: AnyViewGraphNode<Child2>
  955. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  956. public var child3: AnyViewGraphNode<Child3>
  957. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  958. public var child4: AnyViewGraphNode<Child4>
  959. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  960. public var child5: AnyViewGraphNode<Child5>
  961. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  962. public var child6: AnyViewGraphNode<Child6>
  963. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  964. public var child7: AnyViewGraphNode<Child7>
  965. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  966. public var child8: AnyViewGraphNode<Child8>
  967. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  968. public var child9: AnyViewGraphNode<Child9>
  969. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  970. public var child10: AnyViewGraphNode<Child10>
  971. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  972. public var child11: AnyViewGraphNode<Child11>
  973. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  974. public var child12: AnyViewGraphNode<Child12>
  975. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  976. public var child13: AnyViewGraphNode<Child13>
  977. /// Creates the nodes for 14 child views.
  978. public init<Backend: BaseAppBackend>(
  979. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  980. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  981. _ child9: Child9,
  982. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  983. backend: Backend,
  984. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  985. environment: EnvironmentValues
  986. ) {
  987. let viewTypeNames = [
  988. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  989. ViewGraphSnapshotter.name(of: Child2.self),
  990. ViewGraphSnapshotter.name(of: Child3.self),
  991. ViewGraphSnapshotter.name(of: Child4.self),
  992. ViewGraphSnapshotter.name(of: Child5.self),
  993. ViewGraphSnapshotter.name(of: Child6.self),
  994. ViewGraphSnapshotter.name(of: Child7.self),
  995. ViewGraphSnapshotter.name(of: Child8.self),
  996. ViewGraphSnapshotter.name(of: Child9.self),
  997. ViewGraphSnapshotter.name(of: Child10.self),
  998. ViewGraphSnapshotter.name(of: Child11.self),
  999. ViewGraphSnapshotter.name(of: Child12.self),
  1000. ViewGraphSnapshotter.name(of: Child13.self)
  1001. ]
  1002. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1003. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1004. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1005. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1006. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1007. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1008. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1009. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1010. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1011. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1012. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1013. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1014. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1015. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1016. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1017. }
  1018. }
  1019. /// A fixed-length strongly-typed collection of 15 child nodes. A counterpart to
  1020. /// ``TupleView15``.
  1021. public class TupleViewChildren15<
  1022. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1023. Child6: View,
  1024. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1025. Child13: View, Child14: View
  1026. >: TupleViewChildren {
  1027. public var widgets: [AnyWidget] {
  1028. return [
  1029. child0.widget,
  1030. child1.widget,
  1031. child2.widget,
  1032. child3.widget,
  1033. child4.widget,
  1034. child5.widget,
  1035. child6.widget,
  1036. child7.widget,
  1037. child8.widget,
  1038. child9.widget,
  1039. child10.widget,
  1040. child11.widget,
  1041. child12.widget,
  1042. child13.widget,
  1043. child14.widget
  1044. ]
  1045. }
  1046. public var erasedNodes: [ErasedViewGraphNode] {
  1047. return [
  1048. ErasedViewGraphNode(wrapping: child0),
  1049. ErasedViewGraphNode(wrapping: child1),
  1050. ErasedViewGraphNode(wrapping: child2),
  1051. ErasedViewGraphNode(wrapping: child3),
  1052. ErasedViewGraphNode(wrapping: child4),
  1053. ErasedViewGraphNode(wrapping: child5),
  1054. ErasedViewGraphNode(wrapping: child6),
  1055. ErasedViewGraphNode(wrapping: child7),
  1056. ErasedViewGraphNode(wrapping: child8),
  1057. ErasedViewGraphNode(wrapping: child9),
  1058. ErasedViewGraphNode(wrapping: child10),
  1059. ErasedViewGraphNode(wrapping: child11),
  1060. ErasedViewGraphNode(wrapping: child12),
  1061. ErasedViewGraphNode(wrapping: child13),
  1062. ErasedViewGraphNode(wrapping: child14),
  1063. ]
  1064. }
  1065. var stackLayoutCache = StackLayoutCache.initial
  1066. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1067. public var child0: AnyViewGraphNode<Child0>
  1068. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1069. public var child1: AnyViewGraphNode<Child1>
  1070. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1071. public var child2: AnyViewGraphNode<Child2>
  1072. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1073. public var child3: AnyViewGraphNode<Child3>
  1074. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1075. public var child4: AnyViewGraphNode<Child4>
  1076. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1077. public var child5: AnyViewGraphNode<Child5>
  1078. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1079. public var child6: AnyViewGraphNode<Child6>
  1080. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1081. public var child7: AnyViewGraphNode<Child7>
  1082. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1083. public var child8: AnyViewGraphNode<Child8>
  1084. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1085. public var child9: AnyViewGraphNode<Child9>
  1086. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1087. public var child10: AnyViewGraphNode<Child10>
  1088. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1089. public var child11: AnyViewGraphNode<Child11>
  1090. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1091. public var child12: AnyViewGraphNode<Child12>
  1092. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1093. public var child13: AnyViewGraphNode<Child13>
  1094. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1095. public var child14: AnyViewGraphNode<Child14>
  1096. /// Creates the nodes for 15 child views.
  1097. public init<Backend: BaseAppBackend>(
  1098. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1099. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1100. _ child9: Child9,
  1101. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1102. _ child14: Child14,
  1103. backend: Backend,
  1104. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1105. environment: EnvironmentValues
  1106. ) {
  1107. let viewTypeNames = [
  1108. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1109. ViewGraphSnapshotter.name(of: Child2.self),
  1110. ViewGraphSnapshotter.name(of: Child3.self),
  1111. ViewGraphSnapshotter.name(of: Child4.self),
  1112. ViewGraphSnapshotter.name(of: Child5.self),
  1113. ViewGraphSnapshotter.name(of: Child6.self),
  1114. ViewGraphSnapshotter.name(of: Child7.self),
  1115. ViewGraphSnapshotter.name(of: Child8.self),
  1116. ViewGraphSnapshotter.name(of: Child9.self),
  1117. ViewGraphSnapshotter.name(of: Child10.self),
  1118. ViewGraphSnapshotter.name(of: Child11.self),
  1119. ViewGraphSnapshotter.name(of: Child12.self),
  1120. ViewGraphSnapshotter.name(of: Child13.self),
  1121. ViewGraphSnapshotter.name(of: Child14.self)
  1122. ]
  1123. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1124. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1125. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1126. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1127. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1128. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1129. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1130. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1131. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1132. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1133. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1134. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1135. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1136. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1137. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1138. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1139. }
  1140. }
  1141. /// A fixed-length strongly-typed collection of 16 child nodes. A counterpart to
  1142. /// ``TupleView16``.
  1143. public class TupleViewChildren16<
  1144. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1145. Child6: View,
  1146. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1147. Child13: View, Child14: View, Child15: View
  1148. >: TupleViewChildren {
  1149. public var widgets: [AnyWidget] {
  1150. return [
  1151. child0.widget,
  1152. child1.widget,
  1153. child2.widget,
  1154. child3.widget,
  1155. child4.widget,
  1156. child5.widget,
  1157. child6.widget,
  1158. child7.widget,
  1159. child8.widget,
  1160. child9.widget,
  1161. child10.widget,
  1162. child11.widget,
  1163. child12.widget,
  1164. child13.widget,
  1165. child14.widget,
  1166. child15.widget
  1167. ]
  1168. }
  1169. public var erasedNodes: [ErasedViewGraphNode] {
  1170. return [
  1171. ErasedViewGraphNode(wrapping: child0),
  1172. ErasedViewGraphNode(wrapping: child1),
  1173. ErasedViewGraphNode(wrapping: child2),
  1174. ErasedViewGraphNode(wrapping: child3),
  1175. ErasedViewGraphNode(wrapping: child4),
  1176. ErasedViewGraphNode(wrapping: child5),
  1177. ErasedViewGraphNode(wrapping: child6),
  1178. ErasedViewGraphNode(wrapping: child7),
  1179. ErasedViewGraphNode(wrapping: child8),
  1180. ErasedViewGraphNode(wrapping: child9),
  1181. ErasedViewGraphNode(wrapping: child10),
  1182. ErasedViewGraphNode(wrapping: child11),
  1183. ErasedViewGraphNode(wrapping: child12),
  1184. ErasedViewGraphNode(wrapping: child13),
  1185. ErasedViewGraphNode(wrapping: child14),
  1186. ErasedViewGraphNode(wrapping: child15),
  1187. ]
  1188. }
  1189. var stackLayoutCache = StackLayoutCache.initial
  1190. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1191. public var child0: AnyViewGraphNode<Child0>
  1192. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1193. public var child1: AnyViewGraphNode<Child1>
  1194. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1195. public var child2: AnyViewGraphNode<Child2>
  1196. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1197. public var child3: AnyViewGraphNode<Child3>
  1198. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1199. public var child4: AnyViewGraphNode<Child4>
  1200. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1201. public var child5: AnyViewGraphNode<Child5>
  1202. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1203. public var child6: AnyViewGraphNode<Child6>
  1204. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1205. public var child7: AnyViewGraphNode<Child7>
  1206. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1207. public var child8: AnyViewGraphNode<Child8>
  1208. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1209. public var child9: AnyViewGraphNode<Child9>
  1210. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1211. public var child10: AnyViewGraphNode<Child10>
  1212. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1213. public var child11: AnyViewGraphNode<Child11>
  1214. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1215. public var child12: AnyViewGraphNode<Child12>
  1216. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1217. public var child13: AnyViewGraphNode<Child13>
  1218. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1219. public var child14: AnyViewGraphNode<Child14>
  1220. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1221. public var child15: AnyViewGraphNode<Child15>
  1222. /// Creates the nodes for 16 child views.
  1223. public init<Backend: BaseAppBackend>(
  1224. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1225. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1226. _ child9: Child9,
  1227. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1228. _ child14: Child14, _ child15: Child15,
  1229. backend: Backend,
  1230. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1231. environment: EnvironmentValues
  1232. ) {
  1233. let viewTypeNames = [
  1234. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1235. ViewGraphSnapshotter.name(of: Child2.self),
  1236. ViewGraphSnapshotter.name(of: Child3.self),
  1237. ViewGraphSnapshotter.name(of: Child4.self),
  1238. ViewGraphSnapshotter.name(of: Child5.self),
  1239. ViewGraphSnapshotter.name(of: Child6.self),
  1240. ViewGraphSnapshotter.name(of: Child7.self),
  1241. ViewGraphSnapshotter.name(of: Child8.self),
  1242. ViewGraphSnapshotter.name(of: Child9.self),
  1243. ViewGraphSnapshotter.name(of: Child10.self),
  1244. ViewGraphSnapshotter.name(of: Child11.self),
  1245. ViewGraphSnapshotter.name(of: Child12.self),
  1246. ViewGraphSnapshotter.name(of: Child13.self),
  1247. ViewGraphSnapshotter.name(of: Child14.self),
  1248. ViewGraphSnapshotter.name(of: Child15.self)
  1249. ]
  1250. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1251. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1252. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1253. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1254. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1255. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1256. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1257. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1258. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1259. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1260. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1261. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1262. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1263. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1264. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1265. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1266. self.child15 = node(for: child15, backend, snapshots[15], environment)
  1267. }
  1268. }
  1269. /// A fixed-length strongly-typed collection of 17 child nodes. A counterpart to
  1270. /// ``TupleView17``.
  1271. public class TupleViewChildren17<
  1272. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1273. Child6: View,
  1274. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1275. Child13: View, Child14: View, Child15: View, Child16: View
  1276. >: TupleViewChildren {
  1277. public var widgets: [AnyWidget] {
  1278. return [
  1279. child0.widget,
  1280. child1.widget,
  1281. child2.widget,
  1282. child3.widget,
  1283. child4.widget,
  1284. child5.widget,
  1285. child6.widget,
  1286. child7.widget,
  1287. child8.widget,
  1288. child9.widget,
  1289. child10.widget,
  1290. child11.widget,
  1291. child12.widget,
  1292. child13.widget,
  1293. child14.widget,
  1294. child15.widget,
  1295. child16.widget
  1296. ]
  1297. }
  1298. public var erasedNodes: [ErasedViewGraphNode] {
  1299. return [
  1300. ErasedViewGraphNode(wrapping: child0),
  1301. ErasedViewGraphNode(wrapping: child1),
  1302. ErasedViewGraphNode(wrapping: child2),
  1303. ErasedViewGraphNode(wrapping: child3),
  1304. ErasedViewGraphNode(wrapping: child4),
  1305. ErasedViewGraphNode(wrapping: child5),
  1306. ErasedViewGraphNode(wrapping: child6),
  1307. ErasedViewGraphNode(wrapping: child7),
  1308. ErasedViewGraphNode(wrapping: child8),
  1309. ErasedViewGraphNode(wrapping: child9),
  1310. ErasedViewGraphNode(wrapping: child10),
  1311. ErasedViewGraphNode(wrapping: child11),
  1312. ErasedViewGraphNode(wrapping: child12),
  1313. ErasedViewGraphNode(wrapping: child13),
  1314. ErasedViewGraphNode(wrapping: child14),
  1315. ErasedViewGraphNode(wrapping: child15),
  1316. ErasedViewGraphNode(wrapping: child16),
  1317. ]
  1318. }
  1319. var stackLayoutCache = StackLayoutCache.initial
  1320. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1321. public var child0: AnyViewGraphNode<Child0>
  1322. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1323. public var child1: AnyViewGraphNode<Child1>
  1324. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1325. public var child2: AnyViewGraphNode<Child2>
  1326. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1327. public var child3: AnyViewGraphNode<Child3>
  1328. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1329. public var child4: AnyViewGraphNode<Child4>
  1330. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1331. public var child5: AnyViewGraphNode<Child5>
  1332. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1333. public var child6: AnyViewGraphNode<Child6>
  1334. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1335. public var child7: AnyViewGraphNode<Child7>
  1336. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1337. public var child8: AnyViewGraphNode<Child8>
  1338. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1339. public var child9: AnyViewGraphNode<Child9>
  1340. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1341. public var child10: AnyViewGraphNode<Child10>
  1342. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1343. public var child11: AnyViewGraphNode<Child11>
  1344. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1345. public var child12: AnyViewGraphNode<Child12>
  1346. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1347. public var child13: AnyViewGraphNode<Child13>
  1348. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1349. public var child14: AnyViewGraphNode<Child14>
  1350. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1351. public var child15: AnyViewGraphNode<Child15>
  1352. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1353. public var child16: AnyViewGraphNode<Child16>
  1354. /// Creates the nodes for 17 child views.
  1355. public init<Backend: BaseAppBackend>(
  1356. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1357. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1358. _ child9: Child9,
  1359. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1360. _ child14: Child14, _ child15: Child15, _ child16: Child16,
  1361. backend: Backend,
  1362. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1363. environment: EnvironmentValues
  1364. ) {
  1365. let viewTypeNames = [
  1366. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1367. ViewGraphSnapshotter.name(of: Child2.self),
  1368. ViewGraphSnapshotter.name(of: Child3.self),
  1369. ViewGraphSnapshotter.name(of: Child4.self),
  1370. ViewGraphSnapshotter.name(of: Child5.self),
  1371. ViewGraphSnapshotter.name(of: Child6.self),
  1372. ViewGraphSnapshotter.name(of: Child7.self),
  1373. ViewGraphSnapshotter.name(of: Child8.self),
  1374. ViewGraphSnapshotter.name(of: Child9.self),
  1375. ViewGraphSnapshotter.name(of: Child10.self),
  1376. ViewGraphSnapshotter.name(of: Child11.self),
  1377. ViewGraphSnapshotter.name(of: Child12.self),
  1378. ViewGraphSnapshotter.name(of: Child13.self),
  1379. ViewGraphSnapshotter.name(of: Child14.self),
  1380. ViewGraphSnapshotter.name(of: Child15.self),
  1381. ViewGraphSnapshotter.name(of: Child16.self)
  1382. ]
  1383. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1384. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1385. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1386. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1387. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1388. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1389. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1390. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1391. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1392. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1393. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1394. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1395. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1396. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1397. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1398. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1399. self.child15 = node(for: child15, backend, snapshots[15], environment)
  1400. self.child16 = node(for: child16, backend, snapshots[16], environment)
  1401. }
  1402. }
  1403. /// A fixed-length strongly-typed collection of 18 child nodes. A counterpart to
  1404. /// ``TupleView18``.
  1405. public class TupleViewChildren18<
  1406. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1407. Child6: View,
  1408. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1409. Child13: View, Child14: View, Child15: View, Child16: View, Child17: View
  1410. >: TupleViewChildren {
  1411. public var widgets: [AnyWidget] {
  1412. return [
  1413. child0.widget,
  1414. child1.widget,
  1415. child2.widget,
  1416. child3.widget,
  1417. child4.widget,
  1418. child5.widget,
  1419. child6.widget,
  1420. child7.widget,
  1421. child8.widget,
  1422. child9.widget,
  1423. child10.widget,
  1424. child11.widget,
  1425. child12.widget,
  1426. child13.widget,
  1427. child14.widget,
  1428. child15.widget,
  1429. child16.widget,
  1430. child17.widget
  1431. ]
  1432. }
  1433. public var erasedNodes: [ErasedViewGraphNode] {
  1434. return [
  1435. ErasedViewGraphNode(wrapping: child0),
  1436. ErasedViewGraphNode(wrapping: child1),
  1437. ErasedViewGraphNode(wrapping: child2),
  1438. ErasedViewGraphNode(wrapping: child3),
  1439. ErasedViewGraphNode(wrapping: child4),
  1440. ErasedViewGraphNode(wrapping: child5),
  1441. ErasedViewGraphNode(wrapping: child6),
  1442. ErasedViewGraphNode(wrapping: child7),
  1443. ErasedViewGraphNode(wrapping: child8),
  1444. ErasedViewGraphNode(wrapping: child9),
  1445. ErasedViewGraphNode(wrapping: child10),
  1446. ErasedViewGraphNode(wrapping: child11),
  1447. ErasedViewGraphNode(wrapping: child12),
  1448. ErasedViewGraphNode(wrapping: child13),
  1449. ErasedViewGraphNode(wrapping: child14),
  1450. ErasedViewGraphNode(wrapping: child15),
  1451. ErasedViewGraphNode(wrapping: child16),
  1452. ErasedViewGraphNode(wrapping: child17),
  1453. ]
  1454. }
  1455. var stackLayoutCache = StackLayoutCache.initial
  1456. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1457. public var child0: AnyViewGraphNode<Child0>
  1458. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1459. public var child1: AnyViewGraphNode<Child1>
  1460. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1461. public var child2: AnyViewGraphNode<Child2>
  1462. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1463. public var child3: AnyViewGraphNode<Child3>
  1464. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1465. public var child4: AnyViewGraphNode<Child4>
  1466. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1467. public var child5: AnyViewGraphNode<Child5>
  1468. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1469. public var child6: AnyViewGraphNode<Child6>
  1470. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1471. public var child7: AnyViewGraphNode<Child7>
  1472. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1473. public var child8: AnyViewGraphNode<Child8>
  1474. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1475. public var child9: AnyViewGraphNode<Child9>
  1476. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1477. public var child10: AnyViewGraphNode<Child10>
  1478. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1479. public var child11: AnyViewGraphNode<Child11>
  1480. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1481. public var child12: AnyViewGraphNode<Child12>
  1482. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1483. public var child13: AnyViewGraphNode<Child13>
  1484. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1485. public var child14: AnyViewGraphNode<Child14>
  1486. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1487. public var child15: AnyViewGraphNode<Child15>
  1488. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1489. public var child16: AnyViewGraphNode<Child16>
  1490. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1491. public var child17: AnyViewGraphNode<Child17>
  1492. /// Creates the nodes for 18 child views.
  1493. public init<Backend: BaseAppBackend>(
  1494. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1495. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1496. _ child9: Child9,
  1497. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1498. _ child14: Child14, _ child15: Child15, _ child16: Child16, _ child17: Child17,
  1499. backend: Backend,
  1500. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1501. environment: EnvironmentValues
  1502. ) {
  1503. let viewTypeNames = [
  1504. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1505. ViewGraphSnapshotter.name(of: Child2.self),
  1506. ViewGraphSnapshotter.name(of: Child3.self),
  1507. ViewGraphSnapshotter.name(of: Child4.self),
  1508. ViewGraphSnapshotter.name(of: Child5.self),
  1509. ViewGraphSnapshotter.name(of: Child6.self),
  1510. ViewGraphSnapshotter.name(of: Child7.self),
  1511. ViewGraphSnapshotter.name(of: Child8.self),
  1512. ViewGraphSnapshotter.name(of: Child9.self),
  1513. ViewGraphSnapshotter.name(of: Child10.self),
  1514. ViewGraphSnapshotter.name(of: Child11.self),
  1515. ViewGraphSnapshotter.name(of: Child12.self),
  1516. ViewGraphSnapshotter.name(of: Child13.self),
  1517. ViewGraphSnapshotter.name(of: Child14.self),
  1518. ViewGraphSnapshotter.name(of: Child15.self),
  1519. ViewGraphSnapshotter.name(of: Child16.self),
  1520. ViewGraphSnapshotter.name(of: Child17.self)
  1521. ]
  1522. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1523. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1524. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1525. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1526. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1527. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1528. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1529. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1530. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1531. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1532. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1533. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1534. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1535. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1536. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1537. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1538. self.child15 = node(for: child15, backend, snapshots[15], environment)
  1539. self.child16 = node(for: child16, backend, snapshots[16], environment)
  1540. self.child17 = node(for: child17, backend, snapshots[17], environment)
  1541. }
  1542. }
  1543. /// A fixed-length strongly-typed collection of 19 child nodes. A counterpart to
  1544. /// ``TupleView19``.
  1545. public class TupleViewChildren19<
  1546. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1547. Child6: View,
  1548. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1549. Child13: View, Child14: View, Child15: View, Child16: View, Child17: View, Child18: View
  1550. >: TupleViewChildren {
  1551. public var widgets: [AnyWidget] {
  1552. return [
  1553. child0.widget,
  1554. child1.widget,
  1555. child2.widget,
  1556. child3.widget,
  1557. child4.widget,
  1558. child5.widget,
  1559. child6.widget,
  1560. child7.widget,
  1561. child8.widget,
  1562. child9.widget,
  1563. child10.widget,
  1564. child11.widget,
  1565. child12.widget,
  1566. child13.widget,
  1567. child14.widget,
  1568. child15.widget,
  1569. child16.widget,
  1570. child17.widget,
  1571. child18.widget
  1572. ]
  1573. }
  1574. public var erasedNodes: [ErasedViewGraphNode] {
  1575. return [
  1576. ErasedViewGraphNode(wrapping: child0),
  1577. ErasedViewGraphNode(wrapping: child1),
  1578. ErasedViewGraphNode(wrapping: child2),
  1579. ErasedViewGraphNode(wrapping: child3),
  1580. ErasedViewGraphNode(wrapping: child4),
  1581. ErasedViewGraphNode(wrapping: child5),
  1582. ErasedViewGraphNode(wrapping: child6),
  1583. ErasedViewGraphNode(wrapping: child7),
  1584. ErasedViewGraphNode(wrapping: child8),
  1585. ErasedViewGraphNode(wrapping: child9),
  1586. ErasedViewGraphNode(wrapping: child10),
  1587. ErasedViewGraphNode(wrapping: child11),
  1588. ErasedViewGraphNode(wrapping: child12),
  1589. ErasedViewGraphNode(wrapping: child13),
  1590. ErasedViewGraphNode(wrapping: child14),
  1591. ErasedViewGraphNode(wrapping: child15),
  1592. ErasedViewGraphNode(wrapping: child16),
  1593. ErasedViewGraphNode(wrapping: child17),
  1594. ErasedViewGraphNode(wrapping: child18),
  1595. ]
  1596. }
  1597. var stackLayoutCache = StackLayoutCache.initial
  1598. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1599. public var child0: AnyViewGraphNode<Child0>
  1600. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1601. public var child1: AnyViewGraphNode<Child1>
  1602. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1603. public var child2: AnyViewGraphNode<Child2>
  1604. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1605. public var child3: AnyViewGraphNode<Child3>
  1606. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1607. public var child4: AnyViewGraphNode<Child4>
  1608. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1609. public var child5: AnyViewGraphNode<Child5>
  1610. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1611. public var child6: AnyViewGraphNode<Child6>
  1612. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1613. public var child7: AnyViewGraphNode<Child7>
  1614. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1615. public var child8: AnyViewGraphNode<Child8>
  1616. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1617. public var child9: AnyViewGraphNode<Child9>
  1618. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1619. public var child10: AnyViewGraphNode<Child10>
  1620. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1621. public var child11: AnyViewGraphNode<Child11>
  1622. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1623. public var child12: AnyViewGraphNode<Child12>
  1624. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1625. public var child13: AnyViewGraphNode<Child13>
  1626. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1627. public var child14: AnyViewGraphNode<Child14>
  1628. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1629. public var child15: AnyViewGraphNode<Child15>
  1630. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1631. public var child16: AnyViewGraphNode<Child16>
  1632. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1633. public var child17: AnyViewGraphNode<Child17>
  1634. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1635. public var child18: AnyViewGraphNode<Child18>
  1636. /// Creates the nodes for 19 child views.
  1637. public init<Backend: BaseAppBackend>(
  1638. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1639. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1640. _ child9: Child9,
  1641. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1642. _ child14: Child14, _ child15: Child15, _ child16: Child16, _ child17: Child17,
  1643. _ child18: Child18,
  1644. backend: Backend,
  1645. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1646. environment: EnvironmentValues
  1647. ) {
  1648. let viewTypeNames = [
  1649. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1650. ViewGraphSnapshotter.name(of: Child2.self),
  1651. ViewGraphSnapshotter.name(of: Child3.self),
  1652. ViewGraphSnapshotter.name(of: Child4.self),
  1653. ViewGraphSnapshotter.name(of: Child5.self),
  1654. ViewGraphSnapshotter.name(of: Child6.self),
  1655. ViewGraphSnapshotter.name(of: Child7.self),
  1656. ViewGraphSnapshotter.name(of: Child8.self),
  1657. ViewGraphSnapshotter.name(of: Child9.self),
  1658. ViewGraphSnapshotter.name(of: Child10.self),
  1659. ViewGraphSnapshotter.name(of: Child11.self),
  1660. ViewGraphSnapshotter.name(of: Child12.self),
  1661. ViewGraphSnapshotter.name(of: Child13.self),
  1662. ViewGraphSnapshotter.name(of: Child14.self),
  1663. ViewGraphSnapshotter.name(of: Child15.self),
  1664. ViewGraphSnapshotter.name(of: Child16.self),
  1665. ViewGraphSnapshotter.name(of: Child17.self),
  1666. ViewGraphSnapshotter.name(of: Child18.self)
  1667. ]
  1668. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1669. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1670. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1671. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1672. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1673. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1674. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1675. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1676. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1677. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1678. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1679. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1680. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1681. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1682. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1683. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1684. self.child15 = node(for: child15, backend, snapshots[15], environment)
  1685. self.child16 = node(for: child16, backend, snapshots[16], environment)
  1686. self.child17 = node(for: child17, backend, snapshots[17], environment)
  1687. self.child18 = node(for: child18, backend, snapshots[18], environment)
  1688. }
  1689. }
  1690. /// A fixed-length strongly-typed collection of 20 child nodes. A counterpart to
  1691. /// ``TupleView20``.
  1692. public class TupleViewChildren20<
  1693. Child0: View, Child1: View, Child2: View, Child3: View, Child4: View, Child5: View,
  1694. Child6: View,
  1695. Child7: View, Child8: View, Child9: View, Child10: View, Child11: View, Child12: View,
  1696. Child13: View, Child14: View, Child15: View, Child16: View, Child17: View, Child18: View,
  1697. Child19: View
  1698. >: TupleViewChildren {
  1699. public var widgets: [AnyWidget] {
  1700. return [
  1701. child0.widget,
  1702. child1.widget,
  1703. child2.widget,
  1704. child3.widget,
  1705. child4.widget,
  1706. child5.widget,
  1707. child6.widget,
  1708. child7.widget,
  1709. child8.widget,
  1710. child9.widget,
  1711. child10.widget,
  1712. child11.widget,
  1713. child12.widget,
  1714. child13.widget,
  1715. child14.widget,
  1716. child15.widget,
  1717. child16.widget,
  1718. child17.widget,
  1719. child18.widget,
  1720. child19.widget
  1721. ]
  1722. }
  1723. public var erasedNodes: [ErasedViewGraphNode] {
  1724. return [
  1725. ErasedViewGraphNode(wrapping: child0),
  1726. ErasedViewGraphNode(wrapping: child1),
  1727. ErasedViewGraphNode(wrapping: child2),
  1728. ErasedViewGraphNode(wrapping: child3),
  1729. ErasedViewGraphNode(wrapping: child4),
  1730. ErasedViewGraphNode(wrapping: child5),
  1731. ErasedViewGraphNode(wrapping: child6),
  1732. ErasedViewGraphNode(wrapping: child7),
  1733. ErasedViewGraphNode(wrapping: child8),
  1734. ErasedViewGraphNode(wrapping: child9),
  1735. ErasedViewGraphNode(wrapping: child10),
  1736. ErasedViewGraphNode(wrapping: child11),
  1737. ErasedViewGraphNode(wrapping: child12),
  1738. ErasedViewGraphNode(wrapping: child13),
  1739. ErasedViewGraphNode(wrapping: child14),
  1740. ErasedViewGraphNode(wrapping: child15),
  1741. ErasedViewGraphNode(wrapping: child16),
  1742. ErasedViewGraphNode(wrapping: child17),
  1743. ErasedViewGraphNode(wrapping: child18),
  1744. ErasedViewGraphNode(wrapping: child19),
  1745. ]
  1746. }
  1747. var stackLayoutCache = StackLayoutCache.initial
  1748. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1749. public var child0: AnyViewGraphNode<Child0>
  1750. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1751. public var child1: AnyViewGraphNode<Child1>
  1752. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1753. public var child2: AnyViewGraphNode<Child2>
  1754. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1755. public var child3: AnyViewGraphNode<Child3>
  1756. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1757. public var child4: AnyViewGraphNode<Child4>
  1758. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1759. public var child5: AnyViewGraphNode<Child5>
  1760. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1761. public var child6: AnyViewGraphNode<Child6>
  1762. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1763. public var child7: AnyViewGraphNode<Child7>
  1764. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1765. public var child8: AnyViewGraphNode<Child8>
  1766. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1767. public var child9: AnyViewGraphNode<Child9>
  1768. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1769. public var child10: AnyViewGraphNode<Child10>
  1770. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1771. public var child11: AnyViewGraphNode<Child11>
  1772. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1773. public var child12: AnyViewGraphNode<Child12>
  1774. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1775. public var child13: AnyViewGraphNode<Child13>
  1776. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1777. public var child14: AnyViewGraphNode<Child14>
  1778. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1779. public var child15: AnyViewGraphNode<Child15>
  1780. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1781. public var child16: AnyViewGraphNode<Child16>
  1782. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1783. public var child17: AnyViewGraphNode<Child17>
  1784. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1785. public var child18: AnyViewGraphNode<Child18>
  1786. /// ``AnyViewGraphNode`` is used instead of ``ViewGraphNode`` because otherwise the backend leaks into views.
  1787. public var child19: AnyViewGraphNode<Child19>
  1788. /// Creates the nodes for 20 child views.
  1789. public init<Backend: BaseAppBackend>(
  1790. _ child0: Child0, _ child1: Child1, _ child2: Child2, _ child3: Child3, _ child4: Child4,
  1791. _ child5: Child5, _ child6: Child6, _ child7: Child7, _ child8: Child8,
  1792. _ child9: Child9,
  1793. _ child10: Child10, _ child11: Child11, _ child12: Child12, _ child13: Child13,
  1794. _ child14: Child14, _ child15: Child15, _ child16: Child16, _ child17: Child17,
  1795. _ child18: Child18, _ child19: Child19,
  1796. backend: Backend,
  1797. snapshots: [ViewGraphSnapshotter.NodeSnapshot]?,
  1798. environment: EnvironmentValues
  1799. ) {
  1800. let viewTypeNames = [
  1801. ViewGraphSnapshotter.name(of: Child0.self), ViewGraphSnapshotter.name(of: Child1.self),
  1802. ViewGraphSnapshotter.name(of: Child2.self),
  1803. ViewGraphSnapshotter.name(of: Child3.self),
  1804. ViewGraphSnapshotter.name(of: Child4.self),
  1805. ViewGraphSnapshotter.name(of: Child5.self),
  1806. ViewGraphSnapshotter.name(of: Child6.self),
  1807. ViewGraphSnapshotter.name(of: Child7.self),
  1808. ViewGraphSnapshotter.name(of: Child8.self),
  1809. ViewGraphSnapshotter.name(of: Child9.self),
  1810. ViewGraphSnapshotter.name(of: Child10.self),
  1811. ViewGraphSnapshotter.name(of: Child11.self),
  1812. ViewGraphSnapshotter.name(of: Child12.self),
  1813. ViewGraphSnapshotter.name(of: Child13.self),
  1814. ViewGraphSnapshotter.name(of: Child14.self),
  1815. ViewGraphSnapshotter.name(of: Child15.self),
  1816. ViewGraphSnapshotter.name(of: Child16.self),
  1817. ViewGraphSnapshotter.name(of: Child17.self),
  1818. ViewGraphSnapshotter.name(of: Child18.self),
  1819. ViewGraphSnapshotter.name(of: Child19.self)
  1820. ]
  1821. let snapshots = ViewGraphSnapshotter.match(snapshots ?? [], to: viewTypeNames)
  1822. self.child0 = node(for: child0, backend, snapshots[0], environment)
  1823. self.child1 = node(for: child1, backend, snapshots[1], environment)
  1824. self.child2 = node(for: child2, backend, snapshots[2], environment)
  1825. self.child3 = node(for: child3, backend, snapshots[3], environment)
  1826. self.child4 = node(for: child4, backend, snapshots[4], environment)
  1827. self.child5 = node(for: child5, backend, snapshots[5], environment)
  1828. self.child6 = node(for: child6, backend, snapshots[6], environment)
  1829. self.child7 = node(for: child7, backend, snapshots[7], environment)
  1830. self.child8 = node(for: child8, backend, snapshots[8], environment)
  1831. self.child9 = node(for: child9, backend, snapshots[9], environment)
  1832. self.child10 = node(for: child10, backend, snapshots[10], environment)
  1833. self.child11 = node(for: child11, backend, snapshots[11], environment)
  1834. self.child12 = node(for: child12, backend, snapshots[12], environment)
  1835. self.child13 = node(for: child13, backend, snapshots[13], environment)
  1836. self.child14 = node(for: child14, backend, snapshots[14], environment)
  1837. self.child15 = node(for: child15, backend, snapshots[15], environment)
  1838. self.child16 = node(for: child16, backend, snapshots[16], environment)
  1839. self.child17 = node(for: child17, backend, snapshots[17], environment)
  1840. self.child18 = node(for: child18, backend, snapshots[18], environment)
  1841. self.child19 = node(for: child19, backend, snapshots[19], environment)
  1842. }
  1843. }