mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Added 3 tabbed pages with welcome messages (#92)
This commit is contained in:
committed by
Andrew Brogdon
parent
d35d88740d
commit
9241a062bc
@@ -14,22 +14,63 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() => runApp(MyApp());
|
||||
void main() {
|
||||
runApp(StartApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
class StartApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Isolates'),
|
||||
home: DefaultTabController(
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
bottom: TabBar(
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.flash_on), text: 'Performance'),
|
||||
Tab(icon: Icon(Icons.sync), text: 'Infinite Process'),
|
||||
Tab(icon: Icon(Icons.storage), text: 'Data Transfer'),
|
||||
],
|
||||
),
|
||||
title: Text('Isolate Example'),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
PerformancePage(),
|
||||
InfiniteProcessPage(),
|
||||
DataTransferPage(),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: Text('Here is my app'),
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PerformancePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Text('Welcome to the Performance Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InfiniteProcessPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Text('Welcome to the Infinite Process Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DataTransferPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Text('Welcome to the Data Transfer Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,4 +143,4 @@ packages:
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
sdks:
|
||||
dart: ">=2.2.0 <3.0.0"
|
||||
dart: ">=2.3.0-dev <3.0.0"
|
||||
|
||||
@@ -3,7 +3,7 @@ description: A Flutter sample to demonstrate isolates
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.3.0 <3.0.0"
|
||||
sdk: ">=2.3.0-dev <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
||||
@@ -12,26 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:isolate_example/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(MyApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
expect(find.text('1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.byIcon(Icons.add));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('0'), findsNothing);
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
testWidgets('This test will always pass', (WidgetTester tester) async {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ declare -a PROJECT_NAMES=(
|
||||
"veggieseasons" \
|
||||
"place_tracker" \
|
||||
"platform_view_swift" \
|
||||
"platform_design"
|
||||
"isolate_example" \
|
||||
"platform_design"
|
||||
)
|
||||
|
||||
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
||||
|
||||
Reference in New Issue
Block a user