1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-11 23:39:14 +00:00

[Gallery] Update desktop Rally for pages that did not have designs before (#314)

* Update desktop Rally for pages that did not have designs before
This commit is contained in:
Per Classon
2020-02-06 12:02:30 +01:00
committed by GitHub
parent c1acfe799d
commit d04440c11f
15 changed files with 1118 additions and 807 deletions

View File

@@ -5,10 +5,10 @@
import 'package:flutter/widgets.dart';
import 'package:gallery/l10n/gallery_localizations.dart';
import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/studies/rally/charts/pie_chart.dart';
import 'package:gallery/studies/rally/data.dart';
import 'package:gallery/studies/rally/finance.dart';
import 'package:gallery/studies/rally/tabs/sidebar.dart';
/// A page that shows a summary of bills.
class BillsView extends StatefulWidget {
@@ -22,17 +22,25 @@ class _BillsViewState extends State<BillsView>
Widget build(BuildContext context) {
List<BillData> items = DummyDataService.getBillDataList(context);
final dueTotal = sumBillDataPrimaryAmount(items);
return SingleChildScrollView(
child: Container(
padding: isDisplayDesktop(context) ? EdgeInsets.only(top: 24) : null,
child: FinancialEntityView(
heroLabel: GalleryLocalizations.of(context).rallyBillsDue,
heroAmount: dueTotal,
segments: buildSegmentsFromBillItems(items),
wholeAmount: dueTotal,
financialEntityCards: buildBillDataListViews(items, context),
),
final paidTotal = sumBillDataPaidAmount(items);
final detailItems = DummyDataService.getBillDetailList(
context,
dueTotal: dueTotal,
paidTotal: paidTotal,
);
return TabWithSidebar(
mainView: FinancialEntityView(
heroLabel: GalleryLocalizations.of(context).rallyBillsDue,
heroAmount: dueTotal,
segments: buildSegmentsFromBillItems(items),
wholeAmount: dueTotal,
financialEntityCards: buildBillDataListViews(items, context),
),
sidebarItems: [
for (UserDetailData item in detailItems)
SidebarItem(title: item.title, value: item.value)
],
);
}
}