Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.8 KiB

  1. import 'package:flutter/material.dart';
  2. import 'package:shared_preferences/shared_preferences.dart';
  3. class ConversationList extends StatefulWidget {
  4. const ConversationList({Key? key}) : super(key: key);
  5. @override
  6. State<ConversationList> createState() => _ConversationListState();
  7. }
  8. class _ConversationListState extends State<ConversationList> {
  9. final _suggestions = <String>[];
  10. final _biggerFont = const TextStyle(fontSize: 18);
  11. Widget list() {
  12. if (_suggestions.isEmpty) {
  13. return const Center(
  14. child: Text('No Conversations'),
  15. );
  16. }
  17. return ListView.builder(
  18. itemCount: _suggestions.length,
  19. padding: const EdgeInsets.all(16.0),
  20. itemBuilder: /*1*/ (context, i) {
  21. //if (i >= _suggestions.length) {
  22. // TODO: Check for more conversations here. Remove the itemCount to use this section
  23. //_suggestions.addAll(generateWordPairs().take(10)); /*4*/
  24. //}
  25. return Column(
  26. children: [
  27. ListTile(
  28. title: Text(
  29. _suggestions[i],
  30. style: _biggerFont,
  31. ),
  32. ),
  33. const Divider(),
  34. ]
  35. );
  36. },
  37. );
  38. }
  39. @override
  40. Widget build(BuildContext context) {
  41. return Scaffold(
  42. appBar: AppBar(
  43. title: const Text('Envelope'),
  44. ),
  45. body: list(),
  46. );
  47. }
  48. }