Skip to content

Commit a1a8340

Browse files
committed
feat: ナビゲーションバーのテーマを追加し、透明背景とカスタムスタイルを設定
1 parent 15a668b commit a1a8340

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

lib/main.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ class MyApp extends StatelessWidget {
190190
elevation: 2,
191191
),
192192
),
193+
navigationBarTheme: NavigationBarThemeData(
194+
backgroundColor: Colors.transparent,
195+
surfaceTintColor: Colors.transparent,
196+
elevation: 0,
197+
indicatorColor: lightColorScheme.primary.withOpacity(0.20),
198+
iconTheme: MaterialStateProperty.resolveWith((states) {
199+
final color = states.contains(MaterialState.selected)
200+
? lightColorScheme.primary
201+
: lightColorScheme.onSurfaceVariant;
202+
return IconThemeData(color: color);
203+
}),
204+
labelTextStyle: MaterialStateProperty.resolveWith((states) {
205+
final color = states.contains(MaterialState.selected)
206+
? lightColorScheme.primary
207+
: lightColorScheme.onSurfaceVariant;
208+
return TextStyle(color: color);
209+
}),
210+
),
193211
cardTheme: CardThemeData(
194212
elevation: 2,
195213
margin: const EdgeInsets.all(8),
@@ -209,6 +227,24 @@ class MyApp extends StatelessWidget {
209227
elevation: 2,
210228
backgroundColor: themeProvider.isPureBlack ? Colors.black : null,
211229
),
230+
navigationBarTheme: NavigationBarThemeData(
231+
backgroundColor: Colors.transparent,
232+
surfaceTintColor: Colors.transparent,
233+
elevation: 0,
234+
indicatorColor: darkColorScheme.primary.withOpacity(0.20),
235+
iconTheme: MaterialStateProperty.resolveWith((states) {
236+
final color = states.contains(MaterialState.selected)
237+
? darkColorScheme.primary
238+
: darkColorScheme.onSurfaceVariant;
239+
return IconThemeData(color: color);
240+
}),
241+
labelTextStyle: MaterialStateProperty.resolveWith((states) {
242+
final color = states.contains(MaterialState.selected)
243+
? darkColorScheme.primary
244+
: darkColorScheme.onSurfaceVariant;
245+
return TextStyle(color: color);
246+
}),
247+
),
212248
cardTheme: CardThemeData(
213249
elevation: 2,
214250
margin: const EdgeInsets.all(8),

0 commit comments

Comments
 (0)