-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2082 from acterglobal/kumar/pin-list-improvements
Pin List Item UI-UX Improvements
- Loading branch information
Showing
7 changed files
with
90 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:atlas_icons/atlas_icons.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class PinIcon extends StatelessWidget { | ||
final Color? iconColor; | ||
|
||
const PinIcon({ | ||
super.key, | ||
this.iconColor, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return pinIconUI(context); | ||
} | ||
|
||
Widget pinIconUI(BuildContext context) { | ||
return Container( | ||
height: 50, | ||
width: 50, | ||
decoration: BoxDecoration( | ||
color: iconColor ?? Theme.of(context).unselectedWidgetColor, | ||
borderRadius: const BorderRadius.all(Radius.circular(100)), | ||
), | ||
child: const Icon(Atlas.pin), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:acter/common/utils/routes.dart'; | ||
import 'package:acter/common/widgets/space_name_widget.dart'; | ||
import 'package:acter/features/pins/providers/pins_provider.dart'; | ||
import 'package:acter/features/pins/widgets/pin_icon.dart'; | ||
import 'package:acter_flutter_sdk/acter_flutter_sdk_ffi.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:logging/logging.dart'; | ||
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
import 'package:skeletonizer/skeletonizer.dart'; | ||
|
||
final _log = Logger('a3::pins::pin_item'); | ||
|
||
class PinListItemWidget extends ConsumerWidget { | ||
final String pinId; | ||
final bool showSpace; | ||
|
||
const PinListItemWidget({ | ||
required this.pinId, | ||
this.showSpace = false, | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final pinData = ref.watch(pinProvider(pinId)); | ||
return pinData.when( | ||
data: (pin) => buildPinItemUI(context, pin), | ||
error: (e, s) { | ||
_log.severe('Failed to load pin', e, s); | ||
return Text(L10n.of(context).errorLoadingPin(e)); | ||
}, | ||
loading: () => const Skeletonizer( | ||
child: SizedBox(height: 100, width: 100), | ||
), | ||
); | ||
} | ||
|
||
Widget buildPinItemUI(BuildContext context, ActerPin pin) { | ||
return Card( | ||
child: ListTile( | ||
onTap: () => context.pushNamed( | ||
Routes.pin.name, | ||
pathParameters: {'pinId': pinId}, | ||
), | ||
leading: const PinIcon(), | ||
title: Text(pin.title(), overflow: TextOverflow.ellipsis), | ||
subtitle: showSpace | ||
? SpaceNameWidget(spaceId: pin.roomIdStr(), isShowBrackets: false) | ||
: null, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters