From 48c368b0be61effcb1f755d001d763bd82cf6220 Mon Sep 17 00:00:00 2001 From: D Shrat Date: Tue, 26 Apr 2022 16:15:38 +0700 Subject: [PATCH] Payment page but not finish yet --- lib/components/menu.dart | 3 ++- lib/components/payment_body.dart | 43 ++++++++++++++++++++++++++++++++ lib/main.dart | 5 ++-- lib/screens/payment.dart | 23 +++++++++++++++++ 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 lib/components/payment_body.dart create mode 100644 lib/screens/payment.dart diff --git a/lib/components/menu.dart b/lib/components/menu.dart index 4d74b63..0cf37a4 100644 --- a/lib/components/menu.dart +++ b/lib/components/menu.dart @@ -5,6 +5,7 @@ import 'dart:math' as math; import 'package:nekoya_flutter/screens/products.dart'; import 'package:nekoya_flutter/screens/register.dart'; import 'package:nekoya_flutter/screens/checkout.dart'; +import 'package:nekoya_flutter/screens/payment.dart'; class Menu extends StatefulWidget { const Menu({Key? key}) : super(key: key); @@ -48,7 +49,7 @@ class _MenuState extends State { if (index == 0) { _selectedWidget = const Login(); } else if (index == 1) { - _selectedWidget = const Products(); + _selectedWidget = const Payment(); } else if (index == 2) { _selectedWidget = const Products(); } else if (index == 3) { diff --git a/lib/components/payment_body.dart b/lib/components/payment_body.dart new file mode 100644 index 0000000..b25c518 --- /dev/null +++ b/lib/components/payment_body.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; + +class PaymentBody extends StatefulWidget { + const PaymentBody({Key? key}) : super(key: key); + + @override + State createState() => _PaymentBodyState(); +} + +class _PaymentBodyState extends State { + @override + Widget build(BuildContext context) { + return Container( + constraints: BoxConstraints.expand(height: 150.0), + decoration: BoxDecoration(color: Colors.transparent), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Image.asset( + 'assets/bca.webp', + cacheHeight: 40, + cacheWidth: 100, + ), + Image.asset( + 'assets/bni.webp', + cacheHeight: 40, + cacheWidth: 100, + ), + Image.asset( + 'assets/bri.webp', + cacheHeight: 40, + cacheWidth: 100, + ), + ], + ), + Row(), + ], + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index ffbc45b..bf20507 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,8 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( - colorScheme: ColorScheme.fromSwatch(accentColor: const Color(0xff8B0000))), + colorScheme: + ColorScheme.fromSwatch(accentColor: const Color(0xff8B0000))), home: AnimatedSplashScreen( splash: 'assets/logo_transparent.webp', pageTransitionType: PageTransitionType.fade, @@ -31,4 +32,4 @@ class MyApp extends StatelessWidget { debugShowCheckedModeBanner: false, ); } -} +} \ No newline at end of file diff --git a/lib/screens/payment.dart b/lib/screens/payment.dart new file mode 100644 index 0000000..676b86b --- /dev/null +++ b/lib/screens/payment.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:nekoya_flutter/components/payment_body.dart'; + +class Payment extends StatefulWidget { + const Payment({Key? key}) : super(key: key); + + @override + State createState() => _PaymentState(); +} + +class _PaymentState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xff1b1c1e), + appBar: AppBar( + title: const Text('Payment'), + centerTitle: true, + backgroundColor: const Color(0xff212226), + ), + body: PaymentBody()); + } +}