(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38149,e=>{"use strict";var t=e.i(43476);function s({title:e,description:s,controls:r,output:i}){return(0,t.jsxs)("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"text-3xl font-bold tracking-tight text-foreground mb-2",children:e}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-start",children:[(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsx)("div",{className:"bg-card rounded-2xl border border-border p-6 shadow-sm",children:r})}),(0,t.jsx)("div",{className:"lg:sticky lg:top-24",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider px-1",children:"Generated Output"}),i]})})]})]})}e.s(["ToolLayout",()=>s])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],55436)},39312,e=>{"use strict";let t=(0,e.i(75254).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],39312)},72520,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",()=>t],72520)},69638,e=>{"use strict";let t=(0,e.i(75254).default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckCircle",()=>t],69638)},24770,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(38149),i=e.i(21218),a=e.i(10980),l=e.i(69638),n=e.i(39312),o=e.i(86557),d=e.i(52008),c=e.i(55436),u=e.i(72520);let m=[{id:"rebuilds",title:"Reducing Widget Rebuilds",icon:i.Activity,summary:"Master the art of minimizing rebuilds to keep your app running at 60/120 FPS.",content:`
When a widget rebuilds, Flutter must re-reun its build method. If your UI tree is large, frequent rebuilds can cause "jank".

### Key Strategies:
* **Micro-optimizing with const**: Use the 'const' constructor for widgets that never change. This tells Flutter to reuse the existing instance.
* **RepaintBoundary**: Wrap heavy widgets in a RepaintBoundary to isolate their paint cycle.
* **Separating State**: Use state management (Riverpod/Bloc) to scoped build contexts so only the necessary parts of the UI rebuild.

\`\`\`dart
// BAD: Rebuilds everything
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        HeavyWidget(), // Rebuilds every time
        SimpleText(),
      ],
    );
  }
}

// GOOD: Reuses memory
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const Column(
      children: [
        HeavyWidget(), // Reused instance
        SimpleText(),
      ],
    );
  }
}
\`\`\`
    `},{id:"lists",title:"ListView Optimization",icon:d.Layers,summary:"Handle thousands of items with zero lag using lazy loading and fixed item extents.",content:`
Lists can be memory intensive if not handled correctly. Never use 'SingleChildScrollView' with a 'Column' for dynamic lists.

### Best Practices:
* **ListView.builder**: Always use the builder constructor for large or infinite lists. It only renders widgets visible on screen.
* **itemExtent**: If all items have the same height, providing an itemExtent significantly boosts scroll performance.
* **AutomaticKeepAliveClientMixin**: Use this carefully to preserve state of off-screen items.

\`\`\`dart
// Optimized ListView
ListView.builder(
  itemCount: 10000,
  itemExtent: 80.0, // Fixed height optimization
  itemBuilder: (context, index) {
    return ListTile(
      title: Text('Performance List Item $index'),
    );
  },
)
\`\`\`
    `},{id:"layout",title:"Layout Optimization",icon:o.Layout,summary:"Simplify your widget tree to reduce the time Flutter spends calculating sizes (layout pass).",content:`
Layout is calculated in a single pass in Flutter, but deep trees with too many 'Stacks' or 'Nested Rows/Columns' can increase computation time.

### Tips:
* **Avoid unnecessary nesting**: Don't wrap everything in a Container if you only need Padding. Use Padding widget directly.
* **ConstraintLayout**: For very complex layouts, consider CustomMultiChildLayout.
* **Intrinsics**: Avoid using IntrinsicHeight or IntrinsicWidth unless absolutely necessary, as they require an extra layout pass.
    `}];function x(){let[e,o]=(0,s.useState)(m[0]),[d,x]=(0,s.useState)(""),p=m.filter(e=>e.title.toLowerCase().includes(d.toLowerCase()));return(0,t.jsx)(r.ToolLayout,{title:"Flutter Performance Guide",description:"Deep dive into Flutter performance best practices. Learn how to optimize frames, memory, and energy usage.",controls:(0,t.jsxs)("div",{className:"space-y-6 h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Search,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:d,onChange:e=>x(e.target.value),placeholder:"Search topics...",className:"w-full pl-11 pr-4 py-3 bg-secondary/30 border border-border rounded-2xl outline-none focus:ring-2 focus:ring-primary transition-all font-medium"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 pr-2 custom-scrollbar",children:p.map(s=>(0,t.jsxs)("button",{onClick:()=>o(s),className:`w-full p-6 h-40 rounded-3xl border text-left transition-all relative overflow-hidden group ${e.id===s.id?"bg-primary/5 border-primary shadow-sm":"bg-card border-border hover:border-primary/50"}`,children:[(0,t.jsxs)("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:`p-2 rounded-xl ${e.id===s.id?"bg-primary text-white":"bg-secondary text-muted-foreground group-hover:bg-primary/20 group-hover:text-primary"}`,children:(0,t.jsx)(s.icon,{className:"w-5 h-5"})}),(0,t.jsx)("h4",{className:"font-extrabold text-sm",children:s.title})]}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground leading-relaxed line-clamp-2 mt-2",children:s.summary}),(0,t.jsxs)("div",{className:"mt-auto flex items-center gap-1 text-[10px] font-bold text-primary group-hover:translate-x-1 transition-transform",children:["READ CHAPTER ",(0,t.jsx)(u.ArrowRight,{className:"w-3 h-3"})]})]}),(0,t.jsx)(s.icon,{className:"absolute -bottom-4 -right-4 w-24 h-24 opacity-[0.03]"})]},s.id))})]}),output:(0,t.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-right-4 duration-500",children:[(0,t.jsxs)("div",{className:"p-10 bg-card border border-border rounded-[3rem] shadow-xl",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center",children:(0,t.jsx)(e.icon,{className:"w-6 h-6 text-primary"})}),(0,t.jsx)("h2",{className:"text-3xl font-black",children:e.title})]}),(0,t.jsx)("div",{className:"prose prose-invert max-w-none prose-p:text-muted-foreground prose-h3:text-foreground prose-h3:mt-8 prose-li:text-muted-foreground",children:(0,t.jsx)("div",{className:"whitespace-pre-line text-sm leading-relaxed",dangerouslySetInnerHTML:{__html:e.content.replace(/### (.*)/g,'<h3 class="text-xl font-bold mt-8 mb-4">$1</h3>').replace(/\* (.*)/g,'<li class="ml-4 mb-2">$1</li>').replace(/`([^`]+)`/g,'<code class="bg-secondary/50 px-1.5 py-0.5 rounded text-primary">$1</code>').replace(/```dart\n([\s\S]*?)```/g,'<pre class="bg-[#0a0a0a] p-6 rounded-2xl border border-border text-xs font-mono text-blue-300 my-6 overflow-x-auto">$1</pre>')}})}),(0,t.jsxs)("div",{className:"mt-12 pt-8 border-t border-border flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"flex -space-x-3",children:[1,2,3].map(e=>(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-secondary border-2 border-card"},e))}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground font-bold",children:"WRITTEN BY THE FLUTTERTOOLS TEAM"})]}),(0,t.jsxs)("button",{className:"flex items-center gap-2 px-6 py-2 bg-primary text-white text-xs font-bold rounded-xl hover:brightness-110 transition-all",children:["SHARE GUIDE ",(0,t.jsx)(n.Zap,{className:"w-3 h-3 fill-current"})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"p-4 bg-green-500/5 border border-green-500/20 rounded-2xl text-center",children:[(0,t.jsx)(l.CheckCircle,{className:"w-6 h-6 text-green-500 mx-auto mb-2"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-green-500 uppercase",children:"Verified Solution"})]}),(0,t.jsxs)("div",{className:"p-4 bg-blue-500/5 border border-blue-500/20 rounded-2xl text-center",children:[(0,t.jsx)(i.Activity,{className:"w-6 h-6 text-blue-500 mx-auto mb-2"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-blue-500 uppercase",children:"Impact: High"})]}),(0,t.jsxs)("div",{className:"p-4 bg-purple-500/5 border border-purple-500/20 rounded-2xl text-center",children:[(0,t.jsx)(a.BookOpen,{className:"w-6 h-6 text-purple-500 mx-auto mb-2"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-purple-500 uppercase",children:"Difficulty: Mid"})]})]})]})})}e.s(["default",()=>x])}]);