Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Created January 13, 2020 08:28
Show Gist options
  • Select an option

  • Save ashishrawat2911/220778e84eb5c9d44ec0604c3a6b1d15 to your computer and use it in GitHub Desktop.

Select an option

Save ashishrawat2911/220778e84eb5c9d44ec0604c3a6b1d15 to your computer and use it in GitHub Desktop.
import 'dart:ui';
import 'package:flutter/material.dart';
class Styles {
static ThemeData themeData(bool isDarkTheme, BuildContext context) {
return ThemeData(
primarySwatch: Colors.red,
primaryColor: isDarkTheme ? Colors.black : Colors.white,
backgroundColor: isDarkTheme ? Colors.black : Color(0xffF1F5FB),
indicatorColor: isDarkTheme ? Color(0xff0E1D36) : Color(0xffCBDCF8),
buttonColor: isDarkTheme ? Color(0xff3B3B3B) : Color(0xffF1F5FB),
hintColor: isDarkTheme ? Color(0xff280C0B) : Color(0xffEECED3),
highlightColor: isDarkTheme ? Color(0xff372901) : Color(0xffFCE192),
hoverColor: isDarkTheme ? Color(0xff3A3A3B) : Color(0xff4285F4),
focusColor: isDarkTheme ? Color(0xff0B2512) : Color(0xffA8DAB5),
disabledColor: Colors.grey,
textSelectionColor: isDarkTheme ? Colors.white : Colors.black,
cardColor: isDarkTheme ? Color(0xFF151515) : Colors.white,
canvasColor: isDarkTheme ? Colors.black : Colors.grey[50],
brightness: isDarkTheme ? Brightness.dark : Brightness.light,
buttonTheme: Theme.of(context).buttonTheme.copyWith(
colorScheme: isDarkTheme ? ColorScheme.dark() : ColorScheme.light()),
appBarTheme: AppBarTheme(
elevation: 0.0,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment