mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2025-12-16 01:18:50 +00:00
change style for disabled button
This commit is contained in:
parent
436827b390
commit
a330bf9913
@ -59,9 +59,13 @@ class StepsScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
SimpleButton(
|
||||
onPressed: () => gameStateProvider.updateGameState(),
|
||||
child: const Text('update'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12.0),
|
||||
child: SimpleButton(
|
||||
onPressed:
|
||||
true ? null : () => gameStateProvider.updateGameState(),
|
||||
child: const Text('next'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:yaru/theme.dart';
|
||||
|
||||
class SimpleButton extends StatelessWidget {
|
||||
const SimpleButton({super.key, required this.child, required this.onPressed});
|
||||
@ -9,7 +10,12 @@ class SimpleButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(Colors.blue[500]),
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return Colors.grey;
|
||||
}
|
||||
return Colors.blue[500];
|
||||
}),
|
||||
side: MaterialStateProperty.all(BorderSide.none),
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:yaru/widgets.dart';
|
||||
|
||||
import './../../models/github.dart';
|
||||
import './../../providers/providers.dart';
|
||||
|
||||
class ProtonSteps extends StatefulWidget {
|
||||
const ProtonSteps({super.key});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user