your text
import ‘package:flutter/material.dart’;
your text
import ‘package:goschool/constants.dart’;
your text
import ‘package:goschool/models/homework.dart’;
your text
import ‘package:intl/intl.dart’;
your text
class RecentsHomeworks extends StatefulWidget {
your text
@override
your text
State createState() => _RecentsHomeworksState();
your text
}
your text
class _RecentsHomeworksState extends State {
your text
DateFormat dateFormat = DateFormat(“hh:mm a”);
your text
@override
your text
Widget build(BuildContext context) {
your text
return ListView.builder(
your text
shrinkWrap: true,
your text
itemCount: recentHomework.length,
your text
itemBuilder: (BuildContext context, int index) {
your text
Homework homework = recentHomeworks[index];
your text
return Row(
your text
children: [
your text
Container(
your text
margin: EdgeInsets.only(bottom: 30),
your text
padding: EdgeInsets.fromLTRB(20, 20, 10, 10),
your text
height: 100,
your text
width: 341,
your text
decoration: BoxDecoration(
your text
color: kCardColor,
your text
borderRadius: BorderRadius.circular(12),
your text
),
your text
child: Row(
your text
crossAxisAlignment: CrossAxisAlignment.start,
your text
mainAxisAlignment: MainAxisAlignment.spaceBetween,
your text
children: [
your text
Column(
your text
crossAxisAlignment: CrossAxisAlignment.start,
your text
children: [
your text
Text(homework.title,
your text
style: TextStyle(
your text
color: Colors.white,
your text
fontSize: 18,
your text
fontWeight: FontWeight.w500,
`your text`),
`your text`),
`your text`SizedBox(height: 15),
`your text`Row(
`your text` children: <Widget> [
`your text` Icon(
`your text` Icons.timelapse,
`your text` color: Theme.of(context).colorScheme.secondary,
`your text` size: 17,
),
`your text` Text(
`your text` "${DateTime.now().weekday == homework.dueTime.weekday? "Today" : DateFormat.EEEE()
`your text` .format(homework.dueTime)}, ${dateFormat.format(homework.dueTime)}",
`your text` style: TextStyle(
`your text` color: kTextColor,
`your text` fontSize: 15,
`your text` fontWeight: FontWeight.w500,
`your text` ),
`your text` ),
`your text` ],
`your text` )
`your text` ],
`your text` ),
`your text` _todoButton(homework),
`your text` ],),
`your text` )
`your text` ],
`your text` );
`your text` },
`your text` );
your text
}
your text
_todoButton(Homework homework ) {
your text
return RaisedButton(
your text
onPressed: () {
your text
setState(() {
your text
homework.isDone = !homework.isDone;
your text
});
your text
},
your text
shape: CircleBorder(side: BorderSide(color: Theme))
your text
);
your text
}
your text
}
Обновляла зависимости, перезагружала IDE, но ничего не помогает`
Линда Тетеева is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.