From e71038326c800416864886c20f8afbddba02dac9 Mon Sep 17 00:00:00 2001 From: jovi_013 Date: Thu, 3 Jun 2021 15:19:41 +0700 Subject: [PATCH 1/2] [REFACTOR] Remove duplicate & unused code --- lib/page/filter_fasilitas/add_kegiatan.dart | 37 ++++----------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/lib/page/filter_fasilitas/add_kegiatan.dart b/lib/page/filter_fasilitas/add_kegiatan.dart index c2012ac..907542b 100644 --- a/lib/page/filter_fasilitas/add_kegiatan.dart +++ b/lib/page/filter_fasilitas/add_kegiatan.dart @@ -16,7 +16,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:http_parser/http_parser.dart'; -import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:multi_image_picker/multi_image_picker.dart'; @@ -183,19 +182,9 @@ class _AddKegiatanState extends State { }); } - final picker = ImagePicker(); - // File _image; - - // Future _getCameraImage() async { - // final image = - // await picker.getImage(source: ImageSource.camera, imageQuality: 50); - // return File(image.path); - // } - Future pickImages() async { var resultList = []; - await _getStoragePermission(); - await _getCameraPermission(); + await _getPermission(); try { if (permissionGranted) { @@ -223,28 +212,16 @@ class _AddKegiatanState extends State { } } - Future _getStoragePermission() async { - if (await Permission.storage.request().isGranted) { - setState(() { - permissionGranted = true; - }); - } else if (await Permission.storage.request().isPermanentlyDenied) { - await openAppSettings(); - } else if (await Permission.storage.request().isDenied) { - setState(() { - permissionGranted = false; - }); - } - } - - Future _getCameraPermission() async { - if (await Permission.camera.request().isGranted) { + Future _getPermission() async { + var _camera = await Permission.storage.request(); + var _storage = await Permission.camera.request(); + if (_camera.isGranted && _storage.isGranted) { setState(() { permissionGranted = true; }); - } else if (await Permission.camera.request().isPermanentlyDenied) { + } else if (_camera.isPermanentlyDenied || _storage.isPermanentlyDenied) { await openAppSettings(); - } else if (await Permission.camera.request().isDenied) { + } else if (_camera.isDenied || _storage.isDenied) { setState(() { permissionGranted = false; }); -- GitLab From 2de786083ad38e31be3ce2b804d5e76c131226e6 Mon Sep 17 00:00:00 2001 From: jovi_013 Date: Sun, 6 Jun 2021 16:11:15 +0700 Subject: [PATCH 2/2] [REFACTOR] Bugfix --- lib/page/filter_fasilitas/kegiatan.dart | 2 +- .../postingan/detail_post_kegiatan.dart | 874 +++++++++--------- 2 files changed, 434 insertions(+), 442 deletions(-) diff --git a/lib/page/filter_fasilitas/kegiatan.dart b/lib/page/filter_fasilitas/kegiatan.dart index ded35a4..7a7ffe5 100644 --- a/lib/page/filter_fasilitas/kegiatan.dart +++ b/lib/page/filter_fasilitas/kegiatan.dart @@ -22,7 +22,7 @@ class _KegiatanState extends State { return InkWell( key: Key(widget.kegiatan.namaKegiatan), onTap: () { - Navigator.of(context).pushReplacement(MaterialPageRoute( + Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => DetailPostKegiatanPage( lokasi: widget.lokasi, kegiatan: KegiatanModel( diff --git a/lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart b/lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart index fba26d5..3aece39 100644 --- a/lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart +++ b/lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart @@ -24,8 +24,6 @@ import 'package:share/share.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; -import '../fasilitas.dart'; - class DetailPostKegiatanPage extends StatefulWidget { final Lokasi lokasi; final KegiatanModel kegiatan; @@ -53,248 +51,268 @@ class _DetailPostKegiatanPageState extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () => Navigator.of(context).pushReplacement(MaterialPageRoute( - builder: (BuildContext context) => Fasilitas( - lokasi: widget.lokasi, - ))), - child: Scaffold( - appBar: BisaGoAppBar( - title: widget.lokasi.name, - key: Key('appbar-text-${widget.lokasi.name}'), - actions: [ - InkWell( - onTap: () async { - final link = await DynamicLinksServiceRepository() - .createDynamicLinkForKegiatan( - widget.kegiatan.id, - widget.lokasi.placeId, - ); - await Share.share(ShareUtils.getFormattedMessageKegiatan( - widget.kegiatan, widget.lokasi, link)); - }, - child: const Padding( - padding: EdgeInsets.all(doubleSpace), - child: Icon(Icons.share), - ), + return Scaffold( + appBar: BisaGoAppBar( + title: widget.lokasi.name, + key: Key('appbar-text-${widget.lokasi.name}'), + actions: [ + InkWell( + onTap: () async { + final link = await DynamicLinksServiceRepository() + .createDynamicLinkForKegiatan( + widget.kegiatan.id, + widget.lokasi.placeId, + ); + await Share.share(ShareUtils.getFormattedMessageKegiatan( + widget.kegiatan, widget.lokasi, link)); + }, + child: const Padding( + padding: EdgeInsets.all(doubleSpace), + child: Icon(Icons.share), ), - ], - ), - body: SingleChildScrollView( - child: Column( - children: [ - Container( - key: const Key('Text Judul Kegiatan'), - margin: const EdgeInsets.symmetric( - vertical: 10.0, horizontal: 15.0), - alignment: Alignment.centerLeft, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: regularSpace), - Text( - '${widget.kegiatan.namaKegiatan}', - style: const TextStyle( - fontSize: 30, - fontWeight: FontWeight.w800, - letterSpacing: 0.3, - fontFamily: 'Muli', - ), + ), + ], + ), + body: SingleChildScrollView( + child: Column( + children: [ + Container( + key: const Key('Text Judul Kegiatan'), + margin: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 15.0), + alignment: Alignment.centerLeft, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: regularSpace), + Text( + '${widget.kegiatan.namaKegiatan}', + style: const TextStyle( + fontSize: 30, + fontWeight: FontWeight.w800, + letterSpacing: 0.3, + fontFamily: 'Muli', ), - Text( - 'oleh ${widget.kegiatan.penyelenggara}', - style: TextStyle(fontSize: 16), - textAlign: TextAlign.left, - ) - ], - ), + ), + Text( + 'oleh ${widget.kegiatan.penyelenggara}', + style: TextStyle(fontSize: 16), + textAlign: TextAlign.left, + ) + ], ), - // PopupMenuButton( - // key: const Key('Button Ubah Informasi'), - // elevation: 4.0, - // offset: const Offset(0.0, 40.0), - // itemBuilder: (BuildContext context) { - // final choices = ['Ubah Informasi']; - // return choices.map((String choice) { - // return PopupMenuItem( - // key: Key(choice), - // child: ElevatedButton( - // style: ButtonStyle( - // padding: MaterialStateProperty.all( - // EdgeInsets.symmetric( - // vertical: 0, horizontal: 0)), - // backgroundColor: - // MaterialStateProperty.all(Colors.white), - // foregroundColor: - // MaterialStateProperty.all(Colors.black), - // elevation: MaterialStateProperty.all(0)), - // onPressed: _updateInformasi, - // child: SizedBox( - // width: double.infinity, - // child: Text(choice), - // ), - // ), - // ); - // }).toList(); - // }, - // ), - ], - ), + ), + // PopupMenuButton( + // key: const Key('Button Ubah Informasi'), + // elevation: 4.0, + // offset: const Offset(0.0, 40.0), + // itemBuilder: (BuildContext context) { + // final choices = ['Ubah Informasi']; + // return choices.map((String choice) { + // return PopupMenuItem( + // key: Key(choice), + // child: ElevatedButton( + // style: ButtonStyle( + // padding: MaterialStateProperty.all( + // EdgeInsets.symmetric( + // vertical: 0, horizontal: 0)), + // backgroundColor: + // MaterialStateProperty.all(Colors.white), + // foregroundColor: + // MaterialStateProperty.all(Colors.black), + // elevation: MaterialStateProperty.all(0)), + // onPressed: _updateInformasi, + // child: SizedBox( + // width: double.infinity, + // child: Text(choice), + // ), + // ), + // ); + // }).toList(); + // }, + // ), + ], ), - Container( - margin: const EdgeInsets.all(doubleSpace), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 160, - child: CarouselSlider( - options: CarouselOptions( - aspectRatio: 1.0, - enlargeCenterPage: true, - enableInfiniteScroll: false, - initialPage: 0, - autoPlay: true, - ), - items: widget.kegiatan.images - .map((item) => Container( - child: Container( - child: ClipRRect( - borderRadius: BorderRadius.all( - Radius.circular(20)), - child: Stack( - children: [ - GestureDetector( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: - (context) => - KegiatanListImages( - widget.kegiatan.images, - widget.kegiatan.namaKegiatan - ), - ) - ); - }, - child: Image.network(item, fit: BoxFit.cover, width: 1000.0), - ), - Positioned( - bottom: 0.0, - left: 0.0, - right: 0.0, - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Color.fromARGB( - 200, 0, 0, 0), - Color.fromARGB(0, 0, 0, 0) - ], - begin: - Alignment.bottomCenter, - end: Alignment.topCenter, - ), + ), + Container( + margin: const EdgeInsets.all(doubleSpace), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 160, + child: CarouselSlider( + options: CarouselOptions( + aspectRatio: 1.0, + enlargeCenterPage: true, + enableInfiniteScroll: false, + initialPage: 0, + autoPlay: true, + ), + items: widget.kegiatan.images + .map((item) => Container( + child: Container( + child: ClipRRect( + borderRadius: BorderRadius.all( + Radius.circular(20)), + child: Stack( + children: [ + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: + (context) => + KegiatanListImages( + widget.kegiatan.images, + widget.kegiatan.namaKegiatan + ), + ) + ); + }, + child: Image.network(item, fit: BoxFit.cover, width: 1000.0), + ), + Positioned( + bottom: 0.0, + left: 0.0, + right: 0.0, + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Color.fromARGB( + 200, 0, 0, 0), + Color.fromARGB(0, 0, 0, 0) + ], + begin: + Alignment.bottomCenter, + end: Alignment.topCenter, ), - padding: EdgeInsets.symmetric( - vertical: 10.0, - horizontal: 20.0), - child: Text( - '#${widget.kegiatan.images.indexOf(item) + 1}', - style: TextStyle( - color: Colors.white, - fontSize: 20.0, - fontWeight: FontWeight.bold, - ), + ), + padding: EdgeInsets.symmetric( + vertical: 10.0, + horizontal: 20.0), + child: Text( + '#${widget.kegiatan.images.indexOf(item) + 1}', + style: TextStyle( + color: Colors.white, + fontSize: 20.0, + fontWeight: FontWeight.bold, ), ), ), - ], - )), - ), - )) - .toList(), - ), + ), + ], + )), + ), + )) + .toList(), ), - SizedBox(height: 10), - Container( - key: const Key('desc'), - padding: const EdgeInsets.all(doubleSpace), - margin: const EdgeInsets.symmetric(vertical: doubleSpace), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${widget.kegiatan.deskripsi}', - textAlign: TextAlign.justify, - style: const TextStyle(fontSize: 16), - key: const Key('Text Deskripsi Kegiatan'), - ), - SizedBox(height: 20), - Row( - children: [ - Icon( - Icons.calendar_today, - size: 20, - color: Colors.green, - ), - SizedBox(width: 15), - Text( - '${DateFormat('EEEEEE, dd MMM yyy').format(widget.kegiatan.timeStart)}', - style: TextStyle(fontSize: 16), - key: Key('Text Tanggal Pelaksanaan'), - ), - ], - ), - SizedBox(height: 15), - Row( - children: [ - Icon( - Icons.access_time, - size: 20, - color: Colors.green, - ), - SizedBox(width: 15), - Text( - '${DateFormat('HH:mm').format(widget.kegiatan.timeStart)}', - style: TextStyle(fontSize: 16), - key: Key('Text Waktu Pelaksanaan'), - ), - SizedBox(width: 3.0), - Text( - widget.kegiatan.zonaWaktu, - style: TextStyle(fontSize: 16), - key: Key('Text Zona Waktu Pelaksanaan'), - ) - ], - ), - Row( - children: [ - Icon( - Icons.call, - size: 20, - color: Colors.green, - ), - SizedBox(width: 15.0), - Text( - widget.kegiatan.namaKontak ?? '', - style: const TextStyle(fontSize: 16), - key: const Key('Text Nama Kontak Kegiatan'), + ), + SizedBox(height: 10), + Container( + key: const Key('desc'), + padding: const EdgeInsets.all(doubleSpace), + margin: const EdgeInsets.symmetric(vertical: doubleSpace), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${widget.kegiatan.deskripsi}', + textAlign: TextAlign.justify, + style: const TextStyle(fontSize: 16), + key: const Key('Text Deskripsi Kegiatan'), + ), + SizedBox(height: 20), + Row( + children: [ + Icon( + Icons.calendar_today, + size: 20, + color: Colors.green, + ), + SizedBox(width: 15), + Text( + '${DateFormat('EEEEEE, dd MMM yyy').format(widget.kegiatan.timeStart)}', + style: TextStyle(fontSize: 16), + key: Key('Text Tanggal Pelaksanaan'), + ), + ], + ), + SizedBox(height: 15), + Row( + children: [ + Icon( + Icons.access_time, + size: 20, + color: Colors.green, + ), + SizedBox(width: 15), + Text( + '${DateFormat('HH:mm').format(widget.kegiatan.timeStart)}', + style: TextStyle(fontSize: 16), + key: Key('Text Waktu Pelaksanaan'), + ), + SizedBox(width: 3.0), + Text( + widget.kegiatan.zonaWaktu, + style: TextStyle(fontSize: 16), + key: Key('Text Zona Waktu Pelaksanaan'), + ) + ], + ), + Row( + children: [ + Icon( + Icons.call, + size: 20, + color: Colors.green, + ), + SizedBox(width: 15.0), + Text( + widget.kegiatan.namaKontak ?? '', + style: const TextStyle(fontSize: 16), + key: const Key('Text Nama Kontak Kegiatan'), + ), + TextButton( + key: Key('Text Nomor Kontak Kegiatan'), + onPressed: () => setState(() { + _makePhoneCall('tel:${widget.kegiatan.nomorKontak}'); + }), + child: Text( + widget.kegiatan.nomorKontak ?? '', + style: TextStyle( + fontSize: 16, + color: Colors.green, + ), + key: Key('Text Link'), ), - TextButton( - key: Key('Text Nomor Kontak Kegiatan'), + ), + ], + ), + Row( + children: [ + Icon( + Icons.language, + size: 20, + color: Colors.green, + ), + SizedBox(width: 7.0), + Expanded( + child: TextButton( + key: const Key('Text Link Kegiatan'), onPressed: () => setState(() { - _makePhoneCall('tel:${widget.kegiatan.nomorKontak}'); + _launchInBrowser(widget.kegiatan.links); }), child: Text( - widget.kegiatan.nomorKontak ?? '', + widget.kegiatan.links ?? '', style: TextStyle( fontSize: 16, color: Colors.green, @@ -302,231 +320,205 @@ class _DetailPostKegiatanPageState extends State { key: Key('Text Link'), ), ), - ], - ), - Row( - children: [ - Icon( - Icons.language, - size: 20, - color: Colors.green, - ), - SizedBox(width: 7.0), - Expanded( - child: TextButton( - key: const Key('Text Link Kegiatan'), - onPressed: () => setState(() { - _launchInBrowser(widget.kegiatan.links); - }), - child: Text( - widget.kegiatan.links ?? '', - style: TextStyle( - fontSize: 16, - color: Colors.green, - ), - key: Key('Text Link'), - ), - ), - ), - ], - ), - ], - ), - // ), - // ], - // ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - 'informasi ditambahkan oleh ', - style: TextStyle( - fontSize: 12, - fontStyle: FontStyle.italic, - fontWeight: FontWeight.w200, - ), - ), - Container( - padding: EdgeInsets.zero, - constraints: BoxConstraints( - maxWidth: - MediaQuery.of(context).size.width * 0.3), - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => Profile( - email: widget.kegiatan.creatorEmail, - isPublic: true))); - }, - child: Text( - '${widget.kegiatan.creator}', - key: Key('creator-${widget.kegiatan.creator}'), - overflow: TextOverflow.fade, - softWrap: false, - style: const TextStyle( - fontSize: 12, - fontStyle: FontStyle.italic, - ), ), - ), + ], ), - // Text( - // '(${DateFormat('dd MMM yyy').format(widget.kegiatan.created)})', // ganti format (${DateFormat('dd MMM yyy').format(widget.x.dateTime)}) - // key: const Key('timestamp'), - // style: const TextStyle( - // fontSize: 12, - // fontStyle: FontStyle.italic, - // ), - // ), ], ), - SizedBox(height: regularSpace), - Divider( - color: grayPrimary, - thickness: 1.0, - ), - Container( - key: const Key('Komentar'), - padding: - const EdgeInsets.symmetric(vertical: regularSpace), - child: const Text( - 'Komentar', + // ), + // ], + // ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + 'informasi ditambahkan oleh ', style: TextStyle( - fontSize: 20, fontWeight: FontWeight.w800), + fontSize: 12, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w200, + ), + ), + Container( + padding: EdgeInsets.zero, + constraints: BoxConstraints( + maxWidth: + MediaQuery.of(context).size.width * 0.3), + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => Profile( + email: widget.kegiatan.creatorEmail, + isPublic: true))); + }, + child: Text( + '${widget.kegiatan.creator}', + key: Key('creator-${widget.kegiatan.creator}'), + overflow: TextOverflow.fade, + softWrap: false, + style: const TextStyle( + fontSize: 12, + fontStyle: FontStyle.italic, + ), + ), + ), ), + // Text( + // '(${DateFormat('dd MMM yyy').format(widget.kegiatan.created)})', // ganti format (${DateFormat('dd MMM yyy').format(widget.x.dateTime)}) + // key: const Key('timestamp'), + // style: const TextStyle( + // fontSize: 12, + // fontStyle: FontStyle.italic, + // ), + // ), + ], + ), + SizedBox(height: regularSpace), + Divider( + color: grayPrimary, + thickness: 1.0, + ), + Container( + key: const Key('Komentar'), + padding: + const EdgeInsets.symmetric(vertical: regularSpace), + child: const Text( + 'Komentar', + style: TextStyle( + fontSize: 20, fontWeight: FontWeight.w800), ), - StreamBuilder( - stream: _bloc.komentarPostingKegiatanListStream, - builder: (context, snapshot) { - if (snapshot.hasData) { - switch (snapshot.data.status) { - case Status.loading: + ), + StreamBuilder( + stream: _bloc.komentarPostingKegiatanListStream, + builder: (context, snapshot) { + if (snapshot.hasData) { + switch (snapshot.data.status) { + case Status.loading: + return const Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + greenPrimary), + ), + ); + break; + case Status.completed: + allKomentarPositngKegiatanFromApi = + snapshot.data.data.allKomentarKegiatan; + if (allKomentarPositngKegiatanFromApi.isEmpty) { return const Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - greenPrimary), - ), - ); - break; - case Status.completed: - allKomentarPositngKegiatanFromApi = - snapshot.data.data.allKomentarKegiatan; - if (allKomentarPositngKegiatanFromApi.isEmpty) { - return const Center( - child: Text('Tidak ada komentar')); - } else { - return Column( - children: - allKomentarPositngKegiatanFromApi - .map((k) => - komentarKegiatanPlaceHolder( - k.creator, - k.creatorEmail, - k.creatorPicture, - k.created, - k.deskripsi)) - .toList()); - } - break; - case Status.error: - return Center( - child: Text(snapshot.data.data.toString()), - ); - break; - } + child: Text('Tidak ada komentar')); + } else { + return Column( + children: + allKomentarPositngKegiatanFromApi + .map((k) => + komentarKegiatanPlaceHolder( + k.creator, + k.creatorEmail, + k.creatorPicture, + k.created, + k.deskripsi)) + .toList()); + } + break; + case Status.error: + return Center( + child: Text(snapshot.data.data.toString()), + ); + break; } - return Container(); - }), - const SizedBox(height: regularSpace), - Form( - key: _formKey, - child: Column( - children: [ - TextFormField( - key: const Key('Text Field Komentar'), - keyboardType: TextInputType.multiline, - maxLines: null, - minLines: 3, - validator: FieldValidator.validateInfo, - controller: komentarKegiatanController, - style: const TextStyle( - fontSize: 18, - ), - decoration: InputDecoration( - hintStyle: const TextStyle( - fontWeight: FontWeight.bold, fontSize: 15), - hintText: 'Tulis komentar...', - contentPadding: const EdgeInsets.all(8.0), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: BorderSide( - color: Theme.of(context).primaryColor, - ), + } + return Container(); + }), + const SizedBox(height: regularSpace), + Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + key: const Key('Text Field Komentar'), + keyboardType: TextInputType.multiline, + maxLines: null, + minLines: 3, + validator: FieldValidator.validateInfo, + controller: komentarKegiatanController, + style: const TextStyle( + fontSize: 18, + ), + decoration: InputDecoration( + hintStyle: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 15), + hintText: 'Tulis komentar...', + contentPadding: const EdgeInsets.all(8.0), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: Theme.of(context).primaryColor, ), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: BorderSide( - color: Theme.of(context).primaryColor, - ), + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: Theme.of(context).primaryColor, ), ), ), - Container( - key: const Key('Tambah Komentar'), - padding: - const EdgeInsets.only(top: doubleSpace), - alignment: Alignment.center, - child: ButtonTheme( - minWidth: double.infinity, - height: 40, - child: ElevatedButton( - key: const Key('Button Tambah Komentar'), - style: ButtonStyle( - padding: MaterialStateProperty.all( - EdgeInsets.symmetric(vertical: 13)), - elevation: MaterialStateProperty.all(0.0), - backgroundColor: - MaterialStateProperty.all( - greenPrimary), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(10)))), - ), - onPressed: () { - _checkLoginStatus(); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - const Icon( - Icons.add, - size: 30, - color: Colors.white, - ), - const SizedBox(width: 5.0), - const Text( - 'Tambah Komentar', - style: TextStyle( - fontSize: 20, - color: Colors.white, - fontWeight: FontWeight.bold), - ), - ], - ), + ), + Container( + key: const Key('Tambah Komentar'), + padding: + const EdgeInsets.only(top: doubleSpace), + alignment: Alignment.center, + child: ButtonTheme( + minWidth: double.infinity, + height: 40, + child: ElevatedButton( + key: const Key('Button Tambah Komentar'), + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.symmetric(vertical: 13)), + elevation: MaterialStateProperty.all(0.0), + backgroundColor: + MaterialStateProperty.all( + greenPrimary), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(10)))), ), - )), - ], - )), - ], - ), + onPressed: () { + _checkLoginStatus(); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Icon( + Icons.add, + size: 30, + color: Colors.white, + ), + const SizedBox(width: 5.0), + const Text( + 'Tambah Komentar', + style: TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.bold), + ), + ], + ), + ), + )), + ], + )), + ], ), - ], - ), + ), + ], ), ), ); -- GitLab