sort_constructors_first (#22575)

This commit is contained in:
Alexandre Ardhuin
2018-10-04 07:28:07 +02:00
committed by GitHub
parent a68b03e9ce
commit 2ea1d81cdc
74 changed files with 449 additions and 444 deletions

View File

@@ -47,19 +47,6 @@ class SectionCard extends StatelessWidget {
// The title is rendered with two overlapping text widgets that are vertically
// offset a little. It's supposed to look sort-of 3D.
class SectionTitle extends StatelessWidget {
static const TextStyle sectionTitleStyle = TextStyle(
fontFamily: 'Raleway',
inherit: false,
fontSize: 24.0,
fontWeight: FontWeight.w500,
color: Colors.white,
textBaseline: TextBaseline.alphabetic,
);
static final TextStyle sectionTitleShadowStyle = sectionTitleStyle.copyWith(
color: const Color(0x19000000),
);
const SectionTitle({
Key key,
@required this.section,
@@ -74,6 +61,19 @@ class SectionTitle extends StatelessWidget {
final double scale;
final double opacity;
static const TextStyle sectionTitleStyle = TextStyle(
fontFamily: 'Raleway',
inherit: false,
fontSize: 24.0,
fontWeight: FontWeight.w500,
color: Colors.white,
textBaseline: TextBaseline.alphabetic,
);
static final TextStyle sectionTitleShadowStyle = sectionTitleStyle.copyWith(
color: const Color(0x19000000),
);
@override
Widget build(BuildContext context) {
return IgnorePointer(

View File

@@ -83,9 +83,6 @@ class ColorItem extends StatelessWidget {
}
class PaletteTabView extends StatelessWidget {
static const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
static const List<int> accentKeys = <int>[100, 200, 400, 700];
PaletteTabView({
Key key,
@required this.colors,
@@ -94,6 +91,9 @@ class PaletteTabView extends StatelessWidget {
final Palette colors;
static const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
static const List<int> accentKeys = <int>[100, 200, 400, 700];
@override
Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;

View File

@@ -432,14 +432,14 @@ class _RecipePageState extends State<RecipePage> {
/// Displays the recipe's name and instructions.
class RecipeSheet extends StatelessWidget {
RecipeSheet({ Key key, this.recipe }) : super(key: key);
final TextStyle titleStyle = const PestoStyle(fontSize: 34.0);
final TextStyle descriptionStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
final TextStyle itemStyle = const PestoStyle(fontSize: 15.0, height: 24.0/15.0);
final TextStyle itemAmountStyle = PestoStyle(fontSize: 15.0, color: _kTheme.primaryColor, height: 24.0/15.0);
final TextStyle headingStyle = const PestoStyle(fontSize: 16.0, fontWeight: FontWeight.bold, height: 24.0/15.0);
RecipeSheet({ Key key, this.recipe }) : super(key: key);
final Recipe recipe;
@override

View File

@@ -14,13 +14,13 @@ const String beeUri =
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4';
class VideoCard extends StatelessWidget {
const VideoCard({Key key, this.controller, this.title, this.subtitle})
: super(key: key);
final VideoPlayerController controller;
final String title;
final String subtitle;
const VideoCard({Key key, this.controller, this.title, this.subtitle})
: super(key: key);
Widget _buildInlineVideo() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 30.0),
@@ -93,10 +93,10 @@ class VideoCard extends StatelessWidget {
}
class VideoPlayerLoading extends StatefulWidget {
final VideoPlayerController controller;
const VideoPlayerLoading(this.controller);
final VideoPlayerController controller;
@override
_VideoPlayerLoadingState createState() => _VideoPlayerLoadingState();
}
@@ -137,18 +137,15 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
}
class VideoPlayPause extends StatefulWidget {
final VideoPlayerController controller;
const VideoPlayPause(this.controller);
final VideoPlayerController controller;
@override
State createState() => _VideoPlayPauseState();
}
class _VideoPlayPauseState extends State<VideoPlayPause> {
FadeAnimation imageFadeAnimation;
VoidCallback listener;
_VideoPlayPauseState() {
listener = () {
if (mounted)
@@ -156,6 +153,9 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
};
}
FadeAnimation imageFadeAnimation;
VoidCallback listener;
VideoPlayerController get controller => widget.controller;
@override
@@ -202,14 +202,14 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
}
class FadeAnimation extends StatefulWidget {
final Widget child;
final Duration duration;
const FadeAnimation({
this.child,
this.duration = const Duration(milliseconds: 500),
});
final Widget child;
final Duration duration;
@override
_FadeAnimationState createState() => _FadeAnimationState();
}
@@ -265,16 +265,16 @@ class _FadeAnimationState extends State<FadeAnimation>
}
class ConnectivityOverlay extends StatefulWidget {
final Widget child;
final Completer<Null> connectedCompleter;
final GlobalKey<ScaffoldState> scaffoldKey;
const ConnectivityOverlay({
this.child,
this.connectedCompleter,
this.scaffoldKey,
});
final Widget child;
final Completer<Null> connectedCompleter;
final GlobalKey<ScaffoldState> scaffoldKey;
@override
_ConnectivityOverlayState createState() => _ConnectivityOverlayState();
}

View File

@@ -268,10 +268,6 @@ class _DemosPage extends StatelessWidget {
}
class GalleryHome extends StatefulWidget {
// In checked mode our MaterialApp will show the default "debug" banner.
// Otherwise show the "preview" banner.
static bool showPreviewBanner = true;
const GalleryHome({
Key key,
this.testMode = false,
@@ -281,6 +277,10 @@ class GalleryHome extends StatefulWidget {
final Widget optionsPage;
final bool testMode;
// In checked mode our MaterialApp will show the default "debug" banner.
// Otherwise show the "preview" banner.
static bool showPreviewBanner = true;
@override
_GalleryHomeState createState() => _GalleryHomeState();
}

View File

@@ -6,12 +6,12 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/gestures.dart';
class RenderSolidColorBox extends RenderDecoratedBox {
final Size desiredSize;
final Color backgroundColor;
RenderSolidColorBox(this.backgroundColor, { this.desiredSize = Size.infinite })
: super(decoration: BoxDecoration(color: backgroundColor));
final Size desiredSize;
final Color backgroundColor;
@override
double computeMinIntrinsicWidth(double height) {
return desiredSize.width == double.infinity ? 0.0 : desiredSize.width;

View File

@@ -16,12 +16,6 @@ import 'package:http/http.dart' as http;
final math.Random _rng = math.Random();
class Stock {
String symbol;
String name;
double lastSale;
String marketCap;
double percentChange;
Stock(this.symbol, this.name, this.lastSale, this.marketCap, this.percentChange);
Stock.fromFields(List<String> fields) {
@@ -36,6 +30,12 @@ class Stock {
marketCap = fields[4];
percentChange = (_rng.nextDouble() * 20) - 10;
}
String symbol;
String name;
double lastSale;
String marketCap;
double percentChange;
}
class StockData extends ChangeNotifier {