mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
clean up and test fixes
This commit is contained in:
parent
9fce8ca107
commit
56f54ac487
3 changed files with 63 additions and 58 deletions
|
@ -1,13 +1,11 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
|
|
||||||
class Background extends ConsumerWidget {
|
class Background extends StatelessWidget {
|
||||||
const Background({
|
const Background({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.child,
|
required this.child,
|
||||||
|
@ -16,12 +14,10 @@ class Background extends ConsumerWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context) {
|
||||||
final colorTheme = ref.watch(colorThemeProvider.state).state;
|
|
||||||
|
|
||||||
Color? color;
|
Color? color;
|
||||||
|
|
||||||
switch (colorTheme.themeType) {
|
switch (Theme.of(context).extension<StackColors>()!.themeType) {
|
||||||
case ThemeType.light:
|
case ThemeType.light:
|
||||||
case ThemeType.dark:
|
case ThemeType.dark:
|
||||||
color = Theme.of(context).extension<StackColors>()!.background;
|
color = Theme.of(context).extension<StackColors>()!.background;
|
||||||
|
|
|
@ -131,7 +131,9 @@ class _EmojiSelectSheetState extends ConsumerState<EmojiSelectSheet> {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: isDesktop ? 16 : 12,
|
height: isDesktop ? 16 : 12,
|
||||||
),
|
),
|
||||||
ClipRRect(
|
Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
Constants.size.circularBorderRadius,
|
Constants.size.circularBorderRadius,
|
||||||
),
|
),
|
||||||
|
@ -183,6 +185,7 @@ class _EmojiSelectSheetState extends ConsumerState<EmojiSelectSheet> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: isDesktop ? 28 : 16,
|
height: isDesktop ? 28 : 16,
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:emojis/emoji.dart';
|
import 'package:emojis/emoji.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||||
import 'package:stackwallet/utilities/theme/light_colors.dart';
|
import 'package:stackwallet/utilities/theme/light_colors.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/widgets/emoji_select_sheet.dart';
|
import 'package:stackwallet/widgets/emoji_select_sheet.dart';
|
||||||
|
@ -43,15 +43,21 @@ void main() {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
home: mockingjay.MockNavigatorProvider(
|
home: mockingjay.MockNavigatorProvider(
|
||||||
navigator: navigator, child: emojiSelectSheet),
|
navigator: navigator,
|
||||||
|
child: Column(
|
||||||
|
children: const [
|
||||||
|
Expanded(child: emojiSelectSheet),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final gestureDetector = find.byType(GestureDetector).first;
|
final gestureDetector = find.byType(GestureDetector).at(5);
|
||||||
expect(gestureDetector, findsOneWidget);
|
expect(gestureDetector, findsOneWidget);
|
||||||
|
|
||||||
final emoji = Emoji.all()[0];
|
final emoji = Emoji.byChar("😅");
|
||||||
|
|
||||||
await tester.tap(gestureDetector);
|
await tester.tap(gestureDetector);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
Loading…
Reference in a new issue