Closed Mduardar27 closed 1 month ago
Código base ( sem estilização e correção de possíveis erros extras ) : ` import 'package:flutter/material.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Cyber Freelancer', theme: ThemeData( primarySwatch: Colors.blue, ), home: FreelancerDemoScreen(), ); } }
class FreelancerDemoScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Projetos'), ), body: ListView.builder( itemCount: demoProjects.length, itemBuilder: (BuildContext context, int index) { return Card( child: ListTile( title: Text(demoProjects[index].title), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Descrição: ${demoProjects[index].description}'), Text('Prazo: ${demoProjects[index].deadline}'), Text('Valor Mínimo: ${demoProjects[index].minValue}'), Text('Valor Máximo: ${demoProjects[index].maxValue}'), Text('Nome do Cliente: ${demoProjects[index].clientName}'), SizedBox(height: 8.0), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ IconButton( icon: Icon(Icons.arrow_forward), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ProjectDetailsScreen(project: demoProjects[index]), ), ); }, ), ], ), ], ), onTap: () { // Ação ao clicar no card }, ), ); }, ), ); } }
class Project { final String title; final String description; final String deadline; final double minValue; final double maxValue; final String clientName;
Project({ required this.title, required this.description, required this.deadline, required this.minValue, required this.maxValue, required this.clientName, }); }
class ProjectDetailsScreen extends StatelessWidget { final Project project;
ProjectDetailsScreen({required this.project});
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Detalhes do Projeto'), ), body: Padding( padding: EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( project.title, style: TextStyle( fontSize: 24.0, fontWeight: FontWeight.bold, ), ), SizedBox(height: 8.0), Text('Descrição: ${project.description}'), Text('Prazo: ${project.deadline}'), Text('Valor Mínimo: ${project.minValue}'), Text('Valor Máximo: ${project.maxValue}'), Text('Nome do Cliente: ${project.clientName}'), SizedBox(height: 16.0), ElevatedButton( onPressed: () { _showProposalDialog(context); }, child: Text('Fazer Proposta'), ), ], ), ), ); }
void _showProposalDialog(BuildContext context) { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( title: Text('Enviar Proposta'), content: Column( mainAxisSize: MainAxisSize.min, children: [ TextField( decoration: InputDecoration( hintText: 'Nome da Empresa:', ), ), TextField( decoration: InputDecoration( hintText: 'Email:', ), ), TextField( decoration: InputDecoration( hintText: 'Número de Telefone:', ), ), TextField( decoration: InputDecoration( hintText: 'Valor da Proposta:', ), ), ], ), actions: [ ElevatedButton( onPressed: () { // Lógica para enviar proposta Navigator.of(context).pop(); }, child: Text('Enviar'), ), ], ); } ); } }
List
AFAZERES: