Skip to content

Commit a4fba76

Browse files
committed
fixed: infinite list example
1 parent 6df963e commit a4fba76

File tree

9 files changed

+9
-40
lines changed

9 files changed

+9
-40
lines changed

infinite_list/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Infinite List
22

3-
An infinite list using flutter
3+
Example app showing implemention of an infinite list
4+
5+
<img src="demo_img.gif" height="600em" />
46

5-
## Screencast
6-
<img src="media/Six.gif" height = "480" width="270">
77

88
## Getting Started
99

File renamed without changes.

infinite_list/lib/main.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import 'package:flutter/material.dart';
21
import 'package:english_words/english_words.dart';
2+
import 'package:flutter/material.dart';
33

44
void main() => runApp(new MyApp());
55

@@ -9,9 +9,7 @@ class MyApp extends StatelessWidget {
99
return new MaterialApp(
1010
title: 'Infinite List',
1111
theme: new ThemeData(
12-
primaryColorDark: Colors.blue,
13-
primaryColorLight: Colors.lightBlue
14-
),
12+
primaryColor: Colors.blue, accentColor: Colors.lightBlue),
1513
home: new RandomWords(),
1614
);
1715
}
@@ -46,7 +44,7 @@ class RandomWordsState extends State<RandomWords> {
4644
new MaterialPageRoute(
4745
builder: (context) {
4846
final tiles = _saved.map(
49-
(pair) {
47+
(pair) {
5048
return new ListTile(
5149
title: new Text(
5250
pair.asPascalCase,
@@ -57,9 +55,9 @@ class RandomWordsState extends State<RandomWords> {
5755
);
5856
final divided = ListTile
5957
.divideTiles(
60-
context: context,
61-
tiles: tiles,
62-
)
58+
context: context,
59+
tiles: tiles,
60+
)
6361
.toList();
6462

6563
return new Scaffold(

infinite_list/media/Five.png

-50.8 KB
Binary file not shown.

infinite_list/media/Four.png

-93.4 KB
Binary file not shown.

infinite_list/media/One.png

-39.4 KB
Binary file not shown.

infinite_list/media/Three.png

-73.2 KB
Binary file not shown.

infinite_list/media/Two.png

-39 KB
Binary file not shown.

infinite_list/test/widget_test.dart

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +0,0 @@
1-
// This is a basic Flutter widget test.
2-
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3-
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4-
// find child widgets in the widget tree, read text, and verify that the values of widget properties
5-
// are correct.
6-
7-
import 'package:flutter/material.dart';
8-
import 'package:flutter_test/flutter_test.dart';
9-
10-
import 'package:infinite_list/main.dart';
11-
12-
void main() {
13-
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14-
// Build our app and trigger a frame.
15-
await tester.pumpWidget(new MyApp());
16-
17-
// Verify that our counter starts at 0.
18-
expect(find.text('0'), findsOneWidget);
19-
expect(find.text('1'), findsNothing);
20-
21-
// Tap the '+' icon and trigger a frame.
22-
await tester.tap(find.byIcon(Icons.add));
23-
await tester.pump();
24-
25-
// Verify that our counter has incremented.
26-
expect(find.text('0'), findsNothing);
27-
expect(find.text('1'), findsOneWidget);
28-
});
29-
}

0 commit comments

Comments
 (0)