mirror of
https://github.com/flutter/samples.git
synced 2026-05-04 22:17:09 +00:00
Upgrading samples to flutter_lints, part 1 of n (#804)
This commit is contained in:
@@ -19,7 +19,7 @@ class ProfileTab extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: Text(
|
||||
@@ -31,7 +31,7 @@ class ProfileTab extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
PreferenceCard(
|
||||
const PreferenceCard(
|
||||
header: 'MY INTENSITY PREFERENCE',
|
||||
content: '🔥',
|
||||
preferenceChoices: [
|
||||
@@ -42,7 +42,7 @@ class ProfileTab extends StatelessWidget {
|
||||
'My neighbor hates me',
|
||||
],
|
||||
),
|
||||
PreferenceCard(
|
||||
const PreferenceCard(
|
||||
header: 'CURRENT MOOD',
|
||||
content: '🤘🏾🚀',
|
||||
preferenceChoices: [
|
||||
@@ -70,7 +70,7 @@ class ProfileTab extends StatelessWidget {
|
||||
Widget _buildAndroid(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(title),
|
||||
title: const Text(title),
|
||||
),
|
||||
body: _buildBody(context),
|
||||
);
|
||||
@@ -123,18 +123,18 @@ class PreferenceCard extends StatelessWidget {
|
||||
Widget build(context) {
|
||||
return PressableCard(
|
||||
color: Colors.green,
|
||||
flattenAnimation: AlwaysStoppedAnimation(0),
|
||||
flattenAnimation: const AlwaysStoppedAnimation(0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 120,
|
||||
width: 250,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 40),
|
||||
padding: const EdgeInsets.only(top: 40),
|
||||
child: Center(
|
||||
child: Text(
|
||||
content,
|
||||
style: TextStyle(fontSize: 48),
|
||||
style: const TextStyle(fontSize: 48),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -146,11 +146,11 @@ class PreferenceCard extends StatelessWidget {
|
||||
child: Container(
|
||||
color: Colors.black12,
|
||||
height: 40,
|
||||
padding: EdgeInsets.only(left: 12),
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
header,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -182,7 +182,7 @@ class LogOutButton extends StatelessWidget {
|
||||
|
||||
Widget _buildAndroid(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
child: Text('LOG OUT', style: TextStyle(color: Colors.red)),
|
||||
child: const Text('LOG OUT', style: TextStyle(color: Colors.red)),
|
||||
onPressed: () {
|
||||
// You should do something with the result of the dialog prompt in a
|
||||
// real app but this is just a demo.
|
||||
@@ -190,7 +190,7 @@ class LogOutButton extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text('Log out?'),
|
||||
title: const Text('Log out?'),
|
||||
content: _logoutMessage,
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -212,7 +212,7 @@ class LogOutButton extends StatelessWidget {
|
||||
Widget _buildIos(BuildContext context) {
|
||||
return CupertinoButton(
|
||||
color: CupertinoColors.destructiveRed,
|
||||
child: Text('Log out'),
|
||||
child: const Text('Log out'),
|
||||
onPressed: () {
|
||||
// You should do something with the result of the action sheet prompt
|
||||
// in a real app but this is just a demo.
|
||||
@@ -220,7 +220,7 @@ class LogOutButton extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoActionSheet(
|
||||
title: Text('Log out?'),
|
||||
title: const Text('Log out?'),
|
||||
message: _logoutMessage,
|
||||
actions: [
|
||||
CupertinoActionSheetAction(
|
||||
|
||||
Reference in New Issue
Block a user