mobile bluesky app made with flutter lazurite.stormlightlabs.org/
mobile bluesky flutter
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: blacksky logo tint

+40 -3
+14 -1
lib/features/auth/presentation/login_screen.dart
··· 343 343 class _ProviderTabLabel extends StatelessWidget { 344 344 const _ProviderTabLabel({required this.assetPath, required this.name}); 345 345 346 + static const _blackSkyAssetPath = 'assets/blacksky.svg'; 347 + static const _blackSkyDarkModeColor = Color(0xFF6868B6); 348 + 346 349 final String assetPath; 347 350 final String name; 348 351 349 352 @override 350 353 Widget build(BuildContext context) => Row( 351 354 mainAxisSize: MainAxisSize.min, 352 - children: [SvgPicture.asset(assetPath, height: 16), const SizedBox(width: 8), Text(name)], 355 + children: [ 356 + SvgPicture.asset( 357 + assetPath, 358 + height: 16, 359 + colorFilter: assetPath == _blackSkyAssetPath && Theme.of(context).brightness == Brightness.dark 360 + ? const ColorFilter.mode(_blackSkyDarkModeColor, BlendMode.srcIn) 361 + : null, 362 + ), 363 + const SizedBox(width: 8), 364 + Text(name), 365 + ], 353 366 ); 354 367 } 355 368
+26 -2
test/features/auth/presentation/login_screen_test.dart
··· 1 1 import 'package:bloc_test/bloc_test.dart'; 2 2 import 'package:flutter/material.dart'; 3 3 import 'package:flutter_bloc/flutter_bloc.dart'; 4 + import 'package:flutter_svg/flutter_svg.dart'; 4 5 import 'package:flutter_test/flutter_test.dart'; 5 6 import 'package:go_router/go_router.dart'; 6 7 import 'package:lazurite/core/theme/app_theme.dart'; ··· 35 36 when(() => settingsCubit.setAppViewProvider(any())).thenAnswer((_) async {}); 36 37 }); 37 38 38 - Widget buildSubject() { 39 + Widget buildSubject({ThemeMode themeMode = ThemeMode.system}) { 39 40 final typeaheadRepository = _FakeTypeaheadRepository( 40 41 searchHandler: ({required String query, int limit = 10}) async => const [], 41 42 ); ··· 64 65 initialLocation: '/login', 65 66 ); 66 67 67 - return MaterialApp.router(routerConfig: router); 68 + return MaterialApp.router( 69 + routerConfig: router, 70 + theme: ThemeData.light(), 71 + darkTheme: ThemeData.dark(), 72 + themeMode: themeMode, 73 + ); 68 74 } 69 75 70 76 testWidgets('shows terms and privacy links', (tester) async { ··· 158 164 () => settingsCubit.setAppViewProvider('bluesky'), 159 165 () => authBloc.add(const OAuthLoginRequested(handle: 'river.bsky.social')), 160 166 ]); 167 + }); 168 + 169 + testWidgets('tints BlackSky logo in dark mode', (tester) async { 170 + await tester.pumpWidget(buildSubject(themeMode: ThemeMode.dark)); 171 + await tester.pumpAndSettle(); 172 + 173 + final blackSkyRow = find.ancestor(of: find.text('BlackSky'), matching: find.byType(Row)); 174 + final blackSkyLogo = find.descendant(of: blackSkyRow, matching: find.byType(SvgPicture)); 175 + final blackSkySvg = tester.widget<SvgPicture>(blackSkyLogo.first); 176 + expect( 177 + blackSkySvg.colorFilter, 178 + const ColorFilter.mode(Color(0xFF6868B6), BlendMode.srcIn), 179 + ); 180 + 181 + final blueSkyRow = find.ancestor(of: find.text('BlueSky'), matching: find.byType(Row)); 182 + final blueSkyLogo = find.descendant(of: blueSkyRow, matching: find.byType(SvgPicture)); 183 + final blueSkySvg = tester.widget<SvgPicture>(blueSkyLogo.first); 184 + expect(blueSkySvg.colorFilter, isNull); 161 185 }); 162 186 } 163 187