Files
lunasea/lib/modules/home/widgets/summary_tile.dart
Jagandeep Brar 291db7321f [Release] v3.3.0+330001 (#235)
NEW
- [Home/Calendar] New "schedule" view to view all days as one list
- [Home/Modules] Option to use module "brand" colours or the LunaSea list colours
- [Search] Option to hide adult categories
- [-arr/Catalogue] Ability to sort by date added
- [-arr/Search] Show the indexer/tracker on the collapsed tile

TWEAKS
- [Development] Updated Flutter packages

FIXES
- Multiple smaller crash/error fixes

Thanks to @lightglitch on GitHub for implementing the schedule calendar mode!
2020-08-16 14:01:11 -05:00

44 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lunasea/core.dart';
import 'package:lunasea/modules/home.dart';
class HomeSummaryTile extends StatelessWidget {
final String title;
final String subtitle;
final IconData icon;
final int index;
final String route;
final bool justPush;
final Color color;
HomeSummaryTile({
@required this.title,
@required this.subtitle,
@required this.icon,
@required this.index,
@required this.route,
@required this.color,
this.justPush = false,
});
@override
Widget build(BuildContext context) => ValueListenableBuilder(
valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.MODULES_BRAND_COLOURS.key]),
builder: (context, box, _) => LSCardTile(
title: LSTitle(text: title),
subtitle: LSSubtitle(text: subtitle),
leading: LSIconButton(
icon: icon,
color: HomeDatabaseValue.MODULES_BRAND_COLOURS.data
? color
: LSColors.list(index),
),
trailing: LSIconButton(
icon: Icons.arrow_forward_ios,
),
onTap: () async => justPush
? Navigator.of(context).pushNamed(route)
: Navigator.of(context).pushNamedAndRemoveUntil(route, (Route<dynamic> route) => false),
),
);
}