Skip to content

Commit

Permalink
🔥 Removed deprecated member
Browse files Browse the repository at this point in the history
🎨 Added more style to the datatable
  • Loading branch information
iqfareez committed Jul 19, 2021
1 parent bf37afb commit fe107b4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 0 additions & 2 deletions lib/utils/cupertinoSwitchListTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class CupertinoSwitchListTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
var color = activeColor ?? Theme.of(context).accentColor;
print("Active color: ${color.red} ${color.green} ${color.blue}");
final Widget control = new CupertinoSwitch(
value: value,
onChanged: onChanged,
Expand Down
3 changes: 0 additions & 3 deletions lib/views/GetPrayerTime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ class Error extends StatelessWidget {
),
SizedBox(height: 8),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).buttonColor,
),
child: Text('Retry', style: TextStyle(color: Colors.black)),
onPressed: onRetryPressed,
)
Expand Down
25 changes: 20 additions & 5 deletions lib/views/full_prayer_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PrayerDataTable extends StatelessWidget {
@required this.model,
}) : super(key: key);

final int today = DateTime.now().day;
final int todayIndex = DateTime.now().day - 1;
final Mpti906PrayerModel model;

@override
Expand All @@ -79,13 +79,28 @@ class PrayerDataTable extends StatelessWidget {
// columnSpacing: MediaQuery.of(context).size.width / 10,
// columnSpacing: 30,
rows: List.generate(model.data.times.length, (index) {
return DataRow(selected: index == today - 1, cells: [
DataCell(Text('${index + 1} / ${model.data.month}')),
return DataRow(selected: index == todayIndex, cells: [
DataCell(Container(
padding: EdgeInsets.all(3),
decoration: BoxDecoration(
color: Theme.of(context).brightness == Brightness.light
? Colors.teal.shade50
: Colors.teal.shade900,
borderRadius: BorderRadius.circular(3.0)),
child: Text(
'${index + 1} / ${model.data.month}',
),
)),
...model.data.times[index].map((day) {
return DataCell(Center(
child: Opacity(
opacity: (index < today - 1) ? 0.60 : 1.0,
child: Text(DateAndTime.toTimeReadable(day, true))),
opacity: (index < todayIndex) ? 0.60 : 1.0,
child: Text(
DateAndTime.toTimeReadable(day, true),
style: index == todayIndex
? TextStyle(fontWeight: FontWeight.bold)
: null,
)),
));
}).toList(),
]);
Expand Down

0 comments on commit fe107b4

Please sign in to comment.