mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
isolate_example: Update lints, rebuild runners (#825)
This commit is contained in:
@@ -20,16 +20,20 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DataTransferPageStarter extends StatelessWidget {
|
||||
const DataTransferPageStarter({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => DataTransferIsolateController(),
|
||||
child: DataTransferPage(),
|
||||
child: const DataTransferPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DataTransferPage extends StatelessWidget {
|
||||
const DataTransferPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
final controller = Provider.of<DataTransferIsolateController>(context);
|
||||
@@ -49,7 +53,7 @@ class DataTransferPage extends StatelessWidget {
|
||||
value: controller.progressPercent,
|
||||
backgroundColor: Colors.grey[200],
|
||||
),
|
||||
Expanded(
|
||||
const Expanded(
|
||||
child: RunningList(),
|
||||
),
|
||||
Column(
|
||||
@@ -193,6 +197,8 @@ class DataTransferIsolateController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
class RunningList extends StatelessWidget {
|
||||
const RunningList({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final progress =
|
||||
|
||||
@@ -19,16 +19,20 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class InfiniteProcessPageStarter extends StatelessWidget {
|
||||
const InfiniteProcessPageStarter({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => InfiniteProcessIsolateController(),
|
||||
child: InfiniteProcessPage(),
|
||||
child: const InfiniteProcessPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InfiniteProcessPage extends StatelessWidget {
|
||||
const InfiniteProcessPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
final controller = Provider.of<InfiniteProcessIsolateController>(context);
|
||||
@@ -44,7 +48,7 @@ class InfiniteProcessPage extends StatelessWidget {
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
const Expanded(
|
||||
child: RunningList(),
|
||||
),
|
||||
Column(
|
||||
@@ -183,6 +187,8 @@ class InfiniteProcessIsolateController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
class RunningList extends StatelessWidget {
|
||||
const RunningList({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
final controller = Provider.of<InfiniteProcessIsolateController>(context);
|
||||
|
||||
@@ -20,13 +20,15 @@ import 'performance_page.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
MaterialApp(
|
||||
const MaterialApp(
|
||||
home: HomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
@@ -52,7 +54,7 @@ class HomePage extends StatelessWidget {
|
||||
),
|
||||
title: const Text('Isolate Example'),
|
||||
),
|
||||
body: TabBarView(
|
||||
body: const TabBarView(
|
||||
children: [
|
||||
PerformancePage(),
|
||||
InfiniteProcessPageStarter(),
|
||||
|
||||
@@ -30,6 +30,8 @@ int fib(int n) {
|
||||
}
|
||||
|
||||
class PerformancePage extends StatefulWidget {
|
||||
const PerformancePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PerformancePageState createState() => _PerformancePageState();
|
||||
}
|
||||
@@ -43,7 +45,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SmoothAnimationWidget(),
|
||||
const SmoothAnimationWidget(),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
padding: const EdgeInsets.only(top: 150),
|
||||
@@ -125,6 +127,8 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
}
|
||||
|
||||
class SmoothAnimationWidget extends StatefulWidget {
|
||||
const SmoothAnimationWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
SmoothAnimationWidgetState createState() => SmoothAnimationWidgetState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user