mirror of
https://github.com/flutter/samples.git
synced 2026-05-21 14:37:57 +00:00
[linting_tool] Prepare for release (#880)
This commit is contained in:
committed by
GitHub
parent
0aad30fc5b
commit
410e43fbc1
@@ -28,19 +28,19 @@ class DefaultLintsPage extends StatelessWidget {
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
|
||||
return ListView.separated(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 0,
|
||||
bottom: isDesktop ? kToolbarHeight : 0,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
cacheExtent: 5,
|
||||
itemCount: defaultSets.length,
|
||||
|
||||
@@ -24,12 +24,12 @@ class DefaultRulesPage extends StatelessWidget {
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
@@ -57,8 +57,8 @@ class DefaultRulesPage extends StatelessWidget {
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 0,
|
||||
bottom: isDesktop ? kToolbarHeight : 0,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: profile.rules.length,
|
||||
cacheExtent: 5,
|
||||
|
||||
@@ -27,19 +27,19 @@ class HomePage extends StatelessWidget {
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
|
||||
return ListView.separated(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 0,
|
||||
bottom: isDesktop ? kToolbarHeight : 0,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: rulesStore.rules.length,
|
||||
cacheExtent: 5,
|
||||
|
||||
@@ -27,7 +27,7 @@ class RulesPage extends StatelessWidget {
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
@@ -59,6 +59,9 @@ class RulesPage extends StatelessWidget {
|
||||
backgroundColor: Colors.white,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
|
||||
/// ContextMenuOverlay is required to show
|
||||
/// right-click context menus using ContextMenuRegion.
|
||||
body: ContextMenuOverlay(
|
||||
child: Consumer<ProfilesStore>(
|
||||
builder: (context, profilesStore, child) {
|
||||
@@ -75,17 +78,18 @@ class RulesPage extends StatelessWidget {
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 0,
|
||||
bottom: isDesktop ? kToolbarHeight : 0,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: profile.rules.length,
|
||||
cacheExtent: 5,
|
||||
itemBuilder: (context, index) {
|
||||
/// Show righ-click context menu to delete rule.
|
||||
return ContextMenuRegion(
|
||||
contextMenu: GenericContextMenu(
|
||||
buttonConfigs: [
|
||||
ContextMenuButtonConfig(
|
||||
'Remove from profile',
|
||||
'Remove rule from profile',
|
||||
onPressed: () {
|
||||
context
|
||||
.read<ProfilesStore>()
|
||||
|
||||
@@ -30,19 +30,19 @@ class SavedLintsPage extends StatelessWidget {
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
final endPadding = isTablet
|
||||
? 60.0
|
||||
: isDesktop
|
||||
? 120.0
|
||||
: 4.0;
|
||||
: 16.0;
|
||||
|
||||
return ListView.separated(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: startPadding,
|
||||
end: endPadding,
|
||||
top: isDesktop ? 28 : 0,
|
||||
bottom: isDesktop ? kToolbarHeight : 0,
|
||||
top: isDesktop ? 28 : 16,
|
||||
bottom: isDesktop ? kToolbarHeight : 16,
|
||||
),
|
||||
itemCount: profilesStore.savedProfiles.length,
|
||||
cacheExtent: 5,
|
||||
@@ -74,8 +74,9 @@ class SavedLintsPage extends StatelessWidget {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeNotifierProvider(
|
||||
create: (context) =>
|
||||
EditingController(isEditing: true),
|
||||
create: (context) => EditingController(
|
||||
isEditing: true,
|
||||
),
|
||||
child: RulesPage(selectedProfileIndex: index),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user