1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-20 05:57:33 +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';
class BudgetsView extends StatefulWidget {
@override
@@ -22,17 +22,24 @@ class _BudgetsViewState extends State<BudgetsView>
final items = DummyDataService.getBudgetDataList(context);
final capTotal = sumBudgetDataPrimaryAmount(items);
final usedTotal = sumBudgetDataAmountUsed(items);
return SingleChildScrollView(
child: Container(
padding: isDisplayDesktop(context) ? EdgeInsets.only(top: 24) : null,
child: FinancialEntityView(
heroLabel: GalleryLocalizations.of(context).rallyBudgetLeft,
heroAmount: capTotal - usedTotal,
segments: buildSegmentsFromBudgetItems(items),
wholeAmount: capTotal,
financialEntityCards: buildBudgetDataListViews(items, context),
),
final detailItems = DummyDataService.getBudgetDetailList(
context,
capTotal: capTotal,
usedTotal: usedTotal,
);
return TabWithSidebar(
mainView: FinancialEntityView(
heroLabel: GalleryLocalizations.of(context).rallyBudgetLeft,
heroAmount: capTotal - usedTotal,
segments: buildSegmentsFromBudgetItems(items),
wholeAmount: capTotal,
financialEntityCards: buildBudgetDataListViews(items, context),
),
sidebarItems: [
for (UserDetailData item in detailItems)
SidebarItem(title: item.title, value: item.value)
],
);
}
}