Skip to content

Commit

Permalink
Merge pull request #16 from NatsuOnFire/disabled_buttons
Browse files Browse the repository at this point in the history
Possibility to disable buttons
  • Loading branch information
emreesen27 committed Aug 17, 2021
2 parents a9a33f8 + db2c275 commit 9c9e78a
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 143 deletions.
16 changes: 16 additions & 0 deletions example/lib/main.dart
Expand Up @@ -11,6 +11,9 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Sign in Button Demo',
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
themeMode: ThemeMode.system,
home: MyHomePage(title: 'Sign in Button Demo'),
);
}
Expand Down Expand Up @@ -180,10 +183,23 @@ class _MyHomePageState extends State<MyHomePage> {
_buttonClick = "pinterest";
});
}),
//disabled button
SignInButton(
buttonType: ButtonType.yahoo,
//btnDisabledColor: Colors.grey,
//btnDisabledTextColor: Colors.grey[700],
onPressed: null
),
SignInButton.mini(
buttonType: ButtonType.github,
onPressed: () {},
),
//disabled mini button
SignInButton.mini(
buttonType: ButtonType.quora,
//btnDisabledColor: Colors.grey,
onPressed: null,
),
],
),
),
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -106,7 +106,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -141,7 +141,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.3.0"
typed_data:
dependency: transitive
description:
Expand Down
16 changes: 0 additions & 16 deletions example/test/widget_test.dart
Expand Up @@ -5,26 +5,10 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:example/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
File renamed without changes
File renamed without changes

0 comments on commit 9c9e78a

Please sign in to comment.