Skip to content

Commit

Permalink
fix e2e tests, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
willyfromtheblock committed Jul 5, 2021
1 parent f62b915 commit aad2a66
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 129 deletions.
257 changes: 133 additions & 124 deletions lib/screens/wallet_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,20 @@ class _WalletListScreenState extends State<WalletListScreen> {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AppSettingsScreen()),
MaterialPageRoute(builder: (context) => AppSettingsScreen()),
);
},
),
actions: [
IconButton(
key: Key('newWalletIconButton'),
onPressed: () {
if (_initial == false) {
showDialog(
context: context,
builder: (BuildContext context){
builder: (BuildContext context) {
return NewWalletDialog();
}
);
});
}
},
icon: Icon(Icons.add_rounded),
Expand All @@ -103,133 +102,143 @@ class _WalletListScreenState extends State<WalletListScreen> {
),
body: _isLoading || _initial
? Center(
child: LoadingIndicator(),
)
child: LoadingIndicator(),
)
: Container(
width: double.infinity,
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
height: 80.0,
width: 80.0,
decoration: BoxDecoration(
color: Theme.of(context).shadowColor,
borderRadius: BorderRadius.all(const Radius.circular(50.0)),
border: Border.all(color: Theme.of(context).backgroundColor,width: 2),
),
child: GestureDetector(
onTap: () => Share.share(
'https://play.google.com/store/apps/details?id=com.coinerella.peercoin'),
child: Image.asset(
'assets/icon/ppc-logo.png',
height: MediaQuery.of(context).size.height / 12,
),
),
),

Padding(
padding: const EdgeInsets.only(top:16),
child: Text(
'Peercoin Wallet',
style: TextStyle(
letterSpacing: 1.4,
fontSize: 24,
color: Theme.of(context).backgroundColor),
),
),
SizedBox(height: 40,),
FutureBuilder(
future: _activeWallets.activeWalletsValues,
builder: (_, snapshot) {

if (snapshot.connectionState == ConnectionState.waiting) {
return Expanded(
child: Center(child: LoadingIndicator()),
);
}
var listData = snapshot.data! as List;
if (listData.isEmpty) {
return Expanded(
child: Center(
child: Text(AppLocalizations.instance
.translate('wallets_none'),
style: TextStyle(fontSize: 16,fontStyle: FontStyle.italic,color: Theme.of(context).backgroundColor),),
width: double.infinity,
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
height: 80.0,
width: 80.0,
decoration: BoxDecoration(
color: Theme.of(context).shadowColor,
borderRadius:
BorderRadius.all(const Radius.circular(50.0)),
border: Border.all(
color: Theme.of(context).backgroundColor, width: 2),
),
);
}
return Expanded(
child: ListView.builder(
itemCount: listData.length,
itemBuilder: (ctx, i) {
CoinWallet _wallet = listData[i];
return Card(
margin: const EdgeInsets.symmetric(vertical: 8,horizontal: 16),
color: Theme.of(context).backgroundColor,
child: Column(
children: [
InkWell(
onTap: () async {
setState(() {
_isLoading = true;
});
await Navigator.of(context)
.pushReplacementNamed(
Routes.WalletHome,
arguments: _wallet,
);
},
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.white,
child: Image.asset(
AvailableCoins()
.getSpecificCoin(_wallet.name)
.iconPath,
width: 20),
),
title: Text(
_wallet.title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
letterSpacing: 1.2,
),
),
subtitle: Row(
children: [
Text(
(_wallet.balance / 1000000).toString(),
style: TextStyle(fontSize: 14,),
),
SizedBox(
width: 5,
),
Text(
_wallet.letterCode,
style: TextStyle(fontSize: 14,),
),
],
),
trailing: Icon(
Icons.arrow_forward_ios_rounded,
color: Theme.of(context).accentColor,
),
)
child: GestureDetector(
onTap: () => Share.share(
'https://play.google.com/store/apps/details?id=com.coinerella.peercoin'),
child: Image.asset(
'assets/icon/ppc-logo.png',
height: MediaQuery.of(context).size.height / 12,
),
),
),
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(
'Peercoin Wallet',
style: TextStyle(
letterSpacing: 1.4,
fontSize: 24,
color: Theme.of(context).backgroundColor),
),
),
SizedBox(
height: 40,
),
FutureBuilder(
future: _activeWallets.activeWalletsValues,
builder: (_, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Expanded(
child: Center(child: LoadingIndicator()),
);
}
var listData = snapshot.data! as List;
if (listData.isEmpty) {
return Expanded(
child: Center(
child: Text(
AppLocalizations.instance
.translate('wallets_none'),
style: TextStyle(
fontSize: 16,
fontStyle: FontStyle.italic,
color: Theme.of(context).backgroundColor),
),

],
),
);
}
return Expanded(
child: ListView.builder(
itemCount: listData.length,
itemBuilder: (ctx, i) {
CoinWallet _wallet = listData[i];
return Card(
margin: const EdgeInsets.symmetric(
vertical: 8, horizontal: 16),
color: Theme.of(context).backgroundColor,
child: Column(
children: [
InkWell(
onTap: () async {
setState(() {
_isLoading = true;
});
await Navigator.of(context)
.pushReplacementNamed(
Routes.WalletHome,
arguments: _wallet,
);
},
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.white,
child: Image.asset(
AvailableCoins()
.getSpecificCoin(_wallet.name)
.iconPath,
width: 20),
),
title: Text(
_wallet.title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
letterSpacing: 1.2,
),
),
subtitle: Row(
children: [
Text(
(_wallet.balance / 1000000)
.toString(),
style: TextStyle(
fontSize: 14,
),
),
SizedBox(
width: 5,
),
Text(
_wallet.letterCode,
style: TextStyle(
fontSize: 14,
),
),
],
),
trailing: Icon(
Icons.arrow_forward_ios_rounded,
color: Theme.of(context).accentColor,
),
)),
],
),
);
},
),
);
},
),
);
},
],
),
),

],
),
),
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.4.2+42
version: 0.5.0+43

environment:
sdk: '>=2.12.0 <3.0.0'
Expand Down
4 changes: 2 additions & 2 deletions test_driver/key_imported.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ void main() {
for (var i = 1; i <= 12; i++) {
await driver.tap(find.text('0'));
}
await driver.tap(find.byValueKey('add_wallet'));
await driver.tap(find.byValueKey('newWalletIconButton'));
await driver.tap(find.text('Peercoin Testnet'));
await driver.tap(find.byValueKey('confirm_add_wallet'));
await driver.tap(find.text('Peercoin Testnet')); //tap into wallet
await driver.tap(
find.text('Peercoin Testnet'),
timeout: Duration(minutes: 1),
Expand Down
3 changes: 1 addition & 2 deletions test_driver/key_new.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ void main() {
for (var i = 1; i <= 12; i++) {
await driver.tap(find.text('0'));
}
await driver.tap(find.byValueKey('add_wallet'));
await driver.tap(find.byValueKey('newWalletIconButton'));
await driver.tap(find.text('Peercoin Testnet'));
await driver.tap(find.byValueKey('confirm_add_wallet'));
await driver.tap(find.text('Peercoin Testnet')); //tap into wallet
expect(await driver.getText(find.text('connected')), 'connected');
});
Expand Down

0 comments on commit aad2a66

Please sign in to comment.