Skip to content

Commit a59ec7b

Browse files
Merge pull request #11 from StabilityNexus/aaryan-githubWorkflow
Add: github workflow for maintaining structure and build checks
2 parents 6c1b0e9 + ab84dd5 commit a59ec7b

24 files changed

Lines changed: 270 additions & 245 deletions

.env.stencil

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ WALLETCONNECT_PROJECT_ID=<WALLETCONNECT_PROJECT_ID>
22
API_KEY=<PINATA_API_KEY>
33
API_SECRET=<PINATA_API_SECRET>
44
ALCHEMY_API_KEY=<ALCHEMY_API_KEY>
5-
CONTRACT_ADDRESS=<CONTRACT_ADDRESS>
5+
CONTRACT_ADDRESS=<CONTRACT_ADDRESS>
6+
APPLICATION_ID=<APPLICATION_ID>

.github/workflows/flutter.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Flutter CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Setup environment file from template
18+
run: cp .env.stencil .env
19+
20+
- name: Setup Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: 'stable'
24+
25+
- name: Install dependencies
26+
run: flutter pub get
27+
28+
- name: Dart analyze
29+
run: flutter analyze
30+
31+
- name: Check formatting
32+
run: dart format --output=none --set-exit-if-changed .
33+
34+
- name: Flutter build (apk)
35+
run: flutter build apk --release --no-tree-shake-icons | grep -v "deprecated"

lib/components/universal_navbar.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
3333
bottom: 0,
3434
left: 0,
3535
right: 0,
36-
child: Container(
36+
child: SizedBox(
3737
height: 40,
3838
child: _buildPlantIllustrations(),
3939
),
@@ -54,7 +54,7 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
5454
color: Colors.white,
5555
borderRadius: BorderRadius.circular(8),
5656
border: Border.all(
57-
color: Colors.white.withOpacity(0.3),
57+
color: Colors.white,
5858
width: 1,
5959
),
6060
),
@@ -151,14 +151,13 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
151151
Widget _buildPlantIllustrations() {
152152
return Container(
153153
decoration: BoxDecoration(
154-
color: const Color.fromARGB(255, 251, 251, 99)
155-
.withOpacity(0.9), // Beige background
154+
color: const Color.fromARGB(255, 251, 251, 99),
156155
borderRadius: const BorderRadius.only(
157156
topLeft: Radius.circular(40),
158157
topRight: Radius.circular(40),
159158
),
160159
border: Border.all(
161-
color: Colors.black.withOpacity(0.2),
160+
color: Colors.black,
162161
width: 1,
163162
),
164163
),
@@ -183,7 +182,7 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
183182
child: Row(
184183
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
185184
children: treeImages.map((imagePath) {
186-
return Container(
185+
return SizedBox(
187186
width: plantWidth,
188187
height: plantWidth,
189188
child: Image.asset(
@@ -241,15 +240,15 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
241240
constraints: const BoxConstraints(maxWidth: 100, minHeight: 20),
242241
// Limit max width
243242
decoration: BoxDecoration(
244-
color: Colors.white.withOpacity(0.95),
243+
color: Colors.white,
245244
borderRadius: BorderRadius.circular(16),
246245
border: Border.all(
247-
color: Colors.green.withOpacity(0.3),
246+
color: Colors.green,
248247
width: 1,
249248
),
250249
boxShadow: [
251250
BoxShadow(
252-
color: Colors.black.withOpacity(0.1),
251+
color: Colors.black,
253252
blurRadius: 4,
254253
offset: const Offset(0, 2),
255254
),
@@ -267,7 +266,7 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
267266
color: Colors.green[700],
268267
),
269268
const SizedBox(width: 4),
270-
Container(
269+
SizedBox(
271270
width: 10,
272271
child: Flexible(
273272
child: Text(
@@ -366,15 +365,15 @@ class UniversalNavbar extends StatelessWidget implements PreferredSizeWidget {
366365
return Container(
367366
constraints: const BoxConstraints(maxWidth: 80), // Limit max width
368367
decoration: BoxDecoration(
369-
color: Colors.white.withOpacity(0.95),
368+
color: Colors.white,
370369
borderRadius: BorderRadius.circular(16),
371370
border: Border.all(
372-
color: Colors.green.withOpacity(0.3),
371+
color: Colors.green,
373372
width: 1,
374373
),
375374
boxShadow: [
376375
BoxShadow(
377-
color: Colors.black.withOpacity(0.1),
376+
color: Colors.black,
378377
blurRadius: 4,
379378
offset: const Offset(0, 2),
380379
),

lib/components/wallet_connect_dialog.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ class WalletConnectDialog extends StatelessWidget {
4040
onPressed: () async {
4141
try {
4242
await walletProvider.openWallet(wallet, uri);
43+
// ignore: use_build_context_synchronously
4344
Navigator.of(context).pop();
4445
} catch (e) {
46+
// ignore: use_build_context_synchronously
4547
Navigator.of(context).pop();
48+
// ignore: use_build_context_synchronously
4649
ScaffoldMessenger.of(context).showSnackBar(
4750
SnackBar(
4851
content: Text(e.toString()),
@@ -75,7 +78,9 @@ class WalletConnectDialog extends StatelessWidget {
7578
child: OutlinedButton.icon(
7679
onPressed: () async {
7780
await Clipboard.setData(ClipboardData(text: uri));
81+
// ignore: use_build_context_synchronously
7882
Navigator.of(context).pop();
83+
// ignore: use_build_context_synchronously
7984
ScaffoldMessenger.of(context).showSnackBar(
8085
const SnackBar(
8186
content: Text('URI copied to clipboard!'),

lib/models/wallet_chain_option.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_dotenv/flutter_dotenv.dart';
33

4-
final String ALCHEMY_API_KEY = dotenv.env['ALCHEMY_API_KEY'] ?? '';
4+
final String alchemyApiKey = dotenv.env['ALCHEMY_API_KEY'] ?? '';
55

66
class WalletOption {
77
final String name;
@@ -30,14 +30,14 @@ final List<WalletOption> walletOptionsList = [
3030
];
3131

3232
final Map<String, String> rpcUrls = {
33-
'11155111': 'https://eth-sepolia.g.alchemy.com/v2/$ALCHEMY_API_KEY',
34-
'1': 'https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY',
33+
'11155111': 'https://eth-sepolia.g.alchemy.com/v2/$alchemyApiKey',
34+
'1': 'https://eth-mainnet.g.alchemy.com/v2/$alchemyApiKey',
3535
};
3636

3737
final Map<String, Map<String, dynamic>> chainInfoList = {
3838
'1': {
3939
'name': 'Ethereum Mainnet',
40-
'rpcUrl': 'https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY',
40+
'rpcUrl': 'https://eth-mainnet.g.alchemy.com/v2/$alchemyApiKey',
4141
'nativeCurrency': {
4242
'name': 'Ether',
4343
'symbol': 'ETH',
@@ -47,7 +47,7 @@ final Map<String, Map<String, dynamic>> chainInfoList = {
4747
},
4848
'11155111': {
4949
'name': 'Sepolia Testnet',
50-
'rpcUrl': 'https://eth-sepolia.g.alchemy.com/v2/$ALCHEMY_API_KEY',
50+
'rpcUrl': 'https://eth-sepolia.g.alchemy.com/v2/$alchemyApiKey',
5151
'nativeCurrency': {
5252
'name': 'Sepolia Ether',
5353
'symbol': 'SEP',

lib/pages/home_page.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import 'package:flutter/material.dart';
2-
import 'package:go_router/go_router.dart';
32

43
import 'package:provider/provider.dart';
54
import 'package:tree_planting_protocol/providers/wallet_provider.dart';
65

76
import 'package:tree_planting_protocol/utils/constants/navbar_constants.dart';
8-
import 'package:tree_planting_protocol/utils/constants/route_constants.dart';
97

108
import 'package:tree_planting_protocol/widgets/basic_scaffold.dart';
119
import 'package:tree_planting_protocol/widgets/profile_widgets/profile_section_widget.dart';

lib/pages/mint_nft/mint_nft_coordinates.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:tree_planting_protocol/providers/mint_nft_provider.dart';
66
import 'package:tree_planting_protocol/utils/constants/route_constants.dart';
77
import 'package:tree_planting_protocol/widgets/basic_scaffold.dart';
88
import 'package:tree_planting_protocol/widgets/map_widgets/flutter_map_widget.dart';
9-
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_NFT_view_widget.dart';
9+
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_nft_view_widget.dart';
1010
import 'package:tree_planting_protocol/utils/services/get_current_location.dart';
1111
import 'package:dart_geohash/dart_geohash.dart';
1212

@@ -618,6 +618,7 @@ class _MintNftCoordinatesPageState extends State<MintNftCoordinatesPage> {
618618
);
619619
}
620620

621+
// ignore: unused_element
621622
Widget _buildPreviewSection() {
622623
return Column(
623624
crossAxisAlignment: CrossAxisAlignment.start,

lib/pages/mint_nft/mint_nft_details.dart

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import 'package:provider/provider.dart';
44
import 'package:tree_planting_protocol/providers/mint_nft_provider.dart';
55
import 'package:tree_planting_protocol/utils/constants/route_constants.dart';
66
import 'package:tree_planting_protocol/widgets/basic_scaffold.dart';
7-
import 'package:tree_planting_protocol/widgets/map_widgets/flutter_map_widget.dart';
8-
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_NFT_view_widget.dart';
97
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_nft_view_details_with_map.dart';
108

119
class MintNftDetailsPage extends StatefulWidget {
@@ -103,14 +101,14 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
103101
begin: Alignment.topLeft,
104102
end: Alignment.bottomRight,
105103
colors: [
106-
const Color(0xFF1CD381).withOpacity(0.05),
107-
const Color(0xFFFAEB96).withOpacity(0.1),
104+
const Color(0xFF1CD381),
105+
const Color(0xFFFAEB96),
108106
],
109107
),
110108
borderRadius: BorderRadius.circular(24),
111109
boxShadow: [
112110
BoxShadow(
113-
color: const Color(0xFF1CD381).withOpacity(0.15),
111+
color: const Color(0xFF1CD381),
114112
blurRadius: 20,
115113
offset: const Offset(0, 8),
116114
),
@@ -126,7 +124,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
126124
gradient: LinearGradient(
127125
colors: [
128126
const Color(0xFF1CD381),
129-
const Color(0xFF1CD381).withOpacity(0.8),
127+
const Color(0xFF1CD381),
130128
],
131129
),
132130
borderRadius: const BorderRadius.only(
@@ -139,7 +137,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
139137
Container(
140138
padding: const EdgeInsets.all(12),
141139
decoration: BoxDecoration(
142-
color: Colors.white.withOpacity(0.2),
140+
color: Colors.white,
143141
borderRadius: BorderRadius.circular(14),
144142
),
145143
child: const Icon(
@@ -208,7 +206,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
208206
shape: RoundedRectangleBorder(
209207
borderRadius: BorderRadius.circular(16),
210208
),
211-
shadowColor: const Color(0xFF1CD381).withOpacity(0.3),
209+
shadowColor: const Color(0xFF1CD381),
212210
),
213211
child: Row(
214212
mainAxisAlignment: MainAxisAlignment.center,
@@ -224,7 +222,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
224222
Container(
225223
padding: const EdgeInsets.all(4),
226224
decoration: BoxDecoration(
227-
color: Colors.white.withOpacity(0.2),
225+
color: Colors.white,
228226
borderRadius: BorderRadius.circular(6),
229227
),
230228
child: const Icon(
@@ -260,7 +258,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
260258
Container(
261259
padding: const EdgeInsets.all(6),
262260
decoration: BoxDecoration(
263-
color: const Color(0xFF1CD381).withOpacity(0.1),
261+
color: const Color(0xFF1CD381),
264262
borderRadius: BorderRadius.circular(8),
265263
),
266264
child: Icon(
@@ -286,12 +284,12 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
286284
color: Colors.white,
287285
borderRadius: BorderRadius.circular(16),
288286
border: Border.all(
289-
color: const Color(0xFFFAEB96).withOpacity(0.5),
287+
color: const Color(0xFFFAEB96),
290288
width: 2,
291289
),
292290
boxShadow: [
293291
BoxShadow(
294-
color: const Color(0xFF1CD381).withOpacity(0.05),
292+
color: const Color(0xFF1CD381),
295293
blurRadius: 8,
296294
offset: const Offset(0, 2),
297295
),
@@ -337,7 +335,7 @@ class _MintNftCoordinatesPageState extends State<MintNftDetailsPage> {
337335
Container(
338336
padding: const EdgeInsets.all(8),
339337
decoration: BoxDecoration(
340-
color: const Color(0xFFFAEB96).withOpacity(0.3),
338+
color: const Color(0xFFFAEB96),
341339
borderRadius: BorderRadius.circular(10),
342340
),
343341
child: Icon(

lib/pages/mint_nft/mint_nft_images.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ class _MultipleImageUploadPageState extends State<MultipleImageUploadPage> {
4242
if (images.isEmpty) return;
4343

4444
logger.d('Selected ${images.length} images for upload');
45+
46+
// ignore: use_build_context_synchronously
47+
final provider = Provider.of<MintNftProvider>(context, listen: false);
48+
4549
setState(() {
4650
_processingImages = images.map((image) => File(image.path)).toList();
4751
_isUploading = true;
4852
});
4953

50-
final provider = Provider.of<MintNftProvider>(context, listen: false);
5154
List<String> newHashes = [];
5255

5356
for (int i = 0; i < images.length; i++) {
@@ -252,7 +255,7 @@ class _MultipleImageUploadPageState extends State<MultipleImageUploadPage> {
252255
width: 120,
253256
height: 120,
254257
decoration: BoxDecoration(
255-
color: Colors.green.withOpacity(0.8),
258+
color: Colors.green,
256259
borderRadius:
257260
BorderRadius.circular(8),
258261
),

lib/pages/register_user_page.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class _RegisterUserPageState extends State<RegisterUserPage> {
278278
Container(
279279
padding: const EdgeInsets.all(6),
280280
decoration: BoxDecoration(
281-
color: const Color(0xFF1CD381).withOpacity(0.1),
281+
color: const Color(0xFF1CD381),
282282
borderRadius: BorderRadius.circular(8),
283283
),
284284
child: const Icon(
@@ -308,12 +308,12 @@ class _RegisterUserPageState extends State<RegisterUserPage> {
308308
color: Colors.white,
309309
borderRadius: BorderRadius.circular(16),
310310
border: Border.all(
311-
color: const Color(0xFFFAEB96).withOpacity(0.5),
311+
color: const Color(0xFFFAEB96),
312312
width: 2,
313313
),
314314
boxShadow: [
315315
BoxShadow(
316-
color: const Color(0xFF1CD381).withOpacity(0.05),
316+
color: const Color(0xFF1CD381),
317317
blurRadius: 8,
318318
offset: const Offset(0, 2),
319319
),
@@ -444,7 +444,7 @@ Widget _buildFormField({
444444
Container(
445445
padding: const EdgeInsets.all(6),
446446
decoration: BoxDecoration(
447-
color: const Color(0xFF1CD381).withOpacity(0.1),
447+
color: const Color(0xFF1CD381),
448448
borderRadius: BorderRadius.circular(8),
449449
),
450450
child: Icon(
@@ -470,12 +470,12 @@ Widget _buildFormField({
470470
color: Colors.white,
471471
borderRadius: BorderRadius.circular(16),
472472
border: Border.all(
473-
color: const Color(0xFFFAEB96).withOpacity(0.5),
473+
color: const Color(0xFFFAEB96),
474474
width: 2,
475475
),
476476
boxShadow: [
477477
BoxShadow(
478-
color: const Color(0xFF1CD381).withOpacity(0.05),
478+
color: const Color(0xFF1CD381),
479479
blurRadius: 8,
480480
offset: const Offset(0, 2),
481481
),

0 commit comments

Comments
 (0)