1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 06:48:26 +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

@@ -43,11 +43,11 @@ class DataTransferPage extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(8),
child: Text(
'Number Generator Progress',
style: Theme.of(context).textTheme.headline6,
),
padding: const EdgeInsets.all(8),
),
LinearProgressIndicator(
value: controller.progressPercent,
@@ -59,28 +59,28 @@ class DataTransferPage extends StatelessWidget {
Column(
children: [
ElevatedButton(
child: const Text('Transfer Data to 2nd Isolate'),
style: ElevatedButton.styleFrom(
primary: (controller.runningTest == 1)
? Colors.blueAccent
: Colors.grey[300]),
onPressed: () => controller.generateRandomNumbers(false),
child: const Text('Transfer Data to 2nd Isolate'),
),
ElevatedButton(
child: const Text('Transfer Data with TransferableTypedData'),
style: ElevatedButton.styleFrom(
primary: (controller.runningTest == 2)
? Colors.blueAccent
: Colors.grey[300]),
onPressed: () => controller.generateRandomNumbers(true),
child: const Text('Transfer Data with TransferableTypedData'),
),
ElevatedButton(
child: const Text('Generate on 2nd Isolate'),
style: ElevatedButton.styleFrom(
primary: (controller.runningTest == 3)
? Colors.blueAccent
: Colors.grey[300]),
onPressed: controller.generateOnSecondaryIsolate,
child: const Text('Generate on 2nd Isolate'),
),
],
),
@@ -214,10 +214,10 @@ class RunningList extends StatelessWidget {
return Column(
children: [
Card(
color: Colors.lightGreenAccent,
child: ListTile(
title: Text(progress[index]),
),
color: Colors.lightGreenAccent,
),
const Divider(
color: Colors.blue,

View File

@@ -58,14 +58,14 @@ class InfiniteProcessPage extends StatelessWidget {
alignment: MainAxisAlignment.center,
children: [
ElevatedButton(
child: const Text('Start'),
style: ElevatedButton.styleFrom(elevation: 8.0),
onPressed: () => controller.start(),
child: const Text('Start'),
),
ElevatedButton(
child: const Text('Terminate'),
style: ElevatedButton.styleFrom(elevation: 8.0),
onPressed: () => controller.terminate(),
child: const Text('Terminate'),
),
],
),
@@ -205,13 +205,13 @@ class RunningList extends StatelessWidget {
return Column(
children: [
Card(
color: (controller.created && !controller.paused)
? Colors.lightGreenAccent
: Colors.deepOrangeAccent,
child: ListTile(
leading: Text('${sums.length - index}.'),
title: Text('${sums[index]}.'),
),
color: (controller.created && !controller.paused)
? Colors.lightGreenAccent
: Colors.deepOrangeAccent,
),
const Divider(
color: Colors.blue,

View File

@@ -33,7 +33,7 @@ class PerformancePage extends StatefulWidget {
const PerformancePage({Key? key}) : super(key: key);
@override
_PerformancePageState createState() => _PerformancePageState();
State<PerformancePage> createState() => _PerformancePageState();
}
class _PerformancePageState extends State<PerformancePage> {
@@ -55,12 +55,12 @@ class _PerformancePageState extends State<PerformancePage> {
future: computeFuture,
builder: (context, snapshot) {
return ElevatedButton(
child: const Text('Compute on Main'),
style: ElevatedButton.styleFrom(elevation: 8.0),
onPressed:
snapshot.connectionState == ConnectionState.done
? () => handleComputeOnMain(context)
: null,
child: const Text('Compute on Main'),
);
},
),
@@ -68,12 +68,12 @@ class _PerformancePageState extends State<PerformancePage> {
future: computeFuture,
builder: (context, snapshot) {
return ElevatedButton(
child: const Text('Compute on Secondary'),
style: ElevatedButton.styleFrom(elevation: 8.0),
onPressed:
snapshot.connectionState == ConnectionState.done
? () => handleComputeOnSecondary(context)
: null);
: null,
child: const Text('Compute on Secondary'));
},
),
],
@@ -130,10 +130,10 @@ class SmoothAnimationWidget extends StatefulWidget {
const SmoothAnimationWidget({Key? key}) : super(key: key);
@override
SmoothAnimationWidgetState createState() => SmoothAnimationWidgetState();
State<SmoothAnimationWidget> createState() => _SmoothAnimationWidgetState();
}
class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
class _SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
with TickerProviderStateMixin {
late final AnimationController _animationController;
late final Animation<BorderRadius?> _borderAnimation;
@@ -160,9 +160,6 @@ class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
animation: _borderAnimation,
builder: (context, child) {
return Container(
child: const FlutterLogo(
size: 200,
),
alignment: Alignment.bottomCenter,
width: 350,
height: 200,
@@ -176,6 +173,9 @@ class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
),
borderRadius: _borderAnimation.value,
),
child: const FlutterLogo(
size: 200,
),
);
},
),

View File

@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

View File

@@ -42,14 +42,14 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
@@ -61,7 +61,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
@@ -73,7 +73,7 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
matcher:
dependency: transitive
description:
@@ -87,7 +87,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:
@@ -108,7 +108,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
provider:
dependency: "direct main"
description:
@@ -127,7 +127,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:
@@ -162,21 +162,14 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
window_size:
dependency: "direct main"
description:
@@ -187,5 +180,5 @@ packages:
source: git
version: "0.1.0"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-206.0.dev <3.0.0"
flutter: ">=1.16.0"

View File

@@ -4,7 +4,7 @@ version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
@@ -18,7 +18,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_lints: ^2.0.1
flutter:
uses-material-design: true

View File

@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)