'How do I set a progress Indicator next to a button?
I want to add a progress loading indicator next to or ontop of a button as shown below in the screenshot. I've tried Row which works but still has some issues. I've tried Stack but when I add the loading bar it seems to disappear on me. Any suggestions?
loading indicator next to button
SizedBox(
width: double.infinity,
height: 150,
child: Container(
child: Stack(
fit: StackFit.passthrough,
children: <Widget>[
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/background_large_gradient.png"),
fit: BoxFit.cover,
),
),
child: OutlinedButton(
child: boatLiftImage,
onPressed: _pressedBoatRemote,
),
),
Align(
alignment: Alignment.centerRight,
child: Padding(
padding: EdgeInsets.fromLTRB(0, 0, 40, 10),
child: Text(
'50%',
style: TextStyle(color: Colors.white),
),
),
),
Align(
alignment: Alignment.centerRight,
child: Padding(
padding: const EdgeInsets.all(10),
child: Container(
child: RotatedBox(
quarterTurns: -1,
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(10)),
child: LinearProgressIndicator(
minHeight: 20,
value: 0.5,
valueColor: AlwaysStoppedAnimation(
Colors.blue),
backgroundColor: Colors.white,
),
),
),
),
),
),
],
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
