Skip to content

Commit 9328e97

Browse files
Fixes/Refactoring (#103)
* Adding extension function on Color Refactoring * Update extensions.dart * Custom test * Version update * Refactoring typos
1 parent db14a10 commit 9328e97

18 files changed

+300
-136
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
## 0.2.2
2+
3+
- Improve `ExpandableListTileButton` to handle bottom inerts.
4+
- Solved `CustomActionButton` bugs.
5+
- Updated tests files.
6+
- Solved multiples bug and enhance the already existing widgets.
7+
18
## 0.2.1
2-
``
9+
310
- Improve `CustomBottomNavBar` to handle `onPress` action.
411
- Improve `CustomActionButton` by adding new `iconOnly` factory.
512
- Solved `CustomActionButton` bugs.

example/lib/pages/action_button_page.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class _ActionButtonPageState extends State<ActionButtonPage> {
195195
foregroundColor: Colors.black87,
196196
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
197197
icon: const Icon(CupertinoIcons.arrow_down_doc, size: 18),
198-
child: const Text("Bollettino"),
198+
child: const Text("Rounded Button Icon"),
199199
),
200200

201201
CustomActionButton.rounded(
@@ -222,7 +222,7 @@ class _ActionButtonPageState extends State<ActionButtonPage> {
222222
),
223223
),
224224

225-
// Big rounded “Invia” with a blue sweep
225+
// Big rounded “Send” with a blue sweep
226226
CustomActionButton.rounded(
227227
onPressed: () {},
228228
minHeight: 64,
@@ -233,10 +233,10 @@ class _ActionButtonPageState extends State<ActionButtonPage> {
233233
colors: [Color(0xFF0E5480), Color(0xFF0C6DA0)],
234234
),
235235
foregroundColor: Colors.white,
236-
child: const Text('Invia'),
236+
child: const Text('Submit'),
237237
),
238238

239-
// Compact “Pianifica assenza” tile with icon, same gradient
239+
// Compact “Plan Absence” tile with icon, same gradient
240240
CustomActionButton.flat(
241241
onPressed: () {},
242242
borderRadius: 16,
@@ -250,7 +250,7 @@ class _ActionButtonPageState extends State<ActionButtonPage> {
250250
),
251251
foregroundColor: Colors.white,
252252
icon: const Icon(Icons.calendar_today, size: 16),
253-
child: const Text('Pianifica assenza'),
253+
child: const Text('Plan Absence'),
254254
),
255255
CustomActionButton.flat(
256256
onPressed: null,
@@ -265,7 +265,7 @@ class _ActionButtonPageState extends State<ActionButtonPage> {
265265
),
266266
foregroundColor: Colors.white,
267267
icon: const Icon(Icons.calendar_today, size: 16),
268-
child: const Text('Pianifica assenza'),
268+
child: const Text('Plan Absence'),
269269
),
270270

271271
const SizedBox(height: 16),

example/lib/pages/custom_sheet_page.dart

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

4+
import 'expandable_stack_page.dart';
5+
46
class CustomSheetPage extends StatefulWidget {
57
const CustomSheetPage({super.key});
68

@@ -123,6 +125,18 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
123125
},
124126
child: const Text('Show Expandable Overlay'),
125127
),
128+
CustomActionButton(
129+
margin: const EdgeInsets.symmetric(vertical: 8),
130+
onPressed: () {
131+
Navigator.push(
132+
context,
133+
MaterialPageRoute(
134+
builder: (context) => const ExpandableStackPage(),
135+
),
136+
);
137+
},
138+
child: const Text('Show Expandable Stack in page'),
139+
),
126140

127141
CustomActionButton(
128142
margin: const EdgeInsets.symmetric(vertical: 8),
@@ -179,7 +193,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
179193
children: [
180194
const Expanded(
181195
child: Text(
182-
'Ricarica saldo',
196+
'Recharge wallet',
183197
style: TextStyle(
184198
fontSize: 20,
185199
fontWeight: FontWeight.w600,
@@ -277,7 +291,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
277291
value.value,
278292
),
279293
child: const Text(
280-
'Invia',
294+
'Send',
281295
style: TextStyle(fontSize: 18),
282296
),
283297
),
@@ -314,7 +328,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
314328
header: const Padding(
315329
padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
316330
child: Text(
317-
'Riepilogo',
331+
'Recap',
318332
style: TextStyle(
319333
color: Colors.white,
320334
fontSize: 24,
@@ -340,7 +354,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
340354
MainAxisAlignment.spaceBetween,
341355
children: [
342356
Text(
343-
'Retta mensile trasporto',
357+
'Monthly subscription',
344358
style: TextStyle(
345359
color: Colors.white,
346360
fontSize: 16,
@@ -389,7 +403,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
389403
crossAxisAlignment: CrossAxisAlignment.start,
390404
mainAxisSize: MainAxisSize.min,
391405
children: [
392-
Text('Totale importo:', style: TextStyle(color: Colors.white70)),
406+
Text('Total amount:', style: TextStyle(color: Colors.white70)),
393407
SizedBox(height: 4),
394408
Text(
395409
'30,00€',
@@ -406,7 +420,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
406420
TextButton(
407421
onPressed: onClose,
408422
child: const Text(
409-
'Chiudi',
423+
'Close',
410424
style: TextStyle(color: Colors.white),
411425
),
412426
),
@@ -423,7 +437,7 @@ class _CustomSheetPageState extends State<CustomSheetPage> {
423437
),
424438
),
425439
child: const Text(
426-
'Avanti',
440+
'Next',
427441
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
428442
),
429443
),
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:risto_widgets/widgets/popup/open_custom_sheet.dart';
3+
4+
class ExpandableStackPage extends StatelessWidget {
5+
const ExpandableStackPage({super.key});
6+
7+
@override
8+
Widget build(BuildContext context) {
9+
return Scaffold(
10+
resizeToAvoidBottomInset: true,
11+
extendBody: true,
12+
appBar: AppBar(title: const Text('Expandable Stack Example')),
13+
floatingActionButton: OpenCustomSheet.expandable(
14+
context,
15+
presentAsRoute: false,
16+
initialChildSize: 0.25,
17+
minChildSize: 0.25,
18+
maxChildSize: 0.8,
19+
backgroundColor: const Color(0xFF0A4F70),
20+
header: const Padding(
21+
padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
22+
child: Text(
23+
'Summary',
24+
style: TextStyle(
25+
color: Colors.white,
26+
fontSize: 24,
27+
fontWeight: FontWeight.w500,
28+
),
29+
),
30+
),
31+
body:
32+
({scrollController}) => ListView.builder(
33+
controller: scrollController,
34+
physics: const BouncingScrollPhysics(
35+
parent: AlwaysScrollableScrollPhysics(),
36+
),
37+
padding: const EdgeInsets.symmetric(horizontal: 24.0),
38+
itemCount: 10,
39+
itemBuilder:
40+
(context, index) => Padding(
41+
padding: const EdgeInsets.symmetric(vertical: 8.0),
42+
child: Column(
43+
children: [
44+
const Row(
45+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
46+
children: [
47+
Text(
48+
'Monthly transport fee',
49+
style: TextStyle(
50+
color: Colors.white,
51+
fontSize: 16,
52+
),
53+
),
54+
Text(
55+
'€30.00',
56+
style: TextStyle(
57+
color: Colors.white,
58+
fontSize: 16,
59+
fontWeight: FontWeight.bold,
60+
),
61+
),
62+
],
63+
),
64+
const SizedBox(height: 16),
65+
const Divider(color: Color(0x33FFFFFF), height: 1),
66+
],
67+
),
68+
),
69+
),
70+
footer: _buildPersistentFooter(context),
71+
).buildExpandable(context),
72+
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
73+
);
74+
}
75+
76+
Widget _buildPersistentFooter(BuildContext context, {VoidCallback? onClose}) {
77+
return Padding(
78+
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12),
79+
child: Row(
80+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
81+
crossAxisAlignment: CrossAxisAlignment.end,
82+
children: [
83+
const Column(
84+
crossAxisAlignment: CrossAxisAlignment.start,
85+
mainAxisSize: MainAxisSize.min,
86+
children: [
87+
Text('Total amount:', style: TextStyle(color: Colors.white70)),
88+
SizedBox(height: 4),
89+
Text(
90+
'€30.00',
91+
style: TextStyle(
92+
color: Colors.white,
93+
fontSize: 28,
94+
fontWeight: FontWeight.bold,
95+
),
96+
),
97+
],
98+
),
99+
Row(
100+
children: [
101+
TextButton(
102+
onPressed: onClose,
103+
child: const Text(
104+
'Close',
105+
style: TextStyle(color: Colors.white),
106+
),
107+
),
108+
const SizedBox(width: 8),
109+
ElevatedButton(
110+
onPressed: () {},
111+
style: ElevatedButton.styleFrom(
112+
backgroundColor: Colors.white,
113+
foregroundColor: const Color(0xFF0A4F70),
114+
shape: const StadiumBorder(),
115+
padding: const EdgeInsets.symmetric(
116+
horizontal: 40,
117+
vertical: 16,
118+
),
119+
),
120+
child: const Text(
121+
'Next',
122+
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
123+
),
124+
),
125+
],
126+
),
127+
],
128+
),
129+
);
130+
}
131+
}

0 commit comments

Comments
 (0)