Skip to content

Instantly share code, notes, and snippets.

@Kurogoma4D
Created June 3, 2025 02:34
Show Gist options
  • Save Kurogoma4D/5bc503056ae68106cfc668a2733bca24 to your computer and use it in GitHub Desktop.
Save Kurogoma4D/5bc503056ae68106cfc668a2733bca24 to your computer and use it in GitHub Desktop.
Generated by Figma to code workflow on Dify.
import 'package:flutter/material.dart';
class DetailScreen extends StatelessWidget {
const DetailScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Container(
color: Color(0xFFE4E4E4),
padding: EdgeInsets.fromLTRB(16, 24, 16, 12),
child: SafeArea(
child: Row(
children: [
GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 32,
height: 32,
padding: EdgeInsets.all(8),
child: Icon(Icons.arrow_back, size: 24),
),
),
SizedBox(width: 10),
Text(
'Detail',
style: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.bold,
fontSize: 40,
),
),
],
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.fromLTRB(16, 32, 16, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: 200,
decoration: BoxDecoration(
color: Color(0xFFE3E3E3),
borderRadius: BorderRadius.circular(16),
),
),
SizedBox(height: 40),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'List',
style: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.bold,
fontSize: 24,
),
),
SizedBox(height: 10),
Text(
'Description',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 20,
),
),
],
),
],
),
),
),
],
),
);
}
}
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
_buildHeader(),
Expanded(
child: _buildContent(),
),
],
),
),
);
}
Widget _buildHeader() {
return Container(
padding: EdgeInsets.fromLTRB(16, 24, 16, 12),
color: Color(0xFFE4E4E4),
child: Row(
children: [
Text(
'Title',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 40,
fontWeight: FontWeight.bold,
),
),
],
),
);
}
Widget _buildContent() {
return ListView(
children: [
_buildSearchBar(),
_buildListItem('List', 'Description', onTap: () {
// Navigate to detail page
}),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
_buildListItem('List', 'Description'),
],
);
}
Widget _buildSearchBar() {
return Padding(
padding: EdgeInsets.all(10),
child: TextField(
decoration: InputDecoration(
filled: true,
fillColor: Color(0xFFDFDFDF),
hintText: 'Search...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,
),
contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 12),
),
onSubmitted: (value) {
// Perform search
},
),
);
}
Widget _buildListItem(String title, String description, {VoidCallback? onTap}) {
return GestureDetector(
onTap: onTap,
child: Container(
padding: EdgeInsets.fromLTRB(16, 0, 16, 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10),
Text(
description,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 20,
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment