Skip to content

Instantly share code, notes, and snippets.

@ben-xD
Last active March 26, 2022 12:05
Show Gist options
  • Save ben-xD/2b3be8885bc395f9167840ce853dc9b9 to your computer and use it in GitHub Desktop.
Save ben-xD/2b3be8885bc395f9167840ce853dc9b9 to your computer and use it in GitHub Desktop.
Redirected from https://link.orth.uk/hi
import 'package:flutter/material.dart';
import 'package:listenos/session.dart';
class SessionsScreen extends StatelessWidget {
SessionsScreen({Key? key}) : super(key: key);
final session = Session(author: "Ben Butterworth", createdAt: DateTime.now(), id: "flutter-festival", questions: [
Question(id: "some question", answers: [], createdAt: DateTime.now(), author: "Human being", text: "Some question"
)
]);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Author: ${session.author}"),
Text("Date: ${session.createdAt.toIso8601String()}"),
buildQuestionsWidget(session.questions),
Text(
"SessionsScreen",
style: TextStyle(color: Colors.blue),
),
],
),
),
),
);
// return Container(
// child: Text("SessionsScreen"),
// );
}
Widget buildQuestionsWidget(List<Question> questions) {
return Column(
children: questions.map((Question question) {
return Column(
children: [
Text("Question: ${question.text}"),
Text("Author: ${question.author}"),
],
);
}).toList(),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment