Created
November 3, 2022 15:26
-
-
Save omishah/2501f2d64531a47e3fb2c13954fdaad8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'MyApp', | |
theme: ThemeData( | |
appBarTheme: | |
const AppBarTheme(systemOverlayStyle: SystemUiOverlayStyle.dark), | |
colorScheme: ColorScheme( | |
brightness: Brightness.light, | |
primary: Colors.black, | |
onPrimary: Colors.white, | |
secondary: Colors.white, | |
onSecondary: Colors.black, | |
error: Colors.red, | |
onError: Colors.white, | |
background: Colors.grey.shade100, | |
onBackground: Colors.black, | |
surface: Colors.grey.shade200, | |
onSurface: Colors.black, | |
), | |
), | |
home: const MyWidget(), | |
); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
const MyWidget({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: const Center( | |
child: Text("Welcome"), | |
), | |
bottomNavigationBar: Container( | |
padding: const EdgeInsets.all(8), | |
color: Theme.of(context) | |
.colorScheme | |
.primary, // <== coming in as blue instead of black | |
child: Row( | |
children: [ | |
IconButton( | |
onPressed: () {}, | |
icon: const Icon(Icons.search), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment