1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00
This commit is contained in:
Brett Morgan
2022-05-11 12:48:11 -07:00
committed by GitHub
parent fb00d0a102
commit ccd68f34e2
242 changed files with 1719 additions and 1430 deletions

View File

@@ -255,7 +255,7 @@ class DetailsScreen extends StatefulWidget {
}
@override
_DetailsScreenState createState() => _DetailsScreenState();
State<DetailsScreen> createState() => _DetailsScreenState();
}
class _DetailsScreenState extends State<DetailsScreen> with RestorationMixin {

View File

@@ -15,7 +15,7 @@ class SearchScreen extends StatefulWidget {
final String? restorationId;
@override
_SearchScreenState createState() => _SearchScreenState();
State<SearchScreen> createState() => _SearchScreenState();
}
class _SearchScreenState extends State<SearchScreen> with RestorationMixin {
@@ -76,11 +76,14 @@ class _SearchScreenState extends State<SearchScreen> with RestorationMixin {
// This invisible and otherwise unnecessary search box is used to
// pad the list entries downward, so none will be underneath the
// real search box when the list is at its top scroll position.
child: _createSearchBox(focus: false),
visible: false,
maintainSize: true,
maintainAnimation: true,
maintainState: true,
// This invisible and otherwise unnecessary search box is used to
// pad the list entries downward, so none will be underneath the
// real search box when the list is at its top scroll position.
child: _createSearchBox(focus: false),
);
} else {
return Padding(

View File

@@ -166,11 +166,16 @@ class CalorieSettingsScreen extends StatelessWidget {
}
}
class SettingsScreen extends StatelessWidget {
class SettingsScreen extends StatefulWidget {
const SettingsScreen({this.restorationId, Key? key}) : super(key: key);
final String? restorationId;
@override
State<SettingsScreen> createState() => _SettingsScreenState();
}
class _SettingsScreenState extends State<SettingsScreen> {
SettingsItem _buildCaloriesItem(BuildContext context, Preferences prefs) {
return SettingsItem(
label: 'Calorie Target',
@@ -237,6 +242,7 @@ class SettingsScreen extends StatelessWidget {
child: const Text('Yes'),
onPressed: () async {
await prefs.restoreDefaults();
if (!mounted) return;
Navigator.pop(context);
},
),
@@ -257,7 +263,7 @@ class SettingsScreen extends StatelessWidget {
final prefs = Provider.of<Preferences>(context);
return RestorationScope(
restorationId: restorationId,
restorationId: widget.restorationId,
child: CupertinoPageScaffold(
child: Container(
color:

View File

@@ -47,7 +47,8 @@ class ColorChangingIcon extends ImplicitlyAnimatedWidget {
final double? size;
@override
_ColorChangingIconState createState() => _ColorChangingIconState();
AnimatedWidgetBaseState<ColorChangingIcon> createState() =>
_ColorChangingIconState();
}
class _ColorChangingIconState
@@ -81,12 +82,10 @@ class CloseButton extends StatefulWidget {
final VoidCallback onPressed;
@override
CloseButtonState createState() {
return CloseButtonState();
}
State<CloseButton> createState() => _CloseButtonState();
}
class CloseButtonState extends State<CloseButton> {
class _CloseButtonState extends State<CloseButton> {
bool tapInProgress = false;
@override

View File

@@ -75,10 +75,10 @@ class SettingsItem extends StatefulWidget {
final SettingsItemCallback? onPress;
@override
State<StatefulWidget> createState() => SettingsItemState();
State<SettingsItem> createState() => _SettingsItemState();
}
class SettingsItemState extends State<SettingsItem> {
class _SettingsItemState extends State<SettingsItem> {
bool pressed = false;
@override

View File

@@ -13,7 +13,7 @@ class TriviaView extends StatefulWidget {
const TriviaView({this.id, this.restorationId, Key? key}) : super(key: key);
@override
_TriviaViewState createState() => _TriviaViewState();
State<TriviaView> createState() => _TriviaViewState();
}
/// Possible states of the game.

View File

@@ -66,7 +66,7 @@ class PressableCard extends StatefulWidget {
final Duration duration;
@override
_PressableCardState createState() => _PressableCardState();
State<PressableCard> createState() => _PressableCardState();
}
class _PressableCardState extends State<PressableCard> {

View File

@@ -56,14 +56,14 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
@@ -77,7 +77,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
ffi:
dependency: transitive
description:
@@ -110,7 +110,7 @@ packages:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -148,14 +148,14 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
version: "0.6.4"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
matcher:
dependency: transitive
description:
@@ -169,7 +169,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
@@ -190,7 +190,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_provider_linux:
dependency: transitive
description:
@@ -218,7 +218,7 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
version: "5.0.0"
platform:
dependency: transitive
description:
@@ -314,7 +314,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
@@ -349,7 +349,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
typed_data:
dependency: transitive
description:
@@ -363,14 +363,14 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
version: "2.5.2"
window_size:
dependency: "direct main"
description:
@@ -393,7 +393,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
version: "5.4.1"
yaml:
dependency: transitive
description:
@@ -402,5 +402,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.15.0 <3.0.0"
dart: ">=2.17.0-206.0.dev <3.0.0"
flutter: ">=2.8.0"

View File

@@ -5,7 +5,7 @@ publish_to: none
version: 1.2.0
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
@@ -24,7 +24,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_lints: ^2.0.1
flutter_launcher_icons: ^0.9.0
flutter: