lots of dart formats

pull/2701/head
Eric Windmill 1 month ago
parent 204606a39e
commit 04e6e73b26

@ -24,8 +24,7 @@ class Book {
pigeonMap['summary'] = summary;
pigeonMap['publishDate'] = publishDate;
pigeonMap['pageCount'] = pageCount;
pigeonMap['thumbnail'] =
thumbnail == null ? null : thumbnail!.encode();
pigeonMap['thumbnail'] = thumbnail == null ? null : thumbnail!.encode();
return pigeonMap;
}
@ -168,10 +167,9 @@ class HostBookApi {
}
Future<void> finishEditingBook(Book arg_book) async {
final BasicMessageChannel<Object?> channel =
BasicMessageChannel<Object?>(
'dev.flutter.pigeon.HostBookApi.finishEditingBook', codec,
binaryMessenger: _binaryMessenger);
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.HostBookApi.finishEditingBook', codec,
binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap =
await channel.send(<Object>[arg_book]) as Map<Object?, Object?>?;
if (replyMap == null) {

@ -15,8 +15,7 @@ class AnimatedContainerDemo extends StatefulWidget {
static String routeName = 'basics/animated_container';
@override
State<AnimatedContainerDemo> createState() =>
_AnimatedContainerDemoState();
State<AnimatedContainerDemo> createState() => _AnimatedContainerDemoState();
}
class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {

@ -27,8 +27,7 @@ class AnimatedSwitcherDemo extends StatefulWidget {
static String routeName = 'misc/animated_switcher';
@override
State<AnimatedSwitcherDemo> createState() =>
_AnimatedSwitcherDemoState();
State<AnimatedSwitcherDemo> createState() => _AnimatedSwitcherDemoState();
}
class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {

@ -174,8 +174,7 @@ class _SwipeableCardState extends State<SwipeableCard>
return;
}
var velocity = (details.velocity.pixelsPerSecond.dx / size.width)
.abs();
var velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs();
_animate(velocity: velocity);
}

@ -123,8 +123,7 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
if (newCurve != null) {
setState(() {
selectedReverseCurve = newCurve;
curvedAnimation.reverseCurve =
selectedReverseCurve.curve;
curvedAnimation.reverseCurve = selectedReverseCurve.curve;
});
}
},

@ -56,8 +56,7 @@ void main() {
// Check that the color has changed to the final color.
button = tester.widget(find.byType(ElevatedButton));
WidgetStateProperty<Color?>? finalColor =
button.style!.backgroundColor;
WidgetStateProperty<Color?>? finalColor = button.style!.backgroundColor;
expect(changedColor, isNot(finalColor));
});
});

@ -46,9 +46,7 @@ void main() {
await tester.pumpWidget(createAnimatedListDemoScreen());
// Get the initial length of list.
var initialLength = tester
.widgetList(find.byType(ListTile))
.length;
var initialLength = tester.widgetList(find.byType(ListTile)).length;
// Tap on the Delete Icon Button at middle index.
await tester.tap(find.byIcon(Icons.delete).at(initialLength ~/ 2));
@ -68,9 +66,7 @@ void main() {
await tester.pumpWidget(createAnimatedListDemoScreen());
// Get the initial length of list.
var initialLength = tester
.widgetList(find.byType(ListTile))
.length;
var initialLength = tester.widgetList(find.byType(ListTile)).length;
// Tap on the Delete Icon Button at start index.
await tester.tap(find.byIcon(Icons.delete).at(0));
@ -90,9 +86,7 @@ void main() {
await tester.pumpWidget(createAnimatedListDemoScreen());
// Get the initial length of list.
var initialLength = tester
.widgetList(find.byType(ListTile))
.length;
var initialLength = tester.widgetList(find.byType(ListTile)).length;
// Tap on the Delete Icon Button at end index.
await tester.tap(find.byIcon(Icons.delete).at(initialLength - 1));

@ -6,8 +6,7 @@ import 'package:animations/src/misc/expand_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Widget createExpandCardScreen() =>
const MaterialApp(home: ExpandCardDemo());
Widget createExpandCardScreen() => const MaterialApp(home: ExpandCardDemo());
void main() {
group('ExpandCard Tests', () {

@ -6,8 +6,7 @@ import 'package:animations/src/misc/focus_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Widget createFocusImageScreen() =>
const MaterialApp(home: FocusImageDemo());
Widget createFocusImageScreen() => const MaterialApp(home: FocusImageDemo());
void main() {
group('FocusImage Tests', () {

@ -65,10 +65,9 @@ class _MyHomePageState extends State<MyHomePage> {
// Write the value to [SharedPreferences] which will get read on the
// [SimpleDatabase]'s isolate. For this example the value is always true
// just for demonstration purposes.
final Future<void> sharedPreferencesSet =
SharedPreferences.getInstance().then(
(sharedPreferences) =>
sharedPreferences.setBool('isDebug', true),
final Future<void> sharedPreferencesSet = SharedPreferences.getInstance()
.then(
(sharedPreferences) => sharedPreferences.setBool('isDebug', true),
);
final Future<Directory> tempDirFuture = path_provider
.getTemporaryDirectory();

@ -181,8 +181,7 @@ class _SimpleDatabaseServer {
// obtained on the root isolate and passed into the background isolate via
// a [SendPort].
// ----------------------------------------------------------------------
RootIsolateToken rootIsolateToken =
command.arg1 as RootIsolateToken;
RootIsolateToken rootIsolateToken = command.arg1 as RootIsolateToken;
// ----------------------------------------------------------------------
// [BackgroundIsolateBinaryMessenger.ensureInitialized] for each
// background isolate that will use plugins. This sets up the

@ -112,9 +112,7 @@ class _MyContextMenuRegionState extends State<_MyContextMenuRegion> {
),
),
Text(
_lastSelection != null
? 'Last Selected: $_lastSelection'
: '',
_lastSelection != null ? 'Last Selected: $_lastSelection' : '',
),
],
),

@ -28,8 +28,7 @@ class ContextMenuRegion extends StatefulWidget {
class _ContextMenuRegionState extends State<ContextMenuRegion> {
Offset? _longPressOffset;
final ContextMenuController _contextMenuController =
ContextMenuController();
final ContextMenuController _contextMenuController = ContextMenuController();
static bool get _longPressEnabled {
switch (defaultTargetPlatform) {

@ -34,8 +34,7 @@ class FieldTypesPage extends StatelessWidget {
final TextEditingController
_cupertinoControllerForced = TextEditingController(
text:
'Or forced to always show a specific menu (Material desktop menu).',
text: 'Or forced to always show a specific menu (Material desktop menu).',
);
final TextEditingController _editableController = TextEditingController(
@ -88,13 +87,11 @@ class FieldTypesPage extends StatelessWidget {
controller: _cupertinoControllerForced,
contextMenuBuilder: (context, editableTextState) {
return DesktopTextSelectionToolbar(
anchor:
editableTextState.contextMenuAnchors.primaryAnchor,
children:
AdaptiveTextSelectionToolbar.getAdaptiveButtons(
context,
editableTextState.contextMenuButtonItems,
).toList(),
anchor: editableTextState.contextMenuAnchors.primaryAnchor,
children: AdaptiveTextSelectionToolbar.getAdaptiveButtons(
context,
editableTextState.contextMenuButtonItems,
).toList(),
);
},
),

@ -13,8 +13,7 @@ class PlatformSelector extends StatefulWidget {
}
class _PlatformSelectorState extends State<PlatformSelector> {
static const int targetPlatformStringLength =
15; // 'TargetPlatform.'.length
static const int targetPlatformStringLength = 15; // 'TargetPlatform.'.length
static String _platformToString(TargetPlatform platform) {
return platform.toString().substring(targetPlatformStringLength);

@ -55,15 +55,9 @@ class ReorderedButtonsPage extends StatelessWidget {
maxLines: 2,
contextMenuBuilder: (context, editableTextState) {
// Reorder the button datas by type.
final HashMap<
ContextMenuButtonType,
ContextMenuButtonItem
>
final HashMap<ContextMenuButtonType, ContextMenuButtonItem>
buttonItemsMap =
HashMap<
ContextMenuButtonType,
ContextMenuButtonItem
>();
HashMap<ContextMenuButtonType, ContextMenuButtonItem>();
for (ContextMenuButtonItem buttonItem
in editableTextState.contextMenuButtonItems) {
buttonItemsMap[buttonItem.type] = buttonItem;

@ -106,9 +106,7 @@ class _$Search extends Search {
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is Search &&
query == other.query &&
results == other.results;
return other is Search && query == other.query && results == other.results;
}
@override

@ -12,8 +12,7 @@ import '../serializers.dart';
part 'current_user_collections.g.dart';
abstract class CurrentUserCollections
implements
Built<CurrentUserCollections, CurrentUserCollectionsBuilder> {
implements Built<CurrentUserCollections, CurrentUserCollectionsBuilder> {
factory CurrentUserCollections([
void Function(CurrentUserCollectionsBuilder)? updates,
]) = _$CurrentUserCollections;

@ -192,8 +192,7 @@ class _$CurrentUserCollections extends CurrentUserCollections {
}
class CurrentUserCollectionsBuilder
implements
Builder<CurrentUserCollections, CurrentUserCollectionsBuilder> {
implements Builder<CurrentUserCollections, CurrentUserCollectionsBuilder> {
_$CurrentUserCollections? _$v;
int? _id;
@ -206,8 +205,7 @@ class CurrentUserCollectionsBuilder
String? _publishedAt;
String? get publishedAt => _$this._publishedAt;
set publishedAt(String? publishedAt) =>
_$this._publishedAt = publishedAt;
set publishedAt(String? publishedAt) => _$this._publishedAt = publishedAt;
String? _updatedAt;
String? get updatedAt => _$this._updatedAt;

@ -254,8 +254,7 @@ class ExifBuilder implements Builder<Exif, ExifBuilder> {
String? _focalLength;
String? get focalLength => _$this._focalLength;
set focalLength(String? focalLength) =>
_$this._focalLength = focalLength;
set focalLength(String? focalLength) => _$this._focalLength = focalLength;
int? _iso;
int? get iso => _$this._iso;

@ -169,8 +169,7 @@ class LocationBuilder implements Builder<Location, LocationBuilder> {
set country(String? country) => _$this._country = country;
PositionBuilder? _position;
PositionBuilder get position =>
_$this._position ??= new PositionBuilder();
PositionBuilder get position => _$this._position ??= new PositionBuilder();
set position(PositionBuilder? position) => _$this._position = position;
LocationBuilder();

@ -551,16 +551,14 @@ class PhotoBuilder implements Builder<Photo, PhotoBuilder> {
String? _description;
String? get description => _$this._description;
set description(String? description) =>
_$this._description = description;
set description(String? description) => _$this._description = description;
ExifBuilder? _exif;
ExifBuilder get exif => _$this._exif ??= new ExifBuilder();
set exif(ExifBuilder? exif) => _$this._exif = exif;
LocationBuilder? _location;
LocationBuilder get location =>
_$this._location ??= new LocationBuilder();
LocationBuilder get location => _$this._location ??= new LocationBuilder();
set location(LocationBuilder? location) => _$this._location = location;
ListBuilder<Tags>? _tags;

@ -86,8 +86,7 @@ class _$Position extends Position {
factory _$Position([void Function(PositionBuilder)? updates]) =>
(new PositionBuilder()..update(updates))._build();
_$Position._({required this.latitude, required this.longitude})
: super._() {
_$Position._({required this.latitude, required this.longitude}) : super._() {
BuiltValueNullFieldError.checkNotNull(
latitude,
r'Position',

@ -115,9 +115,7 @@ class _SplitState extends State<Split> {
secondSize = secondSize - halfDivider;
void updateSpacing(DragUpdateDetails dragDetails) {
final delta = isHorizontal
? dragDetails.delta.dx
: dragDetails.delta.dy;
final delta = isHorizontal ? dragDetails.delta.dx : dragDetails.delta.dy;
final fractionalDelta = delta / axisSize;
setState(() {
// Update the fraction of space consumed by the children,
@ -151,12 +149,8 @@ class _SplitState extends State<Split> {
),
),
child: SizedBox(
height: isHorizontal
? 2.0
: Split.dividerMainAxisSize - 2.0,
width: isHorizontal
? Split.dividerMainAxisSize - 2.0
: 2.0,
height: isHorizontal ? 2.0 : Split.dividerMainAxisSize - 2.0,
width: isHorizontal ? Split.dividerMainAxisSize - 2.0 : 2.0,
),
),
),

@ -15,8 +15,7 @@ class UnsplashSearchContent extends StatefulWidget {
const UnsplashSearchContent({super.key});
@override
State<UnsplashSearchContent> createState() =>
_UnsplashSearchContentState();
State<UnsplashSearchContent> createState() => _UnsplashSearchContentState();
}
class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
@ -40,9 +39,7 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
child: SingleChildScrollView(
controller: _treeViewScrollController,
child: TreeView(
items: photoSearchModel.entries
.map(_buildSearchEntry)
.toList(),
items: photoSearchModel.entries.map(_buildSearchEntry).toList(),
),
),
),

@ -44,8 +44,7 @@ Future<void> test() async =>
_logProcessOutput(Process.start('flutter', ['test']));
@Task()
Future<void> clean() =>
_logProcessOutput(Process.start('flutter', ['clean']));
Future<void> clean() => _logProcessOutput(Process.start('flutter', ['clean']));
Future<void> _logProcessOutput(Future<Process> proc) async {
final process = await proc;

@ -106,9 +106,7 @@ class _$Search extends Search {
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is Search &&
query == other.query &&
results == other.results;
return other is Search && query == other.query && results == other.results;
}
@override

@ -12,8 +12,7 @@ import '../serializers.dart';
part 'current_user_collections.g.dart';
abstract class CurrentUserCollections
implements
Built<CurrentUserCollections, CurrentUserCollectionsBuilder> {
implements Built<CurrentUserCollections, CurrentUserCollectionsBuilder> {
factory CurrentUserCollections([
void Function(CurrentUserCollectionsBuilder)? updates,
]) = _$CurrentUserCollections;

@ -192,8 +192,7 @@ class _$CurrentUserCollections extends CurrentUserCollections {
}
class CurrentUserCollectionsBuilder
implements
Builder<CurrentUserCollections, CurrentUserCollectionsBuilder> {
implements Builder<CurrentUserCollections, CurrentUserCollectionsBuilder> {
_$CurrentUserCollections? _$v;
int? _id;
@ -206,8 +205,7 @@ class CurrentUserCollectionsBuilder
String? _publishedAt;
String? get publishedAt => _$this._publishedAt;
set publishedAt(String? publishedAt) =>
_$this._publishedAt = publishedAt;
set publishedAt(String? publishedAt) => _$this._publishedAt = publishedAt;
String? _updatedAt;
String? get updatedAt => _$this._updatedAt;

@ -254,8 +254,7 @@ class ExifBuilder implements Builder<Exif, ExifBuilder> {
String? _focalLength;
String? get focalLength => _$this._focalLength;
set focalLength(String? focalLength) =>
_$this._focalLength = focalLength;
set focalLength(String? focalLength) => _$this._focalLength = focalLength;
int? _iso;
int? get iso => _$this._iso;

@ -169,8 +169,7 @@ class LocationBuilder implements Builder<Location, LocationBuilder> {
set country(String? country) => _$this._country = country;
PositionBuilder? _position;
PositionBuilder get position =>
_$this._position ??= new PositionBuilder();
PositionBuilder get position => _$this._position ??= new PositionBuilder();
set position(PositionBuilder? position) => _$this._position = position;
LocationBuilder();

@ -551,16 +551,14 @@ class PhotoBuilder implements Builder<Photo, PhotoBuilder> {
String? _description;
String? get description => _$this._description;
set description(String? description) =>
_$this._description = description;
set description(String? description) => _$this._description = description;
ExifBuilder? _exif;
ExifBuilder get exif => _$this._exif ??= new ExifBuilder();
set exif(ExifBuilder? exif) => _$this._exif = exif;
LocationBuilder? _location;
LocationBuilder get location =>
_$this._location ??= new LocationBuilder();
LocationBuilder get location => _$this._location ??= new LocationBuilder();
set location(LocationBuilder? location) => _$this._location = location;
ListBuilder<Tags>? _tags;

@ -86,8 +86,7 @@ class _$Position extends Position {
factory _$Position([void Function(PositionBuilder)? updates]) =>
(new PositionBuilder()..update(updates))._build();
_$Position._({required this.latitude, required this.longitude})
: super._() {
_$Position._({required this.latitude, required this.longitude}) : super._() {
BuiltValueNullFieldError.checkNotNull(
latitude,
r'Position',

@ -115,9 +115,7 @@ class _SplitState extends State<Split> {
secondSize = secondSize - halfDivider;
void updateSpacing(DragUpdateDetails dragDetails) {
final delta = isHorizontal
? dragDetails.delta.dx
: dragDetails.delta.dy;
final delta = isHorizontal ? dragDetails.delta.dx : dragDetails.delta.dy;
final fractionalDelta = delta / axisSize;
setState(() {
// Update the fraction of space consumed by the children,
@ -151,12 +149,8 @@ class _SplitState extends State<Split> {
),
),
child: SizedBox(
height: isHorizontal
? 2.0
: Split.dividerMainAxisSize - 2.0,
width: isHorizontal
? Split.dividerMainAxisSize - 2.0
: 2.0,
height: isHorizontal ? 2.0 : Split.dividerMainAxisSize - 2.0,
width: isHorizontal ? Split.dividerMainAxisSize - 2.0 : 2.0,
),
),
),

@ -16,8 +16,7 @@ class UnsplashSearchContent extends StatefulWidget {
const UnsplashSearchContent({super.key});
@override
State<UnsplashSearchContent> createState() =>
_UnsplashSearchContentState();
State<UnsplashSearchContent> createState() => _UnsplashSearchContentState();
}
class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
@ -41,9 +40,7 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
child: SingleChildScrollView(
controller: _treeViewScrollController,
child: TreeView(
nodes: photoSearchModel.entries
.map(_buildSearchEntry)
.toList(),
nodes: photoSearchModel.entries.map(_buildSearchEntry).toList(),
indent: 0,
),
),

@ -44,8 +44,7 @@ Future<void> test() async =>
_logProcessOutput(Process.start('flutter', ['test']));
@Task()
Future<void> clean() =>
_logProcessOutput(Process.start('flutter', ['clean']));
Future<void> clean() => _logProcessOutput(Process.start('flutter', ['clean']));
Future<void> _logProcessOutput(Future<Process> proc) async {
final process = await proc;

@ -131,8 +131,7 @@ class _FormWidgetsDemoState extends State<FormWidgetsDemo> {
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(

@ -13,8 +13,7 @@ FormData _$FormDataFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$FormDataToJson(FormData instance) =>
<String, dynamic>{
'email': instance.email,
'password': instance.password,
};
Map<String, dynamic> _$FormDataToJson(FormData instance) => <String, dynamic>{
'email': instance.email,
'password': instance.password,
};

@ -27,8 +27,7 @@ part 'locations.g.dart';
class LatLng {
LatLng({required this.lat, required this.lng});
factory LatLng.fromJson(Map<String, dynamic> json) =>
_$LatLngFromJson(json);
factory LatLng.fromJson(Map<String, dynamic> json) => _$LatLngFromJson(json);
Map<String, dynamic> toJson() => _$LatLngToJson(this);
final double lat;
@ -44,8 +43,7 @@ class Region {
required this.zoom,
});
factory Region.fromJson(Map<String, dynamic> json) =>
_$RegionFromJson(json);
factory Region.fromJson(Map<String, dynamic> json) => _$RegionFromJson(json);
Map<String, dynamic> toJson() => _$RegionToJson(this);
final LatLng coords;
@ -67,8 +65,7 @@ class Office {
required this.region,
});
factory Office.fromJson(Map<String, dynamic> json) =>
_$OfficeFromJson(json);
factory Office.fromJson(Map<String, dynamic> json) => _$OfficeFromJson(json);
Map<String, dynamic> toJson() => _$OfficeToJson(this);
final String address;
@ -94,8 +91,7 @@ class Locations {
}
Future<Locations> getGoogleOffices() async {
const googleLocationsURL =
'https://about.google/static/data/locations.json';
const googleLocationsURL = 'https://about.google/static/data/locations.json';
// Retrieve the locations of Google offices
try {

@ -72,10 +72,9 @@ class _PerformancePageState extends State<PerformancePage> {
return ElevatedButton(
style: ElevatedButton.styleFrom(elevation: 8.0),
onPressed: switch (snapshot.connectionState) {
ConnectionState.done =>
() => handleComputeOnSecondary(
context,
),
ConnectionState.done => () => handleComputeOnSecondary(
context,
),
_ => null,
},
child: const Text('Compute on Secondary'),
@ -136,8 +135,7 @@ class SmoothAnimationWidget extends StatefulWidget {
const SmoothAnimationWidget({super.key});
@override
State<SmoothAnimationWidget> createState() =>
_SmoothAnimationWidgetState();
State<SmoothAnimationWidget> createState() => _SmoothAnimationWidgetState();
}
class _SmoothAnimationWidgetState extends State<SmoothAnimationWidget>

@ -24,8 +24,7 @@ class _AppState extends State<App> {
ColorSeed _colorSelected = ColorSeed.baseColor;
ColorImageProvider _imageSelected = ColorImageProvider.leaves;
ColorScheme? _imageColorScheme = const ColorScheme.light();
ColorSelectionMethod _colorSelectionMethod =
ColorSelectionMethod.colorSeed;
ColorSelectionMethod _colorSelectionMethod = ColorSelectionMethod.colorSeed;
bool get _useLightMode => switch (_themeMode) {
ThemeMode.system =>

@ -93,8 +93,7 @@ class ColorSeedButton extends StatelessWidget {
padding: const EdgeInsets.only(left: 10),
child: Icon(
currentColor == colorSelected &&
colorSelectionMethod !=
ColorSelectionMethod.image
colorSelectionMethod != ColorSelectionMethod.image
? Icons.color_lens
: Icons.color_lens_outlined,
color: currentColor.color,

@ -593,8 +593,7 @@ class TextFields extends StatefulWidget {
class _TextFieldsState extends State<TextFields> {
final TextEditingController _controllerFilled = TextEditingController();
final TextEditingController _controllerOutlined =
TextEditingController();
final TextEditingController _controllerOutlined = TextEditingController();
@override
Widget build(BuildContext context) {
@ -1938,8 +1937,7 @@ class NavigationDrawerSection extends StatefulWidget {
_NavigationDrawerSectionState();
}
class _NavigationDrawerSectionState
extends State<NavigationDrawerSection> {
class _NavigationDrawerSectionState extends State<NavigationDrawerSection> {
int navDrawerIndex = 0;
@override
@ -2054,8 +2052,7 @@ class NavigationRailSection extends StatefulWidget {
const NavigationRailSection({super.key});
@override
State<NavigationRailSection> createState() =>
_NavigationRailSectionState();
State<NavigationRailSection> createState() => _NavigationRailSectionState();
}
class _NavigationRailSectionState extends State<NavigationRailSection> {

@ -222,8 +222,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
child: showLargeSizeLayout
? ExpandedTrailingActions(
useLightMode: widget.useLightMode,
handleBrightnessChange:
widget.handleBrightnessChange,
handleBrightnessChange: widget.handleBrightnessChange,
useMaterial3: widget.useMaterial3,
handleMaterialVersionChange:
widget.handleMaterialVersionChange,
@ -253,19 +252,18 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
}
}
final List<NavigationRailDestination> _navRailDestinations =
appBarDestinations
.map(
(destination) => NavigationRailDestination(
icon: Tooltip(
message: destination.label,
child: destination.icon,
),
selectedIcon: Tooltip(
message: destination.label,
child: destination.selectedIcon,
),
label: Text(destination.label),
),
)
.toList(growable: false);
final List<NavigationRailDestination> _navRailDestinations = appBarDestinations
.map(
(destination) => NavigationRailDestination(
icon: Tooltip(
message: destination.label,
child: destination.icon,
),
selectedIcon: Tooltip(
message: destination.label,
child: destination.selectedIcon,
),
label: Text(destination.label),
),
)
.toList(growable: false);

@ -29,8 +29,7 @@ class NavigationTransition extends StatefulWidget {
final Widget body;
@override
State<NavigationTransition> createState() =>
_NavigationTransitionState();
State<NavigationTransition> createState() => _NavigationTransitionState();
}
class _NavigationTransitionState extends State<NavigationTransition> {

@ -8,14 +8,15 @@ Future<void> main() async {
final pubspecContent = await pubspecFile.readAsString();
final pubspecYaml = loadYaml(pubspecContent);
// pub workspace, only run 'get' once
final workspace = pubspecYaml['workspace'] as YamlList?;
await _runCommand('flutter', ['pub', 'get']);
if (workspace == null) {
print('No workspace found in pubspec.yaml');
exit(1);
}
// pub workspace, only run 'get' once
await _runCommand('flutter', ['pub', 'get'], workingDirectory: './');
final packages = workspace.map((e) => e.toString()).toList();
for (final package in packages) {
@ -26,18 +27,17 @@ Future<void> main() async {
'--fatal-infos',
'--fatal-warnings',
], workingDirectory: packagePath);
await _runCommand('dart', [
'format',
'--output',
'none',
'.',
], workingDirectory: packagePath);
await _runCommand('dart', ['format', '.'], workingDirectory: packagePath);
if (await Directory(path.join(packagePath, 'test')).exists()) {
final packagePubspecFile = File(path.join(packagePath, 'pubspec.yaml'));
final packagePubspecContent = await packagePubspecFile.readAsString();
if (packagePubspecContent.contains('flutter:')) {
await _runCommand('flutter', ['test'], workingDirectory: packagePath);
await _runCommand('flutter', [
'test',
'--no-pub',
], workingDirectory: packagePath);
} else {
await _runCommand('dart', ['test'], workingDirectory: packagePath);
}

Loading…
Cancel
Save