-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: loading from cache in some cases #290
- Loading branch information
1 parent
8221561
commit ced347f
Showing
27 changed files
with
411 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:frontend/components/EditableCard.dart'; | ||
import 'package:frontend/models/speaker.dart'; | ||
|
||
class DetailsScreen extends StatefulWidget { | ||
final Speaker speaker; | ||
const DetailsScreen({Key? key, required this.speaker}) : super(key: key); | ||
|
||
@override | ||
_DetailsScreenState createState() => _DetailsScreenState(); | ||
} | ||
|
||
class _DetailsScreenState extends State<DetailsScreen> | ||
with AutomaticKeepAliveClientMixin { | ||
|
||
@override | ||
bool get wantKeepAlive => true; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
super.build(context); | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
child: ListView( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: EditableCard( | ||
title: 'Bio', | ||
body: widget.speaker.bio ?? "", | ||
bodyEditedCallback: (newBio) { | ||
//speaker.bio = newBio; | ||
//TODO replace bio with service call to change bio | ||
print('replaced bio'); | ||
return Future.delayed(Duration.zero); | ||
}, | ||
isSingleline: false, | ||
textInputType: TextInputType.multiline, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.fromLTRB(8.0, 0, 8.0, 8.0), | ||
child: EditableCard( | ||
title: 'Notes', | ||
body: widget.speaker.notes ?? "", | ||
bodyEditedCallback: (newNotes) { | ||
//speaker.bio = newBio; | ||
//TODO replace bio with service call to change bio | ||
print('replaced notes'); | ||
return Future.delayed(Duration.zero); | ||
}, | ||
isSingleline: false, | ||
textInputType: TextInputType.multiline, | ||
), | ||
), | ||
], | ||
)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:frontend/components/participationCard.dart'; | ||
import 'package:frontend/main.dart'; | ||
import 'package:frontend/models/speaker.dart'; | ||
|
||
class ParticipationList extends StatefulWidget { | ||
final Speaker speaker; | ||
final Future<void> Function(Map<String, dynamic>) onParticipationChanged; | ||
final void Function() onParticipationDeleted; | ||
const ParticipationList({ | ||
Key? key, | ||
required this.speaker, | ||
required this.onParticipationChanged, | ||
required this.onParticipationDeleted, | ||
}) : super(key: key); | ||
|
||
@override | ||
_ParticipationListState createState() => _ParticipationListState(); | ||
} | ||
|
||
class _ParticipationListState extends State<ParticipationList> | ||
with AutomaticKeepAliveClientMixin { | ||
|
||
@override | ||
bool get wantKeepAlive => true; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
super.build(context); | ||
return LayoutBuilder( | ||
builder: (context, constraints) { | ||
bool small = constraints.maxWidth < App.SIZE; | ||
if (widget.speaker.participations != null) { | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
child: ListView( | ||
controller: ScrollController(), | ||
children: widget.speaker.participations!.reversed | ||
.map((e) => Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: ParticipationCard( | ||
participation: e, | ||
small: small, | ||
type: CardType.SPEAKER, | ||
onEdit: widget.onParticipationChanged, | ||
onDelete: widget.onParticipationDeleted, | ||
), | ||
)) | ||
.toList(), | ||
), | ||
), | ||
); | ||
} else { | ||
return Container(); | ||
} | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.