Skip to content

Commit

Permalink
fix: updtd clpbrd plugin and chngd gradle dist url
Browse files Browse the repository at this point in the history
  • Loading branch information
indrajit-roy committed Jun 20, 2022
1 parent 002e594 commit ddf86ec
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 433 deletions.
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="com.example.scgateway_flutter_plugin_example"
android:label="scgateway_flutter_plugin_example"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.10'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
clipboard_manager: f4800834e62cc26b1cc4e0a92a35cd452dd8b827
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
Mixpanel-swift: ce120e0d51dcb0d0bf5a25e1ee232fe89ad1136b
SCGateway: a5626f51d9af10effa424507101f26c49ed8915c
scgateway_flutter_plugin: 9b3fa926507bb2f28735cc5844c12b4975f3a804

PODFILE CHECKSUM: 149ecff69199ac385f452fe049db751eae1736cf

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
115 changes: 54 additions & 61 deletions example/lib/screens/InvestmentDetails.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import 'package:clipboard_manager/clipboard_manager.dart';
import 'package:clipboard/clipboard.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:scgateway_flutter_plugin/scgateway_flutter_plugin.dart';
Expand All @@ -8,17 +7,19 @@ import 'package:scgateway_flutter_plugin_example/models/InvestmentsDataDTO.dart'
import '../gateway.dart';

class InvestmentDetails extends StatelessWidget {

InvestmentsDataDTO investmentsDataDTO;

InvestmentDetails({Key key, @required this.investmentsDataDTO}) : super(key: key);
InvestmentDetails({Key key, @required this.investmentsDataDTO})
: super(key: key);

void _triggerInvestmentAction(String type, BuildContext context) {
var orderConfig = {
"type": type,
"iscid": investmentsDataDTO.investmentItem.iscid
};

var orderConfig = {"type" : type, "iscid" : investmentsDataDTO.investmentItem.iscid};

Gateway.getTransactionId(ScgatewayIntent.TRANSACTION, orderConfig).then((value) => _showAlertDialog(value, context));

Gateway.getTransactionId(ScgatewayIntent.TRANSACTION, orderConfig)
.then((value) => _showAlertDialog(value, context));
}

// Future<void> _investMore(BuildContext context) async {
Expand All @@ -36,21 +37,21 @@ class InvestmentDetails extends StatelessWidget {
// }

Future<void> _sipSetup(BuildContext context) async {

var orderConfig = {"iscid" : this.investmentsDataDTO.investmentItem.iscid};
var orderConfig = {"iscid": this.investmentsDataDTO.investmentItem.iscid};

print("Initiating SIP SETUP");

Gateway.getTransactionId(ScgatewayIntent.SIP_SETUP, orderConfig).then((value) => _showAlertDialog(value, context));
Gateway.getTransactionId(ScgatewayIntent.SIP_SETUP, orderConfig)
.then((value) => _showAlertDialog(value, context));
}

Future<void> _cancelAmo(BuildContext context) async {

var orderConfig = {"iscid" : this.investmentsDataDTO.investmentItem.iscid};
var orderConfig = {"iscid": this.investmentsDataDTO.investmentItem.iscid};

print("Initiating CANCEL AMO");

Gateway.getTransactionId(ScgatewayIntent.CANCEL_AMO, orderConfig).then((value) => _showAlertDialog(value, context));
Gateway.getTransactionId(ScgatewayIntent.CANCEL_AMO, orderConfig)
.then((value) => _showAlertDialog(value, context));
}

// Future<void> _exitSmallcase(BuildContext context) async {
Expand All @@ -61,16 +62,14 @@ class InvestmentDetails extends StatelessWidget {
// }

void _markSmallcaseArchive(BuildContext context) {

// var body = {"iscid" : investmentsDataDTO.investmentItem.iscid};

Gateway.markArchive(investmentsDataDTO.investmentItem.iscid).then((value) => _showAlertDialog(value, context));

Gateway.markArchive(investmentsDataDTO.investmentItem.iscid)
.then((value) => _showAlertDialog(value, context));
}

Future<void> _showAlertDialog(String message, BuildContext context) async {

// ClipboardManager.copyToClipBoard(message);
// FlutterClipboard.copy(message);
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
Expand All @@ -79,9 +78,7 @@ class InvestmentDetails extends StatelessWidget {
title: Text('Gateway'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message)
],
children: <Widget>[Text(message)],
),
),
actions: <Widget>[
Expand All @@ -91,41 +88,43 @@ class InvestmentDetails extends StatelessWidget {
Navigator.of(context).pop();
},
),
TextButton(onPressed: () {
ClipboardManager.copyToClipBoard(message);
}, child: Text('Copy')
)
TextButton(
onPressed: () {
FlutterClipboard.copy(message);
},
child: Text('Copy'))
],
);
},
);
}

Widget investmentInfo() {
return
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
constraints: BoxConstraints.tightFor(width: 60.0),
child: Image.network("https://assets.smallcase.com/images/smallcases/200/${investmentsDataDTO.investmentItem.scid}.png", fit: BoxFit.fitWidth),
),
const SizedBox(width : 10),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(this.investmentsDataDTO.investmentItem.name),
Text(
this.investmentsDataDTO.investmentItem.shortDescription,
maxLines: 5,
overflow: TextOverflow.ellipsis,
softWrap: true,
)
],
)
),
],
);
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
constraints: BoxConstraints.tightFor(width: 60.0),
child: Image.network(
"https://assets.smallcase.com/images/smallcases/200/${investmentsDataDTO.investmentItem.scid}.png",
fit: BoxFit.fitWidth),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(this.investmentsDataDTO.investmentItem.name),
Text(
this.investmentsDataDTO.investmentItem.shortDescription,
maxLines: 5,
overflow: TextOverflow.ellipsis,
softWrap: true,
)
],
)),
],
);
}

Widget investmentActions(BuildContext context) {
Expand All @@ -139,7 +138,8 @@ class InvestmentDetails extends StatelessWidget {
),
RaisedButton(
color: Colors.green,
onPressed: () => _triggerInvestmentAction("investmore".toUpperCase(), context),
onPressed: () =>
_triggerInvestmentAction("investmore".toUpperCase(), context),
child: const Text('INVEST MORE', style: TextStyle(fontSize: 20)),
),
RaisedButton(
Expand All @@ -163,7 +163,7 @@ class InvestmentDetails extends StatelessWidget {
child: const Text('SIP Order', style: TextStyle(fontSize: 20)),
),
RaisedButton(
onPressed: () => _cancelAmo(context),
onPressed: () => _cancelAmo(context),
color: Colors.green,
child: const Text('Cancel AMO', style: TextStyle(fontSize: 20)),
),
Expand All @@ -183,31 +183,24 @@ class InvestmentDetails extends StatelessWidget {

@override
Widget build(BuildContext context) {

return Scaffold(
appBar: AppBar(title: Text(investmentsDataDTO.investmentItem.name)),
body: SafeArea(
child: ListView(
padding: EdgeInsets.only(top: 10, left: 15, right: 10),

children: <Widget>[
investmentInfo(),

SizedBox(height: 30),

Align(
alignment: Alignment.bottomCenter,
child: ListView(
shrinkWrap: true,
children: <Widget>[
investmentActions(context)
],
children: <Widget>[investmentActions(context)],
),
),
],
),
),
);
}

}
}
Loading

0 comments on commit ddf86ec

Please sign in to comment.