From 8f2727d93450a13b9275aa1a223883d88f89705f Mon Sep 17 00:00:00 2001 From: NATHANIEL ENDICK Date: Sat, 25 Feb 2023 22:33:07 -0500 Subject: [PATCH] Buy menu basic list setup --- lib/buy.dart | 43 +++++++++++++++++++++++++++++++++++++++++++ lib/home.dart | 3 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 lib/buy.dart diff --git a/lib/buy.dart b/lib/buy.dart new file mode 100644 index 0000000..ddc2963 --- /dev/null +++ b/lib/buy.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; + +class BuyScreen extends StatefulWidget { + const BuyScreen({Key? key}) : super(key: key); + + @override + _BuyScreenState createState() => _BuyScreenState(); +} + +class _BuyScreenState extends State { + @override + Widget build(BuildContext context) { + TimeOfDay _time = TimeOfDay.now(); + return Scaffold( + appBar: AppBar( + title: const Text('Sell'), + automaticallyImplyLeading: false, + ), + body: OffersListView(), + ); + } +} + +final List entries = ['A', 'B', 'C']; +final List colorCodes = [600, 500, 100]; + +class OffersListView extends StatelessWidget { + const OffersListView({super.key}); + + @override + Widget build(BuildContext context) { + return ListView.builder( + padding: const EdgeInsets.all(8), + itemCount: 30, + itemBuilder: (BuildContext context, int index) { + return Container( + height: 80, + color: Colors.amber[colorCodes[index % 3]], + child: Center(child: Text('Entry ${entries[index % 3]}')), + ); + }); + } +} diff --git a/lib/home.dart b/lib/home.dart index 90c4dd4..6bfee45 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart'; +import 'package:ruswipeshare/buy.dart'; import 'package:ruswipeshare/sell.dart'; import 'profile_screen_custom.dart'; import 'main_screen.dart'; @@ -20,7 +21,7 @@ class _HomeScreenState extends State { } List _buildScreens() => [ - const MainScreen(), + const BuyScreen(), const SellScreen(), const ProfileScreenCustom(), const MainScreen(),