starting docs

This commit is contained in:
Joshua
2024-07-07 12:44:03 -06:00
parent a010fab579
commit 2625a2ec6c
2 changed files with 12 additions and 8 deletions
+11 -7
View File
@@ -1,3 +1,4 @@
import 'package:app/pages/conversation_widget.dart';
import 'package:app/pages/settings_widget.dart'; import 'package:app/pages/settings_widget.dart';
import 'package:app/pages/conversations_list_widget.dart'; import 'package:app/pages/conversations_list_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -23,12 +24,16 @@ BottomNavigationBarItem _buildNavigationItem(int index) {
IconData iconData = Icons.error; IconData iconData = Icons.error;
switch (index) { switch (index) {
case 0: case 0:
label = 'Settings';
iconData = Icons.settings;
break;
case 1:
label = 'Home'; label = 'Home';
iconData = Icons.home; iconData = Icons.home;
break; break;
case 1: case 2:
label = 'Settings'; label = 'Chat';
iconData = Icons.settings; iconData = Icons.bubble_chart;
break; break;
} }
return BottomNavigationBarItem( return BottomNavigationBarItem(
@@ -48,14 +53,13 @@ void main() {
class MyApp extends ConsumerWidget { class MyApp extends ConsumerWidget {
MyApp({super.key}); MyApp({super.key});
final selectedIndexProvider = StateProvider<int>((_) => 0); // Initial state final selectedIndexProvider = StateProvider<int>((_) => 2); // Initial state
// This list holds the pages to navigate between // This list holds the pages to navigate between
final List<Widget> _pages = [ final List<Widget> _pages = [
// Replace with the widget for your first page (e.g., HomeScreen())
const Center(child: ConversationsListWidget()),
// Replace with the widget for your second page (e.g., SettingsPage())
const Center(child: SettingsWidget()), const Center(child: SettingsWidget()),
const Center(child: ConversationsListWidget()),
const Center(child: ConversationWidget()),
]; ];
// This widget is the root of your application. // This widget is the root of your application.
+1 -1
View File
@@ -13,7 +13,7 @@ import 'package:app/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame. // Build our app and trigger a frame.
await tester.pumpWidget(const MyApp()); await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0. // Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget); expect(find.text('0'), findsOneWidget);