Skip to content

Instantly share code, notes, and snippets.

View hydroweaver's full-sized avatar

Karan hydroweaver

  • India
View GitHub Profile
onReorder: (OldIndex, NewIndex){
setState(() {
if(OldIndex < NewIndex){
NewIndex -= 1;
}
var getReplacedWidget = items.removeAt(OldIndex);
items.insert(NewIndex, getReplacedWidget);
});
},
class AppState extends State<App>
class AppState extends State<App>{
Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(
title: Text("First Empty Half Baked App"),
),
body: ReorderableListView(
children: <Widget>[
for(final value in items)
Text(
@hydroweaver
hydroweaver / statefulclass.dart
Last active January 6, 2020 13:55
Code for Medium Todo Post, Part 2
class App extends StatefulWidget{
@override
AppState createState() {
return AppState();
}
}