import 'package:caraka/global_utils/info_utils/lang/app_localization.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class Deskripsi extends StatelessWidget { final Color warna; final String thumbnail; final String judul; final String deskripsi; final String search; const Deskripsi( {required this.warna, required this.thumbnail, required this.judul, required this.deskripsi, required this.search}); @override Widget build(BuildContext context) { final penerjemah = context.watch(); return Scaffold( appBar: PreferredSize( preferredSize: const Size.fromHeight(0), child: AppBar( backgroundColor: const Color(0xFFF00000), )), backgroundColor: const Color(0xFFFF0000), body: Stack( children: [ Column( children: [ Container( height: 120, width: MediaQuery.of(context).size.width, color: const Color(0xFFFF0000), ), Expanded( child: Container( width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20)), ), ), ) ], ), Padding( padding: const EdgeInsets.only(left: 20.0, right: 20.0), child: Column( children: [ Align( alignment: Alignment.topCenter, child: Padding( padding: const EdgeInsets.only(top: 56.0), child: Container( height: 133, width: MediaQuery.of(context).size.width, decoration: BoxDecoration( color: warna, borderRadius: BorderRadius.circular(16)), child: Padding( padding: const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ IconButton( onPressed: () { Navigator.pop(context); }, icon: Icon( Icons.navigate_before, color: Colors.white, ) ), Image.asset( thumbnail, width: 72, height: 72, ), const SizedBox( width: 10, ), Text( judul, style: TextStyle( fontSize: 20, fontWeight: FontWeight.w900, color: Colors.white), ), const SizedBox( width: 30, ), ], ), ), ), ), ), SizedBox(height: 24), Container( padding: EdgeInsets.all(24), height: 160, width: MediaQuery.of(context).size.width, decoration: BoxDecoration( color: warna, borderRadius: BorderRadius.circular(16), boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.25), blurRadius: 4, spreadRadius: 0, offset: const Offset(0, 4)) ], ), child: Text( deskripsi, textAlign: TextAlign.justify, style: TextStyle( fontSize: 12, fontWeight: FontWeight.normal, color: Colors.white), ), ), SizedBox( height: 20, ), SizedBox( height: 36, width: MediaQuery.of(context).size.width, child: ElevatedButton( onPressed: () { Navigator.pushNamed(context, search); }, style: ElevatedButton.styleFrom( backgroundColor: Color(0xFFFF00000), foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8))), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.search), SizedBox( width: 10, ), Text(penerjemah.translate('tomboldeskripsi')), ], )), ), ], ), ), ], ), ); } }