|
|
- import 'package:flutter/material.dart';
- import 'package:shared_preferences/shared_preferences.dart';
-
- class ConversationList extends StatefulWidget {
- const ConversationList({Key? key}) : super(key: key);
-
- @override
- State<ConversationList> createState() => _ConversationListState();
- }
-
- class _ConversationListState extends State<ConversationList> {
- final _suggestions = <String>[];
- final _biggerFont = const TextStyle(fontSize: 18);
-
- Widget list() {
-
- if (_suggestions.isEmpty) {
- return const Center(
- child: Text('No Conversations'),
- );
- }
-
- return ListView.builder(
- itemCount: _suggestions.length,
- padding: const EdgeInsets.all(16.0),
- itemBuilder: /*1*/ (context, i) {
- //if (i >= _suggestions.length) {
- // TODO: Check for more conversations here. Remove the itemCount to use this section
- //_suggestions.addAll(generateWordPairs().take(10)); /*4*/
- //}
- return Column(
- children: [
- ListTile(
- title: Text(
- _suggestions[i],
- style: _biggerFont,
- ),
- ),
- const Divider(),
- ]
- );
- },
- );
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('Envelope'),
- ),
- body: list(),
- );
-
- }
- }
|