Skip to content

Instantly share code, notes, and snippets.

@omishah
Created November 3, 2022 15:26
Show Gist options
  • Save omishah/2501f2d64531a47e3fb2c13954fdaad8 to your computer and use it in GitHub Desktop.
Save omishah/2501f2d64531a47e3fb2c13954fdaad8 to your computer and use it in GitHub Desktop.
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