1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Update for Flutter 3.10 beta (#1746)

## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] All existing and new tests are passing.

---------

Co-authored-by: David Iglesias <ditman@gmail.com>
Co-authored-by: Mark Thompson <2554588+MarkTechson@users.noreply.github.com>
Co-authored-by: John Ryan <ryjohn@google.com>
This commit is contained in:
Brett Morgan
2023-05-11 06:16:31 +10:00
committed by GitHub
parent 474756ce04
commit 36e7a6ab04
188 changed files with 1779 additions and 1968 deletions

View File

@@ -156,12 +156,10 @@ class AudioController {
case AppLifecycleState.paused:
case AppLifecycleState.detached:
_stopAllSound();
break;
case AppLifecycleState.resumed:
if (!_settings!.muted.value && _settings!.musicOn.value) {
_resumeMusic();
}
break;
case AppLifecycleState.inactive:
// No need to react to this state change.
break;
@@ -209,23 +207,19 @@ class AudioController {
_log.severe(e);
await _playFirstSongInPlaylist();
}
break;
case PlayerState.stopped:
_log.info("resumeMusic() called when music is stopped. "
"This probably means we haven't yet started the music. "
"For example, the game was started with sound off.");
await _playFirstSongInPlaylist();
break;
case PlayerState.playing:
_log.warning('resumeMusic() called when music is playing. '
'Nothing to do.');
break;
case PlayerState.completed:
_log.warning('resumeMusic() called when music is completed. '
"Music should never be 'completed' as it's either not playing "
"or looping forever.");
await _playFirstSongInPlaylist();
break;
}
}

View File

@@ -139,7 +139,6 @@ class InAppPurchaseController extends ChangeNotifier {
case PurchaseStatus.pending:
_adRemoval = const AdRemovalPurchase.pending();
notifyListeners();
break;
case PurchaseStatus.purchased:
case PurchaseStatus.restored:
bool valid = await _verifyPurchase(purchaseDetails);
@@ -155,16 +154,13 @@ class InAppPurchaseController extends ChangeNotifier {
StateError('Purchase could not be verified'));
notifyListeners();
}
break;
case PurchaseStatus.error:
_log.severe('Error with purchase: ${purchaseDetails.error}');
_adRemoval = AdRemovalPurchase.error(purchaseDetails.error!);
notifyListeners();
break;
case PurchaseStatus.canceled:
_adRemoval = const AdRemovalPurchase.notStarted();
notifyListeners();
break;
}
if (purchaseDetails.pendingCompletePurchase) {

View File

@@ -110,14 +110,12 @@ class _MyRevealState extends State<_MyReveal> {
setState(() {
_finished = true;
});
break;
case AnimationStatus.forward:
case AnimationStatus.dismissed:
case AnimationStatus.reverse:
setState(() {
_finished = false;
});
break;
}
}
}

View File

@@ -7,7 +7,7 @@ publish_to: 'none'
version: 0.0.1+1
environment:
sdk: '>=2.19.5 <4.0.0'
sdk: ^3.0.0-0
dependencies:
flutter: