Skip to content

Instantly share code, notes, and snippets.

View dJani97's full-sized avatar
💭
Fluttering...

János Dobszai dJani97

💭
Fluttering...
  • Flutter Developer at UpScale
  • Pécs, Hungary
  • 02:18 (UTC +02:00)
View GitHub Profile
@andreidiaconu
andreidiaconu / main.dart
Last active March 25, 2021 01:02
Code demonstrating how you can keep your ExpansionTile widgets expanded when you set a new state and replace the data. The key is to generate the keys that ExpansionTile uses from attributes of your data that are unique. Code to focus on is line 105. Original question was asked here https://stackoverflow.com/questions/50087222/prevent-expansiont…
import 'package:flutter/material.dart';
class ExpansionTileSample extends StatefulWidget {
@override
ExpansionTileSampleState createState() {
return new ExpansionTileSampleState();
}
}
class ExpansionTileSampleState extends State<ExpansionTileSample> {