Sync all source code with the latest flutter SDK and dependencies
This commit is contained in:
parent
45a3c583d9
commit
25df88bb80
43 changed files with 695 additions and 631 deletions
|
@ -8,7 +8,7 @@ android:release:
|
|||
before_script:
|
||||
- flutter create .
|
||||
- flutter pub get
|
||||
- flutter pub run flutter_launcher_icons_maker:main
|
||||
- flutter pub run flutter_launcher_icons
|
||||
- flutter clean
|
||||
script:
|
||||
- flutter doctor --android-licenses
|
||||
|
|
34
.metadata
34
.metadata
|
@ -1,11 +1,11 @@
|
|||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled.
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
channel: stable
|
||||
revision: "367f9ea16bfae1ca451b9cc27c1366870b187ae2"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
|
@ -13,26 +13,26 @@ project_type: app
|
|||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: android
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: ios
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: linux
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: macos
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: web
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
- platform: windows
|
||||
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
|
||||
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
||||
|
||||
# User provided section
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/config.dart';
|
||||
import 'package:nekoya_app/api/config.dart';
|
||||
|
||||
Future<dynamic> getProducts() async {
|
||||
var req = await Dio().get('$host/getproducts');
|
||||
|
|
|
@ -15,8 +15,8 @@ class _AboutUsBodyState extends State<AboutUsBody> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller =
|
||||
VideoPlayerController.network('https://nekoya.moe.team/img/AboutUs.mp4')
|
||||
_controller = VideoPlayerController.networkUrl(
|
||||
Uri.parse('https://nekoya.moe.team/img/AboutUs.mp4'))
|
||||
..initialize().then((_) {
|
||||
setState(() {
|
||||
_controller.play();
|
||||
|
|
|
@ -51,7 +51,7 @@ class Bannerimage extends StatelessWidget {
|
|||
Navigator.pushReplacementNamed(context, '/products');
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.red,
|
||||
backgroundColor: Colors.red,
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
child: const Text('SHOP NOW'),
|
||||
|
|
|
@ -2,9 +2,9 @@ import 'dart:convert';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
import 'package:nekoya_app/data/cart.dart';
|
||||
|
||||
class CheckoutForm extends StatefulWidget {
|
||||
const CheckoutForm({Key? key}) : super(key: key);
|
||||
|
@ -102,8 +102,8 @@ class _CheckoutFormState extends State<CheckoutForm> {
|
|||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: const [
|
||||
const Row(
|
||||
children: [
|
||||
Text(
|
||||
"Contact Information",
|
||||
style: TextStyle(
|
||||
|
@ -131,8 +131,8 @@ class _CheckoutFormState extends State<CheckoutForm> {
|
|||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: const [
|
||||
const Row(
|
||||
children: [
|
||||
Text(
|
||||
"Address",
|
||||
style: TextStyle(
|
||||
|
@ -180,8 +180,8 @@ class _CheckoutFormState extends State<CheckoutForm> {
|
|||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: const [
|
||||
const Row(
|
||||
children: [
|
||||
Text(
|
||||
"Shipping Methods",
|
||||
style: TextStyle(
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_flutter/components/cart_box.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/data/cart.dart';
|
||||
import 'package:nekoya_app/components/cart_box.dart';
|
||||
|
||||
class CheckoutItems extends StatefulWidget {
|
||||
const CheckoutItems({Key? key}) : super(key: key);
|
||||
|
@ -13,7 +13,6 @@ class CheckoutItems extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _CheckoutItemsState extends State<CheckoutItems> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Future<dynamic> getTotal() async {
|
||||
|
@ -69,7 +68,8 @@ class _CheckoutItemsState extends State<CheckoutItems> {
|
|||
if (productData != null) {
|
||||
return CartBox(
|
||||
controller: false,
|
||||
imageUrl: "https://nekoya.moe.team/img/${productData[0]['IMAGE']}",
|
||||
imageUrl:
|
||||
"https://nekoya.moe.team/img/${productData[0]['IMAGE']}",
|
||||
title: productData[0]['TITLE'],
|
||||
quantity: data[index]["quantity"],
|
||||
plus: () {},
|
||||
|
@ -123,9 +123,9 @@ class _CheckoutItemsState extends State<CheckoutItems> {
|
|||
);
|
||||
}
|
||||
|
||||
return Row(
|
||||
return const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: const [
|
||||
children: [
|
||||
Text(
|
||||
"Total : -",
|
||||
style: TextStyle(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class ColorDot extends StatelessWidget {
|
||||
const ColorDot({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:lottie/lottie.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
|
||||
class ForgotPassBody extends StatefulWidget {
|
||||
const ForgotPassBody({Key? key}) : super(key: key);
|
||||
|
@ -45,8 +45,8 @@ class _ForgotPassBodyState extends State<ForgotPassBody> {
|
|||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 25, bottom: 20),
|
||||
child: Row(
|
||||
children: const [
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.mail_sharp,
|
||||
color: Colors.white,
|
||||
|
@ -75,7 +75,9 @@ class _ForgotPassBodyState extends State<ForgotPassBody> {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10,),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(const EdgeInsets.all(15.0)),
|
||||
|
@ -98,28 +100,33 @@ class _ForgotPassBodyState extends State<ForgotPassBody> {
|
|||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Forgot Password', style: TextStyle(color: Colors.white),),
|
||||
title: const Text(
|
||||
'Forgot Password',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: const Color(0xff212226),
|
||||
content: SingleChildScrollView(
|
||||
content: const SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text('Please check your email to reset your password', style: TextStyle(
|
||||
color: Colors.white
|
||||
)),
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Please check your email to reset your password',
|
||||
style: TextStyle(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Close', style: TextStyle(color: Colors.white),),
|
||||
child: const Text(
|
||||
'Close',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
} else if (res['statusCode'] == 205) {
|
||||
showEmailWarn(context);
|
||||
} else {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:lottie/lottie.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/menu.dart';
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_flutter/screens/otp.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/menu.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
import 'package:nekoya_app/screens/otp.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class LoginForm extends StatefulWidget {
|
||||
const LoginForm({Key? key}) : super(key: key);
|
||||
|
|
|
@ -2,12 +2,12 @@ import 'dart:math' as math;
|
|||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_flutter/screens/products.dart';
|
||||
import 'package:nekoya_flutter/screens/cart.dart';
|
||||
import 'package:nekoya_flutter/screens/sessions.dart';
|
||||
import 'package:nekoya_flutter/screens/transactions.dart';
|
||||
import 'package:nekoya_flutter/screens/home.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
import 'package:nekoya_app/screens/products.dart';
|
||||
import 'package:nekoya_app/screens/cart.dart';
|
||||
import 'package:nekoya_app/screens/sessions.dart';
|
||||
import 'package:nekoya_app/screens/transactions.dart';
|
||||
import 'package:nekoya_app/screens/home.dart';
|
||||
|
||||
class Menu extends StatefulWidget {
|
||||
const Menu({Key? key, required this.initialScreen}) : super(key: key);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/product_detail.dart';
|
||||
import 'package:nekoya_flutter/components/product_card.dart';
|
||||
import 'package:nekoya_flutter/components/section_title.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/product_detail.dart';
|
||||
import 'package:nekoya_app/components/product_card.dart';
|
||||
import 'package:nekoya_app/components/section_title.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class NewArrivalProducts extends StatelessWidget {
|
||||
const NewArrivalProducts({
|
||||
|
@ -40,14 +40,16 @@ class NewArrivalProducts extends StatelessWidget {
|
|||
padding: const EdgeInsets.only(right: defaultPadding),
|
||||
child: ProductCard(
|
||||
title: data[index]['TITLE'],
|
||||
imageUrl: "https://nekoya.moe.team/img/${data[index]['IMAGE']}",
|
||||
imageUrl:
|
||||
"https://nekoya.moe.team/img/${data[index]['IMAGE']}",
|
||||
bgColor: const Color(0xFFFEFBF9),
|
||||
press: () {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) => productDetail(context, data[index]['ID']),
|
||||
builder: (context) =>
|
||||
productDetail(context, data[index]['ID']),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -67,7 +69,8 @@ class NewArrivalProducts extends StatelessWidget {
|
|||
padding: const EdgeInsets.only(right: defaultPadding),
|
||||
child: ProductCard(
|
||||
title: 'Loading...',
|
||||
imageUrl: "https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp",
|
||||
imageUrl:
|
||||
"https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp",
|
||||
bgColor: const Color(0xFFFEFBF9),
|
||||
press: () {},
|
||||
),
|
||||
|
@ -76,8 +79,7 @@ class NewArrivalProducts extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
const OutlineInputBorder outlineInputBorder = OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
|
@ -62,7 +62,8 @@ class _NewsletterState extends State<Newsletter> {
|
|||
padding: const EdgeInsets.all(14),
|
||||
child: SvgPicture.asset(
|
||||
"assets/icons/email.svg",
|
||||
color: Colors.white,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
Colors.white, BlendMode.srcIn),
|
||||
width: 21.5,
|
||||
height: 21.5,
|
||||
),
|
||||
|
@ -76,7 +77,7 @@ class _NewsletterState extends State<Newsletter> {
|
|||
height: 48,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: const Color(0xff8B0000),
|
||||
backgroundColor: const Color(0xff8B0000),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12)),
|
||||
|
@ -87,34 +88,46 @@ class _NewsletterState extends State<Newsletter> {
|
|||
subscribe(emailQuery).then((status) {
|
||||
if (status == 200) {
|
||||
emailController.clear();
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
FocusScope.of(context)
|
||||
.requestFocus(FocusNode());
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Thank You', style: TextStyle(color: Colors.white),),
|
||||
backgroundColor: const Color(0xff212226),
|
||||
content: SingleChildScrollView(
|
||||
title: const Text(
|
||||
'Thank You',
|
||||
style: TextStyle(
|
||||
color: Colors.white),
|
||||
),
|
||||
backgroundColor:
|
||||
const Color(0xff212226),
|
||||
content:
|
||||
const SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text('You have successfully subscribed to the newsletter.', style: TextStyle(
|
||||
color: Colors.white
|
||||
)),
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'You have successfully subscribed to the newsletter.',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Colors.white)),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Close', style: TextStyle(color: Colors.white),),
|
||||
child: const Text(
|
||||
'Close',
|
||||
style: TextStyle(
|
||||
color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ import 'package:lottie/lottie.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/menu.dart';
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/menu.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
|
||||
class OtpBody extends StatefulWidget {
|
||||
const OtpBody({Key? key, required this.otpToken}) : super(key: key);
|
||||
|
@ -24,12 +24,18 @@ class _OtpBodyState extends State<OtpBody> {
|
|||
TextEditingController otpCode6 = TextEditingController();
|
||||
|
||||
Future submitForm(BuildContext context) async {
|
||||
if (otpCode1.text.isEmpty || otpCode2.text.isEmpty || otpCode3.text.isEmpty || otpCode4.text.isEmpty || otpCode5.text.isEmpty || otpCode6.text.isEmpty) {
|
||||
if (otpCode1.text.isEmpty ||
|
||||
otpCode2.text.isEmpty ||
|
||||
otpCode3.text.isEmpty ||
|
||||
otpCode4.text.isEmpty ||
|
||||
otpCode5.text.isEmpty ||
|
||||
otpCode6.text.isEmpty) {
|
||||
return 999;
|
||||
} else {
|
||||
Map<String, dynamic> data = {
|
||||
"token": widget.otpToken,
|
||||
"code": "${otpCode1.text}${otpCode2.text}${otpCode3.text}${otpCode4.text}${otpCode5.text}${otpCode6.text}"
|
||||
"code":
|
||||
"${otpCode1.text}${otpCode2.text}${otpCode3.text}${otpCode4.text}${otpCode5.text}${otpCode6.text}"
|
||||
};
|
||||
|
||||
var response = await otpPost(data);
|
||||
|
@ -255,7 +261,9 @@ class _OtpBodyState extends State<OtpBody> {
|
|||
],
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 30,),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(const EdgeInsets.all(15.0)),
|
||||
|
@ -272,9 +280,10 @@ class _OtpBodyState extends State<OtpBody> {
|
|||
if (res['statusCode'] == 200) {
|
||||
addSession(res['data']['id'], res['data']['session_token']);
|
||||
Navigator.pop(context);
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(
|
||||
builder: (context) => const Menu(initialScreen: 2)
|
||||
));
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const Menu(initialScreen: 2)));
|
||||
Navigator.pop(context);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/data/cart.dart';
|
||||
|
||||
class PaymentBody extends StatefulWidget {
|
||||
const PaymentBody({Key? key}) : super(key: key);
|
||||
|
@ -181,9 +181,9 @@ class _PaymentBodyState extends State<PaymentBody> {
|
|||
);
|
||||
}
|
||||
|
||||
return Row(
|
||||
return const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Text(
|
||||
"Count total price on process!",
|
||||
style: TextStyle(
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/product_card.dart';
|
||||
import 'package:nekoya_flutter/components/product_detail.dart';
|
||||
import 'package:nekoya_flutter/components/section_title.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/product_card.dart';
|
||||
import 'package:nekoya_app/components/product_detail.dart';
|
||||
import 'package:nekoya_app/components/section_title.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class PopularProducts extends StatelessWidget {
|
||||
const PopularProducts({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class ProductCard extends StatelessWidget {
|
||||
const ProductCard({
|
||||
|
@ -32,13 +32,12 @@ class ProductCard extends StatelessWidget {
|
|||
width: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xff212226),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(defaultBorderRadius)),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(defaultBorderRadius)),
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
placeholder: (context, url) =>
|
||||
const Center(
|
||||
placeholder: (context, url) => const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xff8B0000),
|
||||
),
|
||||
|
|
|
@ -2,9 +2,9 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/data/cart.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
Widget makeDismissible({required context, required Widget child}) =>
|
||||
GestureDetector(
|
||||
|
|
|
@ -58,9 +58,9 @@ class RegisterErrorState extends State<RegisterError> {
|
|||
const SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
Row(
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
"An error has occured Make sure to check if your email has been registered before.",
|
||||
|
|
|
@ -2,9 +2,9 @@ import 'package:lottie/lottie.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/register_error.dart';
|
||||
import 'package:nekoya_flutter/components/register_verify.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/register_error.dart';
|
||||
import 'package:nekoya_app/components/register_verify.dart';
|
||||
|
||||
class RegisterForm extends StatefulWidget {
|
||||
const RegisterForm({Key? key}) : super(key: key);
|
||||
|
@ -144,7 +144,7 @@ class RegisterFormState extends State<RegisterForm> {
|
|||
children: [
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
primary: Colors.transparent,
|
||||
foregroundColor: Colors.transparent,
|
||||
),
|
||||
child: const Text(
|
||||
"Already have an account?? \nClick here to Sign In !!",
|
||||
|
|
|
@ -58,9 +58,9 @@ class RegisterVerifyState extends State<RegisterVerify> {
|
|||
const SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
"Before proceeding, please check your email for a verification link to verify your email address.",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:nekoya_flutter/components/search_page.dart';
|
||||
import 'package:nekoya_app/components/search_page.dart';
|
||||
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
const OutlineInputBorder outlineInputBorder = OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
|
@ -37,7 +37,8 @@ class _SearchFormState extends State<SearchForm> {
|
|||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: SvgPicture.asset("assets/icons/Search.svg",
|
||||
color: Colors.white),
|
||||
colorFilter:
|
||||
const ColorFilter.mode(Colors.white, BlendMode.srcIn)),
|
||||
),
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
@ -47,7 +48,7 @@ class _SearchFormState extends State<SearchForm> {
|
|||
height: 48,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: const Color(0xff8B0000),
|
||||
backgroundColor: const Color(0xff8B0000),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/product_detail.dart';
|
||||
import 'package:nekoya_flutter/components/search_item.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/product_detail.dart';
|
||||
import 'package:nekoya_app/components/search_item.dart';
|
||||
|
||||
class SearchPage extends StatefulWidget {
|
||||
const SearchPage({Key? key, required this.query}) : super(key: key);
|
||||
|
@ -29,26 +29,35 @@ class _SearchPageState extends State<SearchPage> {
|
|||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
var data = snapshot.data;
|
||||
var filteredData = data.where((x) => x['TITLE'].toLowerCase().contains(widget.query.toLowerCase()) ? true : false).toList();
|
||||
var filteredData = data
|
||||
.where((x) => x['TITLE']
|
||||
.toLowerCase()
|
||||
.contains(widget.query.toLowerCase())
|
||||
? true
|
||||
: false)
|
||||
.toList();
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, int index) => const Divider(),
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
const Divider(),
|
||||
itemCount: filteredData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SearchItem(
|
||||
title: filteredData[index]['TITLE'],
|
||||
description: "Price : Rp ${NumberFormat('#,##0.00', 'ID').format(filteredData[index]['PRICE'])}",
|
||||
imageUrl: "https://nekoya.moe.team/img/${filteredData[index]['IMAGE']}",
|
||||
description:
|
||||
"Price : Rp ${NumberFormat('#,##0.00', 'ID').format(filteredData[index]['PRICE'])}",
|
||||
imageUrl:
|
||||
"https://nekoya.moe.team/img/${filteredData[index]['IMAGE']}",
|
||||
callback: () {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) => productDetail(context, filteredData[index]['ID']),
|
||||
builder: (context) =>
|
||||
productDetail(context, filteredData[index]['ID']),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return const Center(
|
||||
|
@ -56,8 +65,7 @@ class _SearchPageState extends State<SearchPage> {
|
|||
color: Color(0xff8B0000),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ class SectionTitle extends StatelessWidget {
|
|||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.subtitle1!.copyWith(
|
||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
|
|
|
@ -2,12 +2,12 @@ import 'dart:convert';
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/transaction_product_box.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/transaction_product_box.dart';
|
||||
|
||||
class TransactionBox extends StatefulWidget {
|
||||
const TransactionBox({
|
||||
Key? key,
|
||||
const TransactionBox(
|
||||
{Key? key,
|
||||
required this.orderId,
|
||||
required this.status,
|
||||
required this.firstName,
|
||||
|
@ -20,8 +20,8 @@ class TransactionBox extends StatefulWidget {
|
|||
required this.region,
|
||||
required this.postalCode,
|
||||
required this.logistic,
|
||||
required this.data
|
||||
}) : super(key: key);
|
||||
required this.data})
|
||||
: super(key: key);
|
||||
|
||||
final int orderId;
|
||||
final String status;
|
||||
|
@ -54,7 +54,7 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
totalPrice += product[0]['PRICE'] * x['quantity'];
|
||||
});
|
||||
|
||||
return Future.delayed(const Duration(seconds: 2), (){
|
||||
return Future.delayed(const Duration(seconds: 2), () {
|
||||
return totalPrice;
|
||||
});
|
||||
}
|
||||
|
@ -66,8 +66,14 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('#${widget.orderId}', style: const TextStyle(color: Colors.white),),
|
||||
Text(widget.status, style: const TextStyle(color: Colors.white),)
|
||||
Text(
|
||||
'#${widget.orderId}',
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
widget.status,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
)
|
||||
],
|
||||
),
|
||||
children: [
|
||||
|
@ -80,13 +86,29 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text('Sender Details', style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w600),),
|
||||
const SizedBox(height: 5,),
|
||||
Text("${widget.firstName} ${widget.lastName}", style: const TextStyle(color: Colors.white),),
|
||||
Text(widget.phoneNumber, style: const TextStyle(color: Colors.white),),
|
||||
Text("${widget.streetAddress1}, ${widget.district}, ${widget.subDistrict}, ${widget.province}, ${widget.region}, ${widget.postalCode}", style: const TextStyle(color: Colors.white),),
|
||||
]
|
||||
const Text(
|
||||
'Sender Details',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Text(
|
||||
"${widget.firstName} ${widget.lastName}",
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
widget.phoneNumber,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
"${widget.streetAddress1}, ${widget.district}, ${widget.subDistrict}, ${widget.province}, ${widget.region}, ${widget.postalCode}",
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
]),
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
|
@ -96,9 +118,20 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Text('Logistic', style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w600),),
|
||||
const SizedBox(height: 5,),
|
||||
Text(widget.logistic, style: const TextStyle(color: Colors.white),),
|
||||
const Text(
|
||||
'Logistic',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Text(
|
||||
widget.logistic,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -106,7 +139,6 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
],
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
margin: const EdgeInsets.all(15.0),
|
||||
child: Card(
|
||||
|
@ -128,31 +160,30 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
if (snapshot.hasData) {
|
||||
var productData = snapshot.data;
|
||||
return TransactionProductBox(
|
||||
imageUrl: 'https://nekoya.moe.team/img/${productData[0]['IMAGE']}',
|
||||
imageUrl:
|
||||
'https://nekoya.moe.team/img/${productData[0]['IMAGE']}',
|
||||
title: productData[0]['TITLE'],
|
||||
quantity: orderData[index]["quantity"],
|
||||
);
|
||||
}
|
||||
|
||||
return const TransactionProductBox(
|
||||
imageUrl: 'https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp',
|
||||
imageUrl:
|
||||
'https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp',
|
||||
title: 'Loading...',
|
||||
quantity: 0,
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
),
|
||||
|
||||
});
|
||||
}),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 15.0, right: 15.0),
|
||||
child: const Divider(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 15.0, right: 15.0, bottom: 20.0),
|
||||
margin: const EdgeInsets.only(
|
||||
top: 15.0, right: 15.0, bottom: 20.0),
|
||||
child: FutureBuilder<dynamic>(
|
||||
future: getTotal(),
|
||||
builder: (context, snapshot) {
|
||||
|
@ -166,28 +197,25 @@ class _TransactionBoxState extends State<TransactionBox> {
|
|||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600
|
||||
),
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Row(
|
||||
return const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: const [
|
||||
children: [
|
||||
Text(
|
||||
"Total : -",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600
|
||||
),
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import 'dart:convert';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
|
||||
String getEncodedSession(userId, sessionToken) {
|
||||
var sessionData = {
|
||||
"user_id": userId,
|
||||
"session_token": sessionToken
|
||||
};
|
||||
var sessionData = {"user_id": userId, "session_token": sessionToken};
|
||||
var sessionRaw = jsonEncode(sessionData).toString();
|
||||
var sessionEncoded = base64.encode(utf8.encode(sessionRaw));
|
||||
return sessionEncoded;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import 'package:nekoya_flutter/screens/forgotpassword.dart';
|
||||
import 'package:nekoya_app/screens/forgotpassword.dart';
|
||||
import 'package:page_transition/page_transition.dart';
|
||||
import 'package:animated_splash_screen/animated_splash_screen.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/screens/login.dart';
|
||||
import 'package:nekoya_flutter/screens/register.dart';
|
||||
import 'package:nekoya_flutter/screens/payment.dart';
|
||||
import 'package:nekoya_flutter/components/menu.dart';
|
||||
import 'package:nekoya_flutter/utils/navigation_auth.dart';
|
||||
import 'package:nekoya_app/screens/login.dart';
|
||||
import 'package:nekoya_app/screens/register.dart';
|
||||
import 'package:nekoya_app/screens/payment.dart';
|
||||
import 'package:nekoya_app/components/menu.dart';
|
||||
import 'package:nekoya_app/utils/navigation_auth.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:nekoya_flutter/components/about_us_body.dart';
|
||||
import 'package:nekoya_app/components/about_us_body.dart';
|
||||
|
||||
class AboutUs extends StatefulWidget {
|
||||
const AboutUs({Key? key}) : super(key: key);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/cart_box.dart';
|
||||
import 'package:nekoya_flutter/components/cart_button.dart';
|
||||
import 'package:nekoya_flutter/components/menu.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_flutter/screens/checkout.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/cart_box.dart';
|
||||
import 'package:nekoya_app/components/cart_button.dart';
|
||||
import 'package:nekoya_app/components/menu.dart';
|
||||
import 'package:nekoya_app/data/cart.dart';
|
||||
import 'package:nekoya_app/screens/checkout.dart';
|
||||
|
||||
class Cart extends StatefulWidget {
|
||||
const Cart({Key? key}) : super(key: key);
|
||||
|
@ -20,7 +20,6 @@ class _CartState extends State<Cart> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Future<dynamic> getTotal() async {
|
||||
dynamic totalPrice = 0;
|
||||
var orderData = await viewCart();
|
||||
|
@ -63,7 +62,8 @@ class _CartState extends State<Cart> {
|
|||
if (productData != null) {
|
||||
return CartBox(
|
||||
controller: true,
|
||||
imageUrl: "https://nekoya.moe.team/img/${productData[0]['IMAGE']}",
|
||||
imageUrl:
|
||||
"https://nekoya.moe.team/img/${productData[0]['IMAGE']}",
|
||||
title: productData[0]['TITLE'],
|
||||
quantity: data[index]["quantity"],
|
||||
plus: () {
|
||||
|
@ -74,34 +74,35 @@ class _CartState extends State<Cart> {
|
|||
});
|
||||
},
|
||||
minus: () {
|
||||
removeFromCart(data[index]["product_id"], false);
|
||||
removeFromCart(
|
||||
data[index]["product_id"], false);
|
||||
setState(() {
|
||||
_viewCart = viewCart();
|
||||
getTotal_ = getTotal();
|
||||
});
|
||||
},
|
||||
remove: () {
|
||||
removeFromCart(data[index]["product_id"], true);
|
||||
removeFromCart(
|
||||
data[index]["product_id"], true);
|
||||
setState(() {
|
||||
_viewCart = viewCart();
|
||||
getTotal_ = getTotal();
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return CartBox(
|
||||
controller: true,
|
||||
imageUrl: 'https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp',
|
||||
imageUrl:
|
||||
'https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp',
|
||||
title: 'Loading...',
|
||||
quantity: 0,
|
||||
plus: () {},
|
||||
minus: () {},
|
||||
remove: () {},
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
@ -110,9 +111,8 @@ class _CartState extends State<Cart> {
|
|||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/image_empty.webp')
|
||||
)
|
||||
),
|
||||
image: AssetImage(
|
||||
'assets/images/image_empty.webp'))),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -123,8 +123,7 @@ class _CartState extends State<Cart> {
|
|||
color: Color(0xff8B0000),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
}),
|
||||
),
|
||||
floatingActionButton: FutureBuilder<dynamic>(
|
||||
future: getTotal_,
|
||||
|
@ -138,8 +137,7 @@ class _CartState extends State<Cart> {
|
|||
text2: "Checkout",
|
||||
refer: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) => const Checkout())
|
||||
);
|
||||
builder: (context) => const Checkout()));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -150,15 +148,15 @@ class _CartState extends State<Cart> {
|
|||
text2: "Shop Now",
|
||||
refer: () {
|
||||
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
||||
builder: (context) => const Menu(initialScreen: 2))
|
||||
);
|
||||
builder: (context) => const Menu(initialScreen: 2)));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return const SizedBox(width: 1.0,);
|
||||
}
|
||||
),
|
||||
return const SizedBox(
|
||||
width: 1.0,
|
||||
);
|
||||
}),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/checkout_form.dart';
|
||||
import 'package:nekoya_flutter/components/checkout_items.dart';
|
||||
import 'package:nekoya_app/components/checkout_form.dart';
|
||||
import 'package:nekoya_app/components/checkout_items.dart';
|
||||
|
||||
class Checkout extends StatefulWidget {
|
||||
const Checkout({Key? key}) : super(key: key);
|
||||
|
@ -20,10 +20,10 @@ class _CheckoutState extends State<Checkout> {
|
|||
centerTitle: true,
|
||||
backgroundColor: const Color(0xff212226),
|
||||
),
|
||||
body: SafeArea(
|
||||
body: const SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: const [
|
||||
children: [
|
||||
CheckoutItems(),
|
||||
CheckoutForm(),
|
||||
],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/faq_body.dart';
|
||||
import 'package:nekoya_app/components/faq_body.dart';
|
||||
|
||||
class FAQ extends StatefulWidget {
|
||||
const FAQ({Key? key}) : super(key: key);
|
||||
|
@ -19,7 +19,6 @@ class _FAQState extends State<FAQ> {
|
|||
centerTitle: true,
|
||||
backgroundColor: const Color(0xff212226),
|
||||
),
|
||||
body: const FAQBody()
|
||||
);
|
||||
body: const FAQBody());
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/forgot_pass_body.dart';
|
||||
import 'package:nekoya_app/components/forgot_pass_body.dart';
|
||||
|
||||
class ForgotPassword extends StatefulWidget {
|
||||
const ForgotPassword({Key? key}) : super(key: key);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/bannerimage.dart';
|
||||
import 'package:nekoya_flutter/components/carousel.dart';
|
||||
import 'package:nekoya_flutter/components/new_arrival_products.dart';
|
||||
import 'package:nekoya_flutter/components/newsletter.dart';
|
||||
import 'package:nekoya_flutter/components/popular_products.dart';
|
||||
import 'package:nekoya_flutter/components/search_form.dart';
|
||||
import 'package:nekoya_flutter/screens/about_us.dart';
|
||||
import 'package:nekoya_flutter/screens/faq.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart';
|
||||
import 'package:nekoya_app/components/bannerimage.dart';
|
||||
import 'package:nekoya_app/components/carousel.dart';
|
||||
import 'package:nekoya_app/components/new_arrival_products.dart';
|
||||
import 'package:nekoya_app/components/newsletter.dart';
|
||||
import 'package:nekoya_app/components/popular_products.dart';
|
||||
import 'package:nekoya_app/components/search_form.dart';
|
||||
import 'package:nekoya_app/screens/about_us.dart';
|
||||
import 'package:nekoya_app/screens/faq.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart';
|
||||
|
||||
class Home extends StatelessWidget {
|
||||
const Home({Key? key}) : super(key: key);
|
||||
|
@ -51,7 +51,7 @@ class Home extends StatelessWidget {
|
|||
"Explore",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headline4!
|
||||
.headlineMedium!
|
||||
.copyWith(fontWeight: FontWeight.w500, color: Colors.white),
|
||||
),
|
||||
const Text(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/login_form.dart';
|
||||
import 'package:nekoya_app/components/login_form.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
const Login({Key? key}) : super(key: key);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/otp_body.dart';
|
||||
import 'package:nekoya_app/components/otp_body.dart';
|
||||
|
||||
class Otp extends StatefulWidget {
|
||||
const Otp({Key? key, required this.otpToken}) : super(key: key);
|
||||
|
@ -21,7 +21,9 @@ class _OtpState extends State<Otp> {
|
|||
centerTitle: true,
|
||||
backgroundColor: const Color(0xff212226),
|
||||
),
|
||||
body: OtpBody(otpToken: widget.otpToken,),
|
||||
body: OtpBody(
|
||||
otpToken: widget.otpToken,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/payment_body.dart';
|
||||
import 'package:nekoya_app/components/payment_body.dart';
|
||||
|
||||
class Payment extends StatefulWidget {
|
||||
const Payment({Key? key}) : super(key: key);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/product_box.dart';
|
||||
import 'package:nekoya_flutter/components/product_detail.dart';
|
||||
import 'package:nekoya_flutter/utils/utils.dart'
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/product_box.dart';
|
||||
import 'package:nekoya_app/components/product_detail.dart';
|
||||
import 'package:nekoya_app/utils/utils.dart'
|
||||
show kMobileBreakpoint, kTabletBreakpoint, kDesktopBreakPoint;
|
||||
|
||||
class Products extends StatefulWidget {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/components/register_form.dart';
|
||||
import 'package:nekoya_app/components/register_form.dart';
|
||||
|
||||
class Register extends StatefulWidget {
|
||||
const Register({Key? key}) : super(key: key);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/menu.dart';
|
||||
import 'package:nekoya_flutter/components/session_box.dart';
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/menu.dart';
|
||||
import 'package:nekoya_app/components/session_box.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
|
||||
class Sessions extends StatefulWidget {
|
||||
const Sessions({Key? key}) : super(key: key);
|
||||
|
@ -19,7 +19,7 @@ class _SessionsState extends State<Sessions> {
|
|||
var session = await getSession();
|
||||
var data = await getSessions(session);
|
||||
return data;
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -42,32 +42,37 @@ class _SessionsState extends State<Sessions> {
|
|||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Log out', style: TextStyle(color: Colors.white),),
|
||||
title: const Text(
|
||||
'Log out',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: const Color(0xff212226),
|
||||
content: SingleChildScrollView(
|
||||
content: const SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text('You have successfully logged out', style: TextStyle(
|
||||
color: Colors.white
|
||||
)),
|
||||
children: <Widget>[
|
||||
Text('You have successfully logged out',
|
||||
style: TextStyle(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Close', style: TextStyle(color: Colors.white),),
|
||||
child: const Text(
|
||||
'Close',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
html.window.history.pushState(null, '', '');
|
||||
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
||||
builder: (context) => const Menu(initialScreen: 2))
|
||||
);
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const Menu(initialScreen: 2)));
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
|
@ -81,12 +86,15 @@ class _SessionsState extends State<Sessions> {
|
|||
itemCount: listSessions['data']!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SessionBox(
|
||||
icon: const Icon(Icons.key, color: Colors.white, size: 50,),
|
||||
icon: const Icon(
|
||||
Icons.key,
|
||||
color: Colors.white,
|
||||
size: 50,
|
||||
),
|
||||
ip: listSessions['data'][index]['ip'].split(', ')[0],
|
||||
userAgent: listSessions['data'][index]['user_agent'],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return const Center(
|
||||
|
@ -94,8 +102,6 @@ class _SessionsState extends State<Sessions> {
|
|||
color: Color(0xff8B0000),
|
||||
),
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}));
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/components/transaction_box.dart';
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_app/api/api.dart';
|
||||
import 'package:nekoya_app/components/transaction_box.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
|
||||
class Transactions extends StatefulWidget {
|
||||
const Transactions({Key? key}) : super(key: key);
|
||||
|
@ -17,7 +17,7 @@ class _TransactionsState extends State<Transactions> {
|
|||
var session = await getSession();
|
||||
var data = await getTransactions(session);
|
||||
return data;
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -54,8 +54,7 @@ class _TransactionsState extends State<Transactions> {
|
|||
logistic: data[index]['logistic'],
|
||||
data: data[index]['data'],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return const Center(
|
||||
|
@ -63,8 +62,6 @@ class _TransactionsState extends State<Transactions> {
|
|||
color: Color(0xff8B0000),
|
||||
),
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}));
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:nekoya_flutter/data/auth.dart';
|
||||
import 'package:nekoya_flutter/screens/login.dart';
|
||||
import 'package:nekoya_app/data/auth.dart';
|
||||
import 'package:nekoya_app/screens/login.dart';
|
||||
|
||||
class NavigationAuth extends StatelessWidget {
|
||||
const NavigationAuth({Key? key, required this.route}) : super(key: key);
|
||||
|
@ -11,7 +11,6 @@ class NavigationAuth extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return FutureBuilder<dynamic>(
|
||||
future: checkSessionExist(),
|
||||
builder: (context, snapshot) {
|
||||
|
@ -30,7 +29,6 @@ class NavigationAuth extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
@echo off
|
||||
echo "=== WORKSPACE SCRIPT RUNNING ==="
|
||||
mkdir nekoya_flutter
|
||||
cd nekoya_flutter
|
||||
mkdir nekoya_app
|
||||
cd nekoya_app
|
||||
git clone https://gitlab.com/nekoya/app.git .
|
||||
flutter create .
|
||||
flutter pub get
|
||||
flutter pub run flutter_launcher_icons_maker:main
|
||||
flutter pub run flutter_launcher_icons
|
||||
echo "=== DONE :3 ==="
|
|
@ -1,8 +1,8 @@
|
|||
echo "=== WORKSPACE SCRIPT RUNNING ==="
|
||||
mkdir nekoya_flutter
|
||||
cd nekoya_flutter
|
||||
mkdir nekoya_app
|
||||
cd nekoya_app
|
||||
git clone https://gitlab.com/nekoya/app.git .
|
||||
flutter create .
|
||||
flutter pub get
|
||||
flutter pub run flutter_launcher_icons_maker:main
|
||||
flutter pub run flutter_launcher_icons
|
||||
echo "=== DONE :3 ==="
|
Loading…
Reference in a new issue