Skip to content

Commit

Permalink
Improved UI of Linux Foundation Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Saumya-28 committed Jun 5, 2024
1 parent d1fcdaf commit 1b82764
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion lib/programs screen/linux_foundation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _LinuxFoundationState extends State<LinuxFoundation> {
return RefreshIndicator(
onRefresh: _refresh,
child: Scaffold(
appBar: AppBar(title: const Text('OpSo'), actions: <Widget>[
appBar: AppBar(title: const Text('Linux Foundation'), actions: <Widget>[
IconButton(
icon: (isBookmarked)
? const Icon(Icons.bookmark_add_rounded)
Expand Down
87 changes: 55 additions & 32 deletions lib/widgets/linux_foundation_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,77 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:opso/modals/linux_foundation_modal.dart';
import 'package:url_launcher/url_launcher.dart';


class LinuxFoundationWidget extends StatelessWidget {
final LinuxFoundationModal modal;
final double height;
final double width;
const LinuxFoundationWidget(
{super.key, required this.modal, this.height = 100, this.width = 100});


@override
Widget build(BuildContext context) {
bool isDarkMode = Theme.of(context).brightness == Brightness.dark;


return GestureDetector(
onTap: () => launchUrl(Uri.parse(modal.projectUrl)),
child: Container(
constraints: BoxConstraints(
minHeight: height,
child: Card(
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
width: width,
decoration: BoxDecoration(
color: const Color.fromARGB(255, 153, 152, 152),
borderRadius: BorderRadius.circular(20)),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// const SizedBox(height: 20),
SvgPicture.network(
modal.imageUrl,
fit: BoxFit.fitWidth,
height: 60,
placeholderBuilder: (context) =>
const CircularProgressIndicator(),
),
const SizedBox(height: 10),
Text(
modal.name,
style: const TextStyle(
fontSize: 18,
color: Color.fromARGB(255, 190, 200, 221),
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
decorationColor: Color.fromARGB(255, 190, 200, 221),
child: Container(
width: width,
constraints: BoxConstraints(minHeight: height),
decoration: BoxDecoration(
color: isDarkMode
? const Color.fromARGB(255, 48, 48, 48)
: const Color.fromARGB(255, 255, 255, 255),
border: Border.all(
color: isDarkMode ? Colors.orange.shade100 : Colors.orange.shade300,
width: 1,
),
borderRadius: BorderRadius.circular(20),
),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
modal.imageUrl == ""
? SvgPicture.asset(
'assets/logo.png',
fit: BoxFit.fitWidth,
height: 60,
)
:
SvgPicture.network(
modal.imageUrl,
fit: BoxFit.fitWidth,
height: 60,
placeholderBuilder: (context) => const CircularProgressIndicator(),
),
const SizedBox(height: 10),
Text(
modal.name,
style: TextStyle(
fontSize: 20,
color: Colors.orange,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
decorationColor: Colors.orange,
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
],
const SizedBox(height: 10),
],
),
),
),
),
);
}
}

0 comments on commit 1b82764

Please sign in to comment.