mirror of
https://github.com/flutter/samples.git
synced 2026-04-21 22:43:06 +00:00
Some linting_tool updates and cleanup (#1279)
This commit is contained in:
@@ -20,8 +20,8 @@ class DefaultLintsPage extends StatelessWidget {
|
||||
return const CircularProgressIndicator.adaptive();
|
||||
}
|
||||
|
||||
if (rulesStore.defaultProfiles.isNotEmpty) {
|
||||
var defaultSets = rulesStore.defaultProfiles;
|
||||
final defaultSets = rulesStore.defaultProfiles;
|
||||
if (defaultSets.isNotEmpty) {
|
||||
final isDesktop = isDisplayLarge(context);
|
||||
final isTablet = isDisplayMedium(context);
|
||||
final startPadding = isTablet
|
||||
@@ -45,7 +45,7 @@ class DefaultLintsPage extends StatelessWidget {
|
||||
cacheExtent: 5,
|
||||
itemCount: defaultSets.length,
|
||||
itemBuilder: (context, index) {
|
||||
var profile = rulesStore.defaultProfiles[index];
|
||||
final profile = defaultSets[index];
|
||||
return ListTile(
|
||||
title: Text(
|
||||
profile.name,
|
||||
|
||||
@@ -20,7 +20,7 @@ class DefaultRulesPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final isDesktop = isDisplayLarge(context);
|
||||
final isTablet = isDisplayMedium(context);
|
||||
var textTheme = Theme.of(context).textTheme;
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
final startPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
|
||||
@@ -19,38 +19,36 @@ class HomePage extends StatelessWidget {
|
||||
return const CircularProgressIndicator.adaptive();
|
||||
}
|
||||
|
||||
if (!rulesStore.isLoading) {
|
||||
if (rulesStore.rules.isNotEmpty) {
|
||||
final isDesktop = isDisplayLarge(context);
|
||||
final isTablet = isDisplayMedium(context);
|
||||
final startPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 16.0;
|
||||
if (rulesStore.rules.isNotEmpty) {
|
||||
final isDesktop = isDisplayLarge(context);
|
||||
final isTablet = isDisplayMedium(context);
|
||||
final startPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 16.0;
|
||||
|
||||
return ListView.separated(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: rulesStore.rules.length,
|
||||
cacheExtent: 5,
|
||||
itemBuilder: (context, index) {
|
||||
return LintExpansionTile(
|
||||
rule: rulesStore.rules[index],
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 4),
|
||||
);
|
||||
}
|
||||
return ListView.separated(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: rulesStore.rules.length,
|
||||
cacheExtent: 5,
|
||||
itemBuilder: (context, index) {
|
||||
return LintExpansionTile(
|
||||
rule: rulesStore.rules[index],
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 4),
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
|
||||
@@ -23,7 +23,7 @@ class RulesPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final isDesktop = isDisplayLarge(context);
|
||||
final isTablet = isDisplayMedium(context);
|
||||
var textTheme = Theme.of(context).textTheme;
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
final startPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
@@ -85,7 +85,7 @@ class RulesPage extends StatelessWidget {
|
||||
itemCount: profile.rules.length,
|
||||
cacheExtent: 5,
|
||||
itemBuilder: (context, index) {
|
||||
/// Show righ-click context menu to delete rule.
|
||||
/// Show right-click context menu to delete rule.
|
||||
return ContextMenuRegion(
|
||||
contextMenu: GenericContextMenu(
|
||||
buttonConfigs: [
|
||||
|
||||
Reference in New Issue
Block a user