Taha Tesser
b8dcb0c3c5
Update Material 3 LinearProgressIndicator
for new visual style (#154817)
Related to [Update both `ProgressIndicator` for Material 3 redesign](https://github.com/flutter/flutter/issues/141340)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool isRTL = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Directionality(
textDirection: isRTL ? TextDirection.rtl : TextDirection.ltr,
child: Center(
child: Column(
spacing: 2.0,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Default LinearProgressIndicator'),
const Padding(
padding: EdgeInsets.all(16.0),
child: LinearProgressIndicator(
value: 0.45,
),
),
const Text('Default indefinite LinearProgressIndicator'),
const Padding(
padding: EdgeInsets.all(16.0),
child: LinearProgressIndicator(),
),
const Text('Updated height and border radius'),
Padding(
padding: const EdgeInsets.all(16.0),
child: LinearProgressIndicator(
value: 0.25,
minHeight: 16.0,
borderRadius: BorderRadius.circular(16.0),
),
),
const Text('Updated stop indicator color and radius'),
Padding(
padding: const EdgeInsets.all(16.0),
child: LinearProgressIndicator(
value: 0.74,
minHeight: 16.0,
borderRadius: BorderRadius.circular(16.0),
stopIndicatorColor: Theme.of(context).colorScheme.error,
stopIndicatorRadius: 32.0,
),
),
const Text('Track gap and stop indicator radius set to 0'),
Padding(
padding: const EdgeInsets.all(16.0),
child: LinearProgressIndicator(
value: 0.50,
minHeight: 16.0,
borderRadius: BorderRadius.circular(16.0),
trackGap: 0,
stopIndicatorRadius: 0,
),
),
],
),
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
setState(() {
isRTL = !isRTL;
});
},
label: const Text('Toggle Direction'),
),
),
);
}
}
```
</details>
### Preview
<img width="824" alt="Screenshot 2024-09-09 at 13 53 10" src="https://github.com/user-attachments/assets/d12e56a5-f196-4011-8266-c7ab96be96b2">
2024-10-30 18:14:11 +00:00
..
2023-04-04 20:34:29 +00:00
2023-07-12 20:08:05 +00:00
2023-04-04 20:34:29 +00:00
2023-11-20 15:24:41 -08:00
2024-04-08 18:42:07 +00:00
2024-08-06 01:54:52 +00:00
2024-05-09 16:47:16 +00:00
2023-04-04 20:34:29 +00:00
2024-03-11 23:04:57 +00:00
2023-09-20 19:59:08 +00:00
2024-03-25 08:39:05 +00:00
2023-04-04 20:34:29 +00:00
2024-02-12 17:08:20 +00:00
2023-11-01 23:29:49 +00:00
2024-07-17 19:56:01 +00:00
2024-07-08 19:06:54 +00:00
2023-04-04 20:34:29 +00:00
2024-06-13 19:28:21 +00:00
2024-07-03 17:56:48 +00:00
2024-06-12 05:07:23 +00:00
2024-08-12 19:26:39 +00:00
2024-07-08 19:06:54 +00:00
2024-10-22 17:04:23 +00:00
2023-04-18 23:00:03 +00:00
2023-04-04 20:34:29 +00:00
2023-07-17 18:24:49 +00:00
2023-04-04 20:34:29 +00:00
2024-10-02 12:03:20 +00:00
2023-04-04 20:34:29 +00:00
2024-07-11 20:36:55 +00:00
2023-12-06 16:40:24 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2024-10-21 15:17:14 +00:00
2023-08-29 17:31:02 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-09-01 00:02:04 +00:00
2024-09-09 21:49:09 +00:00
2024-09-09 21:49:09 +00:00
2024-04-03 02:39:46 +00:00
2024-10-08 19:15:07 +00:00
2024-07-08 19:06:54 +00:00
2023-07-17 18:24:49 +00:00
2023-07-11 09:30:05 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-08-15 00:55:07 +00:00
2023-04-04 20:34:29 +00:00
2023-11-20 15:24:41 -08:00
2024-10-30 18:14:11 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2024-08-23 20:37:24 +00:00
2024-07-11 20:36:55 +00:00
2024-05-20 08:02:09 +00:00
2023-09-08 09:40:49 +00:00
2024-08-06 01:54:52 +00:00
2024-01-03 21:26:02 +00:00
2024-10-22 07:25:25 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2023-04-04 20:34:29 +00:00
2024-05-23 18:54:11 +00:00
2024-01-12 16:35:08 +00:00
2024-08-01 22:28:22 +00:00
2023-04-04 20:34:29 +00:00
2024-05-20 15:33:16 +00:00
2024-07-26 11:54:28 +00:00
2024-08-01 22:28:22 +00:00
2023-04-04 20:34:29 +00:00
2024-06-18 17:52:21 +00:00
2023-04-04 20:34:29 +00:00
2023-10-26 23:55:38 +00:00
2024-01-26 19:12:24 +00:00
2023-06-02 01:05:31 +00:00
2023-11-03 20:18:36 +00:00
2024-10-22 23:45:41 +00:00