Skip to content

Commit

Permalink
Move from package:flutter/analysis_options_user.yaml -> package:flutt…
Browse files Browse the repository at this point in the history
…er_lints/flutter.yaml (#49)

`package:flutter/analysis_options_user.yaml` has been removed in favour
of flutter_lints.

This moves to flutter_lints and fixes up the new issues, including:

- remove unnecessary 'new'
- depend on packages used by the icon generator
- disable avoid_print since the tool uses this for reporting progress

(@devoncarew not sure if you're still the right person to review things
here?)
  • Loading branch information
DanTup committed Feb 15, 2024
1 parent f6b1786 commit 89e28b4
Show file tree
Hide file tree
Showing 6 changed files with 10,173 additions and 10,168 deletions.
6 changes: 5 additions & 1 deletion tool/icon_generator/analysis_options.yaml
@@ -1 +1,5 @@
include: package:flutter/analysis_options_user.yaml
include: package:flutter_lints/flutter.yaml

linter:
rules:
avoid_print: false
2,648 changes: 1,324 additions & 1,324 deletions tool/icon_generator/lib/cupertino.dart

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions tool/icon_generator/lib/main.dart
Expand Up @@ -68,18 +68,17 @@ Future main() async {
}

class MyIconApp extends StatelessWidget {
MyIconApp(this.materialIcons, this.cupertinoIcons)
: super(key: new UniqueKey());
MyIconApp(this.materialIcons, this.cupertinoIcons) : super(key: UniqueKey());

final List<material.IconTuple> materialIcons;
final List<cupertino.IconTuple> cupertinoIcons;

@override
Widget build(BuildContext context) {
// We use this color as it works well in both light and dark themes.
const Color color = const Color(0xFF777777);
const Color color = Color(0xFF777777);

Stack cupertinoSmallStack = new Stack(
Stack cupertinoSmallStack = Stack(
children: cupertinoIcons.map<Widget>((cupertino.IconTuple icon) {
return RepaintBoundary(
child: Icon(
Expand All @@ -92,7 +91,7 @@ class MyIconApp extends StatelessWidget {
}).toList(),
);

Stack cupertinoLargeStack = new Stack(
Stack cupertinoLargeStack = Stack(
children: cupertinoIcons.map<Widget>((cupertino.IconTuple icon) {
return RepaintBoundary(
child: Icon(
Expand All @@ -105,7 +104,7 @@ class MyIconApp extends StatelessWidget {
}).toList(),
);

Stack materialSmallStack = new Stack(
Stack materialSmallStack = Stack(
children: materialIcons.map<Widget>((material.IconTuple icon) {
return RepaintBoundary(
child: Icon(
Expand All @@ -118,7 +117,7 @@ class MyIconApp extends StatelessWidget {
}).toList(),
);

Stack materialLargeStack = new Stack(
Stack materialLargeStack = Stack(
children: materialIcons.map<Widget>((material.IconTuple icon) {
return RepaintBoundary(
child: Icon(
Expand All @@ -134,13 +133,13 @@ class MyIconApp extends StatelessWidget {
return MaterialApp(
title: 'Flutter Demo',
home: Center(
child: new Column(
child: Column(
children: <Widget>[
new Row(children: <Widget>[
Row(children: <Widget>[
cupertinoSmallStack,
materialSmallStack,
]),
new Row(children: <Widget>[
Row(children: <Widget>[
cupertinoLargeStack,
materialLargeStack,
]),
Expand All @@ -163,7 +162,7 @@ Future findAndSave(Key key, String path, {bool small = true}) async {
final ByteData bytes =
(await image.toByteData(format: ui.ImageByteFormat.png))!;

await new File(path).writeAsBytes(bytes.buffer.asUint8List());
await File(path).writeAsBytes(bytes.buffer.asUint8List());

print('wrote $path');
}
Expand Down

0 comments on commit 89e28b4

Please sign in to comment.