remove fixed colors

This commit is contained in:
Ankit Mahato
2023-03-11 22:37:47 +05:30
parent 349149c67f
commit e602e5dca5
5 changed files with 19 additions and 13 deletions

View File

@ -3,16 +3,12 @@ import 'package:google_fonts/google_fonts.dart';
final kColorTransparent = MaterialStateProperty.all<Color>(Colors.transparent); final kColorTransparent = MaterialStateProperty.all<Color>(Colors.transparent);
const kColorBg = Colors.white; const kColorBg = Colors.white;
final kColorGrey50 = Colors.grey.shade50;
final kColorGrey100 = Colors.grey.shade100; final kColorGrey100 = Colors.grey.shade100;
final kColorGrey200 = Colors.grey.shade200;
final kColorGrey300 = Colors.grey.shade300;
final kColorGrey400 = Colors.grey.shade400;
final kColorGrey500 = Colors.grey.shade500; final kColorGrey500 = Colors.grey.shade500;
final kColorErrorMsg = kColorGrey500;
final kCodeStyle = GoogleFonts.sourceCodePro(); final kCodeStyle = GoogleFonts.sourceCodePro();
final kCodeHintStyle = kCodeStyle.copyWith(color: kColorGrey500); final kCodeHintStyle = kCodeStyle.copyWith(color: kColorGrey500);
const kHintOpacity = 0.6;
const kTextStyleButton = TextStyle(fontWeight: FontWeight.bold); const kTextStyleButton = TextStyle(fontWeight: FontWeight.bold);

View File

@ -29,6 +29,7 @@ class App extends StatelessWidget {
fontFamily: GoogleFonts.openSans().fontFamily, fontFamily: GoogleFonts.openSans().fontFamily,
colorSchemeSeed: Colors.blue, colorSchemeSeed: Colors.blue,
useMaterial3: true, useMaterial3: true,
brightness: Brightness.light,
), ),
home: const HomePage(), home: const HomePage(),
); );

View File

@ -35,8 +35,10 @@ class _EditorPaneRequestDetailsCardState
data: MultiSplitViewThemeData( data: MultiSplitViewThemeData(
dividerThickness: 3, dividerThickness: 3,
dividerPainter: DividerPainters.background( dividerPainter: DividerPainters.background(
color: kColorGrey200, color: Theme.of(context).colorScheme.surfaceVariant,
highlightedColor: kColorGrey400, highlightedColor: Theme.of(context).colorScheme.outline.withOpacity(
kHintOpacity,
),
animationEnabled: false, animationEnabled: false,
), ),
), ),

View File

@ -71,14 +71,14 @@ class _DropdownButtonHTTPMethodState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Color color = Theme.of(context).colorScheme.surface; final surfaceColor = Theme.of(context).colorScheme.surface;
final activeId = ref.watch(activeIdStateProvider); final activeId = ref.watch(activeIdStateProvider);
final collection = ref.read(collectionStateNotifierProvider); final collection = ref.read(collectionStateNotifierProvider);
final idIdx = collection.indexWhere((m) => m.id == activeId); final idIdx = collection.indexWhere((m) => m.id == activeId);
final method = ref.watch( final method = ref.watch(
collectionStateNotifierProvider.select((value) => value[idIdx].method)); collectionStateNotifierProvider.select((value) => value[idIdx].method));
return DropdownButton<HTTPVerb>( return DropdownButton<HTTPVerb>(
focusColor: color, focusColor: surfaceColor,
value: method, value: method,
icon: const Icon(Icons.unfold_more_rounded), icon: const Icon(Icons.unfold_more_rounded),
elevation: 4, elevation: 4,
@ -136,7 +136,11 @@ class _URLTextFieldState extends ConsumerState<URLTextField> {
style: kCodeStyle, style: kCodeStyle,
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Enter API endpoint like api.foss42.com/country/codes", hintText: "Enter API endpoint like api.foss42.com/country/codes",
hintStyle: kCodeHintStyle, hintStyle: kCodeStyle.copyWith(
color: Theme.of(context).colorScheme.outline.withOpacity(
kHintOpacity,
),
),
border: InputBorder.none, border: InputBorder.none,
), ),
onChanged: (value) { onChanged: (value) {

View File

@ -32,10 +32,13 @@ class HomePageState extends State<HomePage> {
Expanded( Expanded(
child: MultiSplitViewTheme( child: MultiSplitViewTheme(
data: MultiSplitViewThemeData( data: MultiSplitViewThemeData(
dividerThickness: 4, dividerThickness: 3,
dividerPainter: DividerPainters.background( dividerPainter: DividerPainters.background(
color: kColorGrey200, color: Theme.of(context).colorScheme.surfaceVariant,
highlightedColor: kColorGrey400, highlightedColor:
Theme.of(context).colorScheme.outline.withOpacity(
kHintOpacity,
),
animationEnabled: false, animationEnabled: false,
), ),
), ),