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
..
2024-10-22 17:32:05 +00:00
2024-09-04 00:20:16 +00:00
2024-09-13 08:09:13 +00:00
2024-09-10 15:32:40 -07:00
2024-09-06 21:10:35 +00:00
2024-10-17 13:03:22 +00:00
2024-09-10 15:32:40 -07:00
2024-10-17 17:04:07 +00:00
2024-07-08 21:01:56 +00:00
2024-04-25 10:32:45 -07:00
2024-09-10 15:32:40 -07:00
2024-09-04 18:35:23 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-02-28 13:55:50 -08:00
2024-10-18 22:37:51 +00:00
2024-09-10 15:32:40 -07:00
2024-08-28 18:40:05 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-08-22 03:30:22 +00:00
2024-06-12 20:05:10 +00:00
2024-10-04 18:59:05 +00:00
2024-10-02 00:21:23 +00:00
2024-10-12 05:37:38 +00:00
2024-10-02 22:47:18 +00:00
2024-10-21 19:25:52 +00:00
2024-10-21 19:25:52 +00:00
2024-09-10 15:32:40 -07:00
2024-09-04 00:20:16 +00:00
2024-06-20 06:44:11 -07:00
2024-09-04 16:27:48 +00:00
2024-08-15 19:02:23 +00:00
2024-09-10 15:32:40 -07:00
2024-10-02 23:48:13 +00:00
2024-09-10 15:32:40 -07:00
2024-09-06 21:10:35 +00:00
2024-09-06 19:13:17 +00:00
2024-10-02 23:48:13 +00:00
2024-09-10 15:32:40 -07:00
2024-07-08 21:01:56 +00:00
2024-08-29 02:23:19 +00:00
2024-09-10 15:32:40 -07:00
2024-04-08 20:47:13 +00:00
2024-10-16 07:30:34 +00:00
2024-02-28 13:55:50 -08:00
2024-07-31 11:22:26 +00:00
2024-09-18 00:19:40 +00:00
2024-02-28 13:55:50 -08:00
2024-06-12 20:05:10 +00:00
2024-06-12 20:05:10 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-09-18 00:19:40 +00:00
2024-02-28 13:55:50 -08:00
2024-09-04 00:20:16 +00:00
2024-10-08 07:42:08 +00:00
2024-07-31 23:35:24 +00:00
2024-06-12 20:05:10 +00:00
2024-09-10 15:32:40 -07:00
2024-10-18 22:37:51 +00:00
2024-04-24 11:56:32 +00:00
2024-07-15 07:09:09 +00:00
2024-04-09 19:35:07 +00:00
2024-02-07 02:44:21 +00:00
2024-04-09 19:35:07 +00:00
2024-06-12 20:05:10 +00:00
2024-06-13 19:28:21 +00:00
2024-07-08 21:01:56 +00:00
2024-10-22 23:45:41 +00:00
2024-10-18 22:37:51 +00:00
2024-09-10 15:32:40 -07:00
2024-02-21 08:59:24 +00:00
2024-04-03 15:49:38 -07:00
2024-06-12 20:05:10 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-10-30 09:42:00 +00:00
2024-07-11 19:25:18 +00:00
2024-03-11 23:04:57 +00:00
2024-06-12 20:05:10 +00:00
2024-09-10 15:32:40 -07:00
2024-09-11 23:59:53 +00:00
2024-09-10 15:32:40 -07:00
2024-10-18 22:37:51 +00:00
2024-09-10 15:32:40 -07:00
2024-09-18 00:19:40 +00:00
2024-02-28 13:55:50 -08:00
2024-05-28 16:35:29 -07:00
2024-08-28 18:40:05 +00:00
2024-09-09 21:49:07 +00:00
2024-10-17 19:43:20 +00:00
2024-10-21 19:52:30 +00:00
2024-09-10 15:32:40 -07:00
2024-03-27 16:43:10 -07:00
2024-10-30 18:14:11 +00:00
2024-10-30 18:14:11 +00:00
2024-10-18 22:37:51 +00:00
2024-10-18 22:37:51 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-06-12 20:05:10 +00:00
2024-08-30 17:50:08 +00:00
2024-07-30 20:38:06 +00:00
2024-10-27 04:54:30 +00:00
2024-03-13 16:31:50 +00:00
2024-03-19 17:58:13 +00:00
2024-10-15 20:24:48 +00:00
2024-09-10 15:32:40 -07:00
2024-10-03 18:14:51 +00:00
2024-10-15 20:24:48 +00:00
2024-09-18 00:19:40 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 09:06:17 -07:00
2024-10-30 10:16:23 +00:00
2024-10-30 10:16:23 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-04-15 16:06:07 +00:00
2024-09-11 23:59:53 +00:00
2024-10-18 22:37:51 +00:00
2024-07-16 20:25:09 +00:00
2024-09-10 15:32:40 -07:00
2024-10-21 19:25:52 +00:00
2024-10-29 10:51:38 +00:00
2024-04-17 07:59:07 +00:00
2024-09-18 00:19:40 +00:00
2024-02-28 13:55:50 -08:00
2024-09-10 15:32:40 -07:00
2024-06-18 17:52:21 +00:00
2024-09-10 15:32:40 -07:00
2024-03-01 06:40:47 +00:00
2024-09-04 16:27:48 +00:00
2024-10-08 19:52:38 +00:00
2024-02-28 13:55:50 -08:00
2024-10-29 10:25:20 +00:00
2024-09-10 15:32:40 -07:00
2024-07-11 16:51:35 +00:00
2024-09-10 15:32:40 -07:00
2024-09-10 15:32:40 -07:00
2024-05-18 10:41:56 -07:00
2024-09-10 15:32:40 -07:00
2024-03-28 01:20:55 +00:00
2024-06-12 20:05:10 +00:00
2024-02-21 00:34:11 +00:00