Build ui almost complete, added assets
BIN
assets/afternoon_swipe.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
assets/bdh.jpg
Normal file
After Width: | Height: | Size: 554 KiB |
BIN
assets/brower.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
assets/cafe_west.jpg
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
assets/cook_cafe.jpg
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
assets/daytime_swipe.jpg
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
assets/doug_cafe.jpg
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
assets/harvest.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/kilmers.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/ldh.jpg
Normal file
After Width: | Height: | Size: 286 KiB |
BIN
assets/neilson.jpg
Normal file
After Width: | Height: | Size: 575 KiB |
BIN
assets/nighttime_swipe.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/red_pine.jpg
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
assets/sbarros.jpg
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
assets/woodys.jpg
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
flutter_01.png
Normal file
After Width: | Height: | Size: 236 KiB |
396
lib/buy.dart
@@ -1,8 +1,12 @@
|
|||||||
|
import 'dart:collection';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:material_dialogs/shared/types.dart';
|
import 'package:material_dialogs/shared/types.dart';
|
||||||
import 'package:material_dialogs/widgets/buttons/icon_button.dart';
|
import 'package:material_dialogs/widgets/buttons/icon_button.dart';
|
||||||
import 'package:material_dialogs/widgets/buttons/icon_outline_button.dart';
|
import 'package:material_dialogs/widgets/buttons/icon_outline_button.dart';
|
||||||
import 'package:material_dialogs/material_dialogs.dart';
|
import 'package:material_dialogs/material_dialogs.dart';
|
||||||
|
import 'package:ruswipeshare/main.dart';
|
||||||
|
|
||||||
enum CampusState { campuses, list_options, offers }
|
enum CampusState { campuses, list_options, offers }
|
||||||
|
|
||||||
@@ -18,9 +22,23 @@ final List<String> entries = <String>[
|
|||||||
'Pearl Morse',
|
'Pearl Morse',
|
||||||
'Jana Munguia'
|
'Jana Munguia'
|
||||||
];
|
];
|
||||||
|
final Map<String, String> nameToAsset = {
|
||||||
|
'Brower Dining Hall': 'brower.jpg',
|
||||||
|
'Cafe West': 'cafe_west.jpg',
|
||||||
|
'Busch Dining Hall': 'bdh.jpg',
|
||||||
|
'Woody\'s Cafe': 'woodys.jpg',
|
||||||
|
'Livingston Dining Hall': 'ldh.jpg',
|
||||||
|
'Kilmer\'s Market': 'kilmers.png',
|
||||||
|
'Sbarro\'s': 'sbarros.jpg',
|
||||||
|
'Neilson Dining Hall': 'neilson.jpg',
|
||||||
|
'Cook Cafe': 'cook_cafe.jpg',
|
||||||
|
'Douglass Cafe': 'doug_cafe.jpg',
|
||||||
|
'Harvest INFH': 'harvest.jpg',
|
||||||
|
'Red Pine Pizza': 'red_pine.jpg'
|
||||||
|
};
|
||||||
final List<List<String>> eatingLocations = [
|
final List<List<String>> eatingLocations = [
|
||||||
<String>['Brower Dining Hall', 'Cafe West'],
|
<String>['Brower Dining Hall', 'Cafe West'],
|
||||||
<String>['Busch Dining Hall', 'Woody\'s'],
|
<String>['Busch Dining Hall', 'Woody\'s Cafe'],
|
||||||
<String>[
|
<String>[
|
||||||
'Livingston Dining Hall',
|
'Livingston Dining Hall',
|
||||||
'Kilmer\'s Market',
|
'Kilmer\'s Market',
|
||||||
@@ -35,6 +53,11 @@ final List<List<String>> eatingLocations = [
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
final List<int> colorCodes = <int>[600, 500, 100];
|
final List<int> colorCodes = <int>[600, 500, 100];
|
||||||
|
final List<String> timeBgAssets = <String>[
|
||||||
|
'assets/daytime_swipe.jpg',
|
||||||
|
'assets/afternoon_swipe.jpg',
|
||||||
|
'assets/nighttime_swipe.jpg'
|
||||||
|
];
|
||||||
|
|
||||||
class BuyScreen extends StatefulWidget {
|
class BuyScreen extends StatefulWidget {
|
||||||
const BuyScreen({Key? key}) : super(key: key);
|
const BuyScreen({Key? key}) : super(key: key);
|
||||||
@@ -58,22 +81,23 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
crossAxisSpacing: 15,
|
crossAxisSpacing: 15,
|
||||||
childAspectRatio: 0.8,
|
childAspectRatio: 0.8,
|
||||||
mainAxisSpacing: 20,
|
mainAxisSpacing: 20,
|
||||||
padding: EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_currentState = CampusState.list_options;
|
_currentState = CampusState.list_options;
|
||||||
_diningOptions = eatingLocations[3];
|
_diningOptions = eatingLocations[0];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(25)),
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(25)),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -84,9 +108,9 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Text(
|
child: const Text(
|
||||||
"College Avenue",
|
"College Avenue",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
@@ -95,70 +119,97 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ClipRRect(
|
InkWell(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(25)),
|
onTap: () {
|
||||||
child: Column(
|
setState(() {
|
||||||
children: [
|
_currentState = CampusState.list_options;
|
||||||
Expanded(
|
_diningOptions = eatingLocations[1];
|
||||||
child: Image.asset(
|
});
|
||||||
'assets/busch_bg.jpg',
|
},
|
||||||
fit: BoxFit.cover,
|
child: ClipRRect(
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(25)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/busch_bg.jpg',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
Container(
|
width: double.infinity,
|
||||||
width: double.infinity,
|
padding: const EdgeInsets.all(8),
|
||||||
padding: EdgeInsets.all(8),
|
color: Colors.red,
|
||||||
color: Colors.green,
|
child: const Text(
|
||||||
child: Text(
|
"Busch",
|
||||||
"Busch",
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ClipRRect(
|
InkWell(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(25)),
|
onTap: () {
|
||||||
child: Column(
|
setState(() {
|
||||||
children: [
|
_currentState = CampusState.list_options;
|
||||||
Expanded(
|
_diningOptions = eatingLocations[2];
|
||||||
child: Image.asset(
|
});
|
||||||
'assets/livi_bg.jpg',
|
},
|
||||||
fit: BoxFit.cover,
|
child: ClipRRect(
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(25)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/livi_bg.jpg',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
Container(
|
width: double.infinity,
|
||||||
width: double.infinity,
|
padding: const EdgeInsets.all(8),
|
||||||
padding: EdgeInsets.all(8),
|
color: Colors.red,
|
||||||
color: Colors.blue,
|
child: const Text(
|
||||||
child: Text(
|
"Livi",
|
||||||
"Livingston",
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ClipRRect(
|
InkWell(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(25)),
|
onTap: () {
|
||||||
child: Column(
|
setState(() {
|
||||||
children: [
|
_currentState = CampusState.list_options;
|
||||||
Expanded(
|
_diningOptions = eatingLocations[3];
|
||||||
child: Image.asset(
|
});
|
||||||
'assets/cd_bg.jpg',
|
},
|
||||||
fit: BoxFit.cover,
|
child: ClipRRect(
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(25)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/cd_bg.jpg',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
Container(
|
width: double.infinity,
|
||||||
width: double.infinity,
|
padding: const EdgeInsets.all(8),
|
||||||
padding: EdgeInsets.all(8),
|
color: Colors.red,
|
||||||
color: Colors.yellow[700],
|
child: const Text(
|
||||||
child: Text(
|
"Cook-Douglass",
|
||||||
"Cook-Douglass",
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -169,8 +220,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
);
|
);
|
||||||
case CampusState.list_options:
|
case CampusState.list_options:
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Column(
|
body: Column(children: [
|
||||||
children: [
|
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@@ -179,51 +229,63 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
_currentState = CampusState.campuses;
|
_currentState = CampusState.campuses;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text("Choose A Different Location")),
|
child: const Text("Choose A Different Location")),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
physics: BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
itemCount: _diningOptions.length,
|
itemCount: _diningOptions.length,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return InkWell(
|
return Container(
|
||||||
onTap: () {
|
margin: const EdgeInsets.all(4),
|
||||||
setState(() {
|
decoration: BoxDecoration(
|
||||||
_currentState = CampusState.offers;
|
border: Border.all(
|
||||||
_selectedLocation = _diningOptions.elementAt(index);
|
color: CustomMaterialColor(240, 240, 240).mdColor,
|
||||||
});
|
width: 2),
|
||||||
},
|
borderRadius:
|
||||||
child: Container(
|
const BorderRadius.all(Radius.circular(40))),
|
||||||
height: 80,
|
child: InkWell(
|
||||||
color: Colors.blue,
|
onTap: () {
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
setState(() {
|
||||||
child: Row(
|
_currentState = CampusState.offers;
|
||||||
children: [
|
_selectedLocation = _diningOptions.elementAt(index);
|
||||||
Container(
|
});
|
||||||
color: Colors.red,
|
},
|
||||||
margin: EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
child: ClipRRect(
|
||||||
child: Column(
|
borderRadius:
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
const BorderRadius.all(Radius.circular(40)),
|
||||||
children: [
|
child: Container(
|
||||||
Text(
|
height: 80,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
image: AssetImage("assets/" +
|
||||||
|
nameToAsset[
|
||||||
|
_diningOptions.elementAt(index)]!),
|
||||||
|
)),
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.only(right: 40),
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
margin: const EdgeInsets.only(
|
||||||
|
top: 4, left: 20, bottom: 4),
|
||||||
|
child: Text(
|
||||||
_diningOptions[index],
|
_diningOptions[index],
|
||||||
textAlign: TextAlign.start,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 24),
|
style: const TextStyle(fontSize: 24),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}),
|
||||||
},
|
)
|
||||||
),
|
]),
|
||||||
),
|
);
|
||||||
],
|
|
||||||
));
|
|
||||||
case CampusState.offers:
|
case CampusState.offers:
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Column(
|
body: Column(
|
||||||
@@ -247,15 +309,15 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
]),
|
]),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
physics: BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
itemCount: 30,
|
itemCount: 30,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Dialogs.materialDialog(
|
Dialogs.materialDialog(
|
||||||
color: Colors.white,
|
color: CustomMaterialColor(240, 240, 240).mdColor,
|
||||||
customView: TransactionDetails(),
|
customView: const TransactionDetails(),
|
||||||
customViewPosition:
|
customViewPosition:
|
||||||
CustomViewPosition.BEFORE_ACTION,
|
CustomViewPosition.BEFORE_ACTION,
|
||||||
msg:
|
msg:
|
||||||
@@ -267,7 +329,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
text: 'Cancel',
|
text: 'Cancel',
|
||||||
iconData: Icons.cancel_outlined,
|
iconData: Icons.cancel_outlined,
|
||||||
textStyle: TextStyle(color: Colors.grey),
|
textStyle: const TextStyle(color: Colors.grey),
|
||||||
iconColor: Colors.grey,
|
iconColor: Colors.grey,
|
||||||
),
|
),
|
||||||
IconsButton(
|
IconsButton(
|
||||||
@@ -275,75 +337,99 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
text: 'Purchase',
|
text: 'Purchase',
|
||||||
iconData: Icons.done,
|
iconData: Icons.done,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
textStyle: TextStyle(color: Colors.white),
|
|
||||||
iconColor: Colors.white,
|
iconColor: Colors.white,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: CustomMaterialColor(240, 240, 240)
|
||||||
|
.mdColor,
|
||||||
|
width: 2),
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(40))),
|
||||||
|
margin: const EdgeInsets.all(4),
|
||||||
height: 80,
|
height: 80,
|
||||||
// color: Colors.blue,
|
child: ClipRRect(
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
borderRadius:
|
||||||
child: Row(
|
const BorderRadius.all(Radius.circular(40)),
|
||||||
children: [
|
child: Container(
|
||||||
Expanded(
|
decoration: BoxDecoration(
|
||||||
flex: 7,
|
image: DecorationImage(
|
||||||
child: Container(
|
colorFilter: const ColorFilter.mode(
|
||||||
color: Colors.red,
|
Colors.black26, BlendMode.darken),
|
||||||
margin: EdgeInsets.only(
|
fit: BoxFit.cover,
|
||||||
top: 4, left: 4, bottom: 4),
|
image: AssetImage(timeBgAssets[index % 3]),
|
||||||
child: Column(
|
)),
|
||||||
crossAxisAlignment:
|
child: BackdropFilter(
|
||||||
CrossAxisAlignment.start,
|
filter: ImageFilter.blur(sigmaX: 2, sigmaY: 2),
|
||||||
children: [
|
child: Row(
|
||||||
Text(
|
children: [
|
||||||
entries[index % entries.length] +
|
Expanded(
|
||||||
" " +
|
flex: 7,
|
||||||
_selectedLocation,
|
child: Container(
|
||||||
textAlign: TextAlign.start,
|
padding: EdgeInsets.only(left: 20),
|
||||||
overflow: TextOverflow.ellipsis,
|
// color: Colors.red,
|
||||||
style: const TextStyle(fontSize: 24),
|
margin: const EdgeInsets.only(
|
||||||
),
|
top: 4, left: 4, bottom: 4),
|
||||||
Row(
|
|
||||||
children: const [
|
|
||||||
Icon(Icons.star, size: 16),
|
|
||||||
Icon(Icons.star, size: 16),
|
|
||||||
Icon(Icons.star, size: 16),
|
|
||||||
Icon(Icons.star_half, size: 16),
|
|
||||||
Icon(Icons.star_border, size: 16),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment:
|
crossAxisAlignment:
|
||||||
MainAxisAlignment.end,
|
CrossAxisAlignment.start,
|
||||||
children: const [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'88:88PM - 88:88PM',
|
entries[index % entries.length],
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 16),
|
style:
|
||||||
|
const TextStyle(fontSize: 20),
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: const [
|
||||||
|
Icon(Icons.star, size: 16),
|
||||||
|
Icon(Icons.star, size: 16),
|
||||||
|
Icon(Icons.star, size: 16),
|
||||||
|
Icon(Icons.star_half, size: 16),
|
||||||
|
Icon(Icons.star_border,
|
||||||
|
size: 16),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
|
children: const [
|
||||||
|
Text(
|
||||||
|
'88:88PM - 88:88PM',
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 16),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
),
|
||||||
),
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(right: 15),
|
||||||
|
child: Text(
|
||||||
|
'\$88',
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: TextStyle(fontSize: 44),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
flex: 3,
|
|
||||||
child: Container(
|
|
||||||
color: Colors.orange,
|
|
||||||
child: const Text(
|
|
||||||
'\$88',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(fontSize: 44),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -79,7 +79,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
stateManagement: true, // Default is true.
|
stateManagement: true, // Default is true.
|
||||||
hideNavigationBarWhenKeyboardShows:
|
hideNavigationBarWhenKeyboardShows:
|
||||||
true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
|
true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
|
||||||
decoration: NavBarDecoration(
|
decoration: const NavBarDecoration(
|
||||||
// border: Border(
|
// border: Border(
|
||||||
// top: BorderSide(width: 2.0, color: Colors.white),
|
// top: BorderSide(width: 2.0, color: Colors.white),
|
||||||
// ),
|
// ),
|
||||||
|
@@ -4,13 +4,12 @@
|
|||||||
|
|
||||||
// ignore_for_file: implementation_imports
|
// ignore_for_file: implementation_imports
|
||||||
|
|
||||||
import 'package:firebase_auth/firebase_auth.dart' show ActionCodeSettings, FirebaseAuth, FirebaseAuthException, User;
|
import 'package:firebase_auth/firebase_auth.dart'
|
||||||
|
show ActionCodeSettings, FirebaseAuth, FirebaseAuthException, User;
|
||||||
import 'package:flutter/cupertino.dart' hide Title;
|
import 'package:flutter/cupertino.dart' hide Title;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/material.dart' hide Title;
|
import 'package:flutter/material.dart' hide Title;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_credit_card/credit_card_brand.dart';
|
|
||||||
import 'package:flutter_credit_card/flutter_credit_card.dart';
|
|
||||||
import 'package:flutterfire_ui/auth.dart';
|
import 'package:flutterfire_ui/auth.dart';
|
||||||
import 'package:flutterfire_ui/src/auth/widgets/internal/loading_button.dart';
|
import 'package:flutterfire_ui/src/auth/widgets/internal/loading_button.dart';
|
||||||
|
|
||||||
@@ -80,7 +79,9 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (state == EmailVerificationState.dismissed || state == EmailVerificationState.unresolved || state == EmailVerificationState.verified) {
|
if (state == EmailVerificationState.dismissed ||
|
||||||
|
state == EmailVerificationState.unresolved ||
|
||||||
|
state == EmailVerificationState.verified) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +101,10 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Subtitle(
|
Subtitle(
|
||||||
text: state == EmailVerificationState.sent || state == EmailVerificationState.pending ? 'Verification email sent' : 'Email is not verified',
|
text: state == EmailVerificationState.sent ||
|
||||||
|
state == EmailVerificationState.pending
|
||||||
|
? 'Verification email sent'
|
||||||
|
: 'Email is not verified',
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
if (state == EmailVerificationState.pending) ...[
|
if (state == EmailVerificationState.pending) ...[
|
||||||
@@ -130,7 +134,8 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
if (state != EmailVerificationState.sent && state != EmailVerificationState.sending)
|
if (state != EmailVerificationState.sent &&
|
||||||
|
state != EmailVerificationState.sending)
|
||||||
UniversalButton(
|
UniversalButton(
|
||||||
variant: ButtonVariant.text,
|
variant: ButtonVariant.text,
|
||||||
color: Theme.of(context).colorScheme.error,
|
color: Theme.of(context).colorScheme.error,
|
||||||
@@ -202,11 +207,15 @@ class ProfileScreenCustom extends MultiProviderScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<ProviderConfiguration> getLinkedProviders(User user) {
|
List<ProviderConfiguration> getLinkedProviders(User user) {
|
||||||
return providerConfigs.where((config) => user.isProviderLinked(config.providerId)).toList();
|
return providerConfigs
|
||||||
|
.where((config) => user.isProviderLinked(config.providerId))
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ProviderConfiguration> getAvailableProviders(User user) {
|
List<ProviderConfiguration> getAvailableProviders(User user) {
|
||||||
return providerConfigs.where((config) => !user.isProviderLinked(config.providerId)).toList();
|
return providerConfigs
|
||||||
|
.where((config) => !user.isProviderLinked(config.providerId))
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -254,12 +263,15 @@ class ProfileScreenCustom extends MultiProviderScreen {
|
|||||||
...children,
|
...children,
|
||||||
const SizedBox(height: 300),
|
const SizedBox(height: 300),
|
||||||
TextButton(
|
TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
|
foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
|
||||||
),
|
),
|
||||||
onPressed: () {Navigator.push(context, MaterialPageRoute(builder: (context)=> CreditView())); },
|
onPressed: () {
|
||||||
child: Text('Setup Seller'),
|
Navigator.push(
|
||||||
),
|
context, MaterialPageRoute(builder: (context) => CreditView()));
|
||||||
|
},
|
||||||
|
child: Text('Setup Seller'),
|
||||||
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: SignOutButton(
|
child: SignOutButton(
|
||||||
|
@@ -38,7 +38,7 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: const [
|
||||||
Icon(Icons.store_mall_directory, color: Colors.red),
|
Icon(Icons.store_mall_directory, color: Colors.red),
|
||||||
Text('Place'),
|
Text('Place'),
|
||||||
],
|
],
|
||||||
@@ -60,7 +60,7 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: const [
|
||||||
Icon(Icons.access_time, color: Colors.red),
|
Icon(Icons.access_time, color: Colors.red),
|
||||||
Text('Time'),
|
Text('Time'),
|
||||||
],
|
],
|
||||||
@@ -94,10 +94,19 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
context: context,
|
context: context,
|
||||||
initialTime: TimeOfDay.fromDateTime(startTimeTime),
|
initialTime: TimeOfDay.fromDateTime(startTimeTime),
|
||||||
);
|
);
|
||||||
if (picked != null && picked != TimeOfDay.fromDateTime(startTimeTime)) {
|
if (picked != null &&
|
||||||
|
picked != TimeOfDay.fromDateTime(startTimeTime)) {
|
||||||
setState(() {
|
setState(() {
|
||||||
startTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true);
|
startTimeTime = DateTime.fromMicrosecondsSinceEpoch(
|
||||||
startTime = startTimeTime.hour.toString() + ":" + startTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((startTimeTime.hour > 12) ? "PM" : "AM"));
|
picked.hour * 60 * 60 * 1000000 +
|
||||||
|
picked.minute * 60 * 1000000,
|
||||||
|
isUtc: true);
|
||||||
|
startTime = startTimeTime.hour.toString() +
|
||||||
|
":" +
|
||||||
|
startTimeTime.minute.toString() +
|
||||||
|
((is24HoursFormat)
|
||||||
|
? ""
|
||||||
|
: ((startTimeTime.hour > 12) ? "PM" : "AM"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -109,10 +118,19 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
context: context,
|
context: context,
|
||||||
initialTime: TimeOfDay.fromDateTime(endTimeTime),
|
initialTime: TimeOfDay.fromDateTime(endTimeTime),
|
||||||
);
|
);
|
||||||
if (picked != null && picked != TimeOfDay.fromDateTime(endTimeTime)) {
|
if (picked != null &&
|
||||||
|
picked != TimeOfDay.fromDateTime(endTimeTime)) {
|
||||||
setState(() {
|
setState(() {
|
||||||
endTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true);
|
endTimeTime = DateTime.fromMicrosecondsSinceEpoch(
|
||||||
endTime = endTimeTime.hour.toString() + ":" + endTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((endTimeTime.hour > 12) ? "PM" : "AM"));
|
picked.hour * 60 * 60 * 1000000 +
|
||||||
|
picked.minute * 60 * 1000000,
|
||||||
|
isUtc: true);
|
||||||
|
endTime = endTimeTime.hour.toString() +
|
||||||
|
":" +
|
||||||
|
endTimeTime.minute.toString() +
|
||||||
|
((is24HoursFormat)
|
||||||
|
? ""
|
||||||
|
: ((endTimeTime.hour > 12) ? "PM" : "AM"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -122,7 +140,7 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: const [
|
||||||
Icon(Icons.attach_money, color: Colors.red),
|
Icon(Icons.attach_money, color: Colors.red),
|
||||||
Text('Cost'),
|
Text('Cost'),
|
||||||
],
|
],
|
||||||
@@ -154,7 +172,8 @@ class _SellScreenState extends State<SellScreen> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: MaterialStateColor.resolveWith((states) => Colors.blue),
|
backgroundColor:
|
||||||
|
MaterialStateColor.resolveWith((states) => Colors.blue),
|
||||||
),
|
),
|
||||||
child: const Text('Next'),
|
child: const Text('Next'),
|
||||||
),
|
),
|
||||||
|