Skip to content

Instantly share code, notes, and snippets.

Andrei Diaconu andreidiaconu

Block or report user

Report or block andreidiaconu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andreidiaconu
andreidiaconu / main.dart
Last active Mar 13, 2020
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…
View main.dart
import 'package:flutter/material.dart';
class ExpansionTileSample extends StatefulWidget {
@override
ExpansionTileSampleState createState() {
return new ExpansionTileSampleState();
}
}
class ExpansionTileSampleState extends State<ExpansionTileSample> {
You can’t perform that action at this time.