This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
const NormalText = TextStyle(fontSize: 16.0, color: Colors.black); | |
const TitleText = | |
TextStyle(fontSize: 28.0, color: Colors.black, fontWeight: FontWeight.bold); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class Party { | |
private final String place; | |
private final String name; | |
private final String starter; | |
private final String maincourse; | |
private final String desert; | |
private final String danceType; | |
private Party(PartyBuilder builder) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MakePayment { | |
public static void main(String args[]) { | |
IPayment payment = PaymentFactoryMethod.createPayment(PaymentType.PAYTM); | |
payment.pay(); | |
payment = PaymentFactoryMethod.createPayment(PaymentType.GOOGLEPAY); | |
payment.pay(); | |
payment = PaymentFactoryMethod.createPayment(PaymentType.PAYPAL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PaymentFactoryMethod { | |
public static IPayment createPayment(PaymentType type) { | |
IPayment payment = null; | |
switch (type) { | |
case PAYTM: | |
payment = new PaytmPayment(); | |
break; | |
case GOOGLEPAY: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IPayment { | |
void pay(); | |
} | |
abstract class Payment implements IPayment { | |
public Payment() { | |
initialize(); | |
} | |
protected abstract void initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaytmPayment { | |
public PaytmPayment() { | |
initializePaytm(); | |
} | |
private void initializePaytm() { | |
// setup with paytm server | |
System.out.println("paytm server initialized"); | |
} | |
public void payUsingPaytm() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Payment { | |
public Payment() { | |
initializePaytm(); | |
initializeGooglePay(); | |
initializePaypal(); | |
} | |
private void initializePaytm() { | |
// setup with paytm server | |
System.out.println("paytm server initialized"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MakePayment { | |
public static void main(String args[]) { | |
//Pay using paytm | |
Payment payment = new Payment(); | |
payment.pay(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Payment { | |
public Payment() { | |
initializePaytm(); | |
} | |
private void initializePaytm() { | |
// setup with paytm server | |
System.out.println("paytm server initialized"); | |
} |
NewerOlder