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

Flutter 3.29 beta (#2571)

This commit is contained in:
Eric Windmill
2025-02-12 18:08:01 -05:00
committed by GitHub
parent d62c784789
commit 719fd72c38
685 changed files with 76244 additions and 53721 deletions

View File

@@ -62,8 +62,12 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
Color randomLightColor() {
_random ??= Random(cellNumber);
return Color.fromARGB(255, _random!.nextInt(50) + 205,
_random!.nextInt(50) + 205, _random!.nextInt(50) + 205);
return Color.fromARGB(
255,
_random!.nextInt(50) + 205,
_random!.nextInt(50) + 205,
_random!.nextInt(50) + 205,
);
}
@override
@@ -108,9 +112,10 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
child: StreamBuilder<AccelerometerEvent>(
// Don't continuously rebuild for nothing when the
// cell isn't visible.
stream: appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream()
: Stream.value(defaultPosition),
stream:
appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream()
: Stream.value(defaultPosition),
initialData: defaultPosition,
builder: (context, snapshot) {
final data = snapshot.data;
@@ -123,7 +128,8 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
transform: Matrix4.rotationX(
data.y / gravity * pi / 2,
)..multiply(
Matrix4.rotationY(data.x / gravity * pi / 2)),
Matrix4.rotationY(data.x / gravity * pi / 2),
),
alignment: Alignment.center,
child: const FlutterLogo(size: 72),
);

View File

@@ -17,12 +17,7 @@ void main() {
final model = CounterModel();
runApp(
ChangeNotifierProvider.value(
value: model,
child: const MyApp(),
),
);
runApp(ChangeNotifierProvider.value(value: model, child: const MyApp()));
}
/// This is on alternate entrypoint for this module to display Flutter UI in
@@ -92,9 +87,7 @@ class FullScreenView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Full-screen Flutter with plugin'),
),
appBar: AppBar(title: const Text('Full-screen Flutter with plugin')),
body: const Contents(showExit: true),
);
}
@@ -128,10 +121,7 @@ class Contents extends StatelessWidget {
const Positioned.fill(
child: Opacity(
opacity: .25,
child: FittedBox(
fit: BoxFit.cover,
child: FlutterLogo(),
),
child: FittedBox(fit: BoxFit.cover, child: FlutterLogo()),
),
),
Center(

View File

@@ -4,7 +4,7 @@ description: An example Flutter module that uses a plugin.
version: 1.0.0+1
environment:
sdk: ^3.5.0
sdk: ^3.7.0-0
dependencies:
flutter: