File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+ import 'package:provider/provider.dart' ;
3
+ import 'package:text_to_image_gen/utils/my_states.dart' ;
4
+
5
+ class AccentColors extends StatelessWidget {
6
+ const AccentColors ({Key ? key}) : super (key: key);
7
+
8
+ @override
9
+ Widget build (BuildContext context) {
10
+ final accentState = Provider .of <ThemeState >(context);
11
+ return Dialog (
12
+ child: ListView .builder (
13
+ itemCount: 6 ,
14
+ shrinkWrap: true ,
15
+ itemBuilder: (context, index) {
16
+ return ListTileTheme (
17
+ selectedColor: Theme .of (context).colorScheme.secondary,
18
+ child: ListTile (
19
+ leading: CircleAvatar (
20
+ backgroundColor: accentState.accentColors[index],
21
+ ),
22
+ title: accentState.accentTexts[index],
23
+ selected: index == accentState.currentAccentIndex,
24
+ onTap: () {
25
+ accentState.changeAccent (index);
26
+ Navigator .pop (context);
27
+ },
28
+ ),
29
+ );
30
+ },
31
+ ),
32
+ );
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments