update
This commit is contained in:
parent
b21ee2ee82
commit
ecccd4a9bf
16 changed files with 232 additions and 193 deletions
37
lib/widgets/buttonwithprogress_widget.dart
Normal file
37
lib/widgets/buttonwithprogress_widget.dart
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
||||
class ButtonWithProgressWidget extends StatelessWidget {
|
||||
final bool trigger;
|
||||
final String progressText;
|
||||
final String buttonText;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
const ButtonWithProgressWidget(
|
||||
{super.key,
|
||||
required this.trigger,
|
||||
required this.progressText,
|
||||
required this.buttonText,
|
||||
required this.onPressed});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (trigger) {
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
|
||||
const Gap(16),
|
||||
TextWidget(
|
||||
text: progressText,
|
||||
size: 12,
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
return ButtonWidget(text: buttonText, onPressed: onPressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,13 +20,14 @@ class DropdownWrapperWidget extends StatelessWidget {
|
|||
? Column(
|
||||
children: [
|
||||
const Gap(8),
|
||||
Row(
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 16,
|
||||
children: [
|
||||
const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
|
||||
TextWidget(text: 'Fetching $text', size: 16)
|
||||
const Gap(4),
|
||||
TextWidget(text: 'Fetching $text', size: 14)
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -19,16 +19,15 @@ class DropdownWrapperMultiWidget extends StatelessWidget {
|
|||
return (list.isEmpty)
|
||||
? Column(
|
||||
children: [
|
||||
const Gap(8),
|
||||
Row(
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 16,
|
||||
children: [
|
||||
const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
|
||||
const Gap(16),
|
||||
TextWidget(
|
||||
text: 'Fetching $text',
|
||||
size: 16,
|
||||
size: 14,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue