[text] dihan

Viewer

  1. Scaffold(
  2.         backgroundColor: AppColors.light.mainBgColor,
  3.         appBar: AppBar(
  4.           backgroundColor: Theme.of(context).primaryColor,
  5.           elevation: 0,
  6.           title: Text(
  7.             "Connection Report",
  8.             style: Get.textTheme.titleLarge!.copyWith(
  9.               color: Colors.white,
  10.             ),
  11.           ),
  12.           iconTheme: const IconThemeData(color: Colors.white),
  13.         ),
  14.         body: Column(
  15.           children: [
  16.             Expanded(
  17.               child: Stack(
  18.                 // fit: StackFit.expand,
  19.                 children: [
  20.                   SizedBox(
  21.                     height: Get.height,
  22.                     width: Get.width,
  23.                     child: Column(
  24.                       children: [
  25.                         Expanded(
  26.                           // flex: 1,
  27.                           child: Container(
  28.                             width: Get.width,
  29.                             color: Theme.of(context).primaryColor,
  30.                             // color: Colors.red,
  31.                           ),
  32.                         ),
  33.                         Expanded(
  34.                           flex: 5,
  35.                           child: Container(
  36.                             width: Get.width,
  37.                             // color: Colors.amber,
  38.                           ),
  39.                         )
  40.                       ],
  41.                     ),
  42.                   ),
  43.                   SingleChildScrollView(
  44.                     child: Container(
  45.                       // color: Colors.red,
  46.                       // height: Get.height,
  47.                       child: Column(
  48.                         mainAxisSize: MainAxisSize.min,
  49.                         children: [
  50.                           Container(
  51.                             alignment: Alignment.center,
  52.                             padding:
  53.                                 const EdgeInsets.symmetric(horizontal: 20.0),
  54.                             margin: const EdgeInsets.only(
  55.                                 top: 20.0, left: 24.0, right: 24.0),
  56.                             width: double.infinity,
  57.                             height: 140.0,
  58.                             decoration: BoxDecoration(
  59.                               color: Colors.white,
  60.                               borderRadius: BorderRadius.circular(10.0),
  61.                               image: const DecorationImage(
  62.                                 image: AssetImage(
  63.                                   "assets/world_map.png",
  64.                                 ),
  65.                                 opacity: 0.15,
  66.                                 fit: BoxFit.cover,
  67.                               ),
  68.                               boxShadow: [
  69.                                 BoxShadow(
  70.                                   color: Colors.grey.withOpacity(0.2),
  71.                                   spreadRadius: 1,
  72.                                   blurRadius: 5,
  73.                                   offset: const Offset(
  74.                                       0, 3), // changes position of shadow
  75.                                 ),
  76.                               ],
  77.                             ),
  78.                             child: Row(
  79.                               mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  80.                               children: [
  81.                                 Expanded(
  82.                                   child: _ConnectionSumIcon(
  83.                                     icon: AppAssets.light.icons.locationFill,
  84.                                     title: controller.routeArguments.vpnConfig
  85.                                             ?.location ??
  86.                                         "Unknown",
  87.                                     subtitle: controller
  88.                                             .routeArguments.vpnConfig?.ip ??
  89.                                         "Unknown",
  90.                                   ),
  91.                                 ),
  92.                                 Expanded(
  93.                                   child: _ConnectionSumIcon(
  94.                                     icon: AppAssets.light.icons.clockFill,
  95.                                     title: "Duration",
  96.                                     subtitle: controller.showUsedTime,
  97.                                     // "${DateTime.parse(controller.routeArguments.transferReport!.duration!).difference(DateTime.now()).inMinutes.abs().toString()} Minutes" ?? "Null",
  98.                                   ),
  99.                                 ),
  100.                                 Expanded(
  101.                                   child: _ConnectionSumIcon(
  102.                                     icon: AppAssets.light.icons.dataFill,
  103.                                     title: "Data Used",
  104.                                     subtitle: controller.routeArguments
  105.                                             .transferReport?.mbIn ??
  106.                                         "--",
  107.                                   ),
  108.                                 ),
  109.                               ],
  110.                             ),
  111.                           ),
  112.                           const SizedBox(height: 5),
  113.                           if (Platform.isAndroid)
  114.                             RateUsBox(
  115.                               onRateUsTap: () {
  116.                                 controller.rateUsToPlayStore();
  117.                               },
  118.                             ),
  119.                           const SizedBox(height: 5),
  120.                           Obx(() {
  121.                             // if (controller.isFeedbackSubmitted == false)
  122.                             print(controller.isFeedbackSubmitted);
  123.                             return Padding(
  124.                               padding:
  125.                                   const EdgeInsets.symmetric(horizontal: 20.0),
  126.                               child: AnimatedCrossFade(
  127.                                   duration: const Duration(milliseconds: 200),
  128.                                   crossFadeState:
  129.                                       !controller.isFeedbackSubmitted
  130.                                           ? CrossFadeState.showFirst
  131.                                           : CrossFadeState.showSecond,
  132.                                   firstChild: Column(
  133.                                     children: [
  134.                                       Text("How was this experience?",
  135.                                           style: Get.textTheme.titleSmall!
  136.                                               .copyWith(
  137.                                             color:
  138.                                                 Theme.of(context).primaryColor,
  139.                                             fontSize: 16,
  140.                                             fontWeight: FontWeight.bold,
  141.                                           )),
  142.                                       const SizedBox(height: 5),
  143.                                       Text(
  144.                                         "Leave us a thumbs up or thumbs down.",
  145.                                         style:
  146.                                             Get.textTheme.titleSmall!.copyWith(
  147.                                           color: Theme.of(context).primaryColor,
  148.                                           fontSize: 12,
  149.                                         ),
  150.                                         textAlign: TextAlign.center,
  151.                                       ),
  152.                                       const SizedBox(height: 5),
  153.                                       Container(
  154.                                         height: 30,
  155.                                         child: Row(
  156.                                           mainAxisAlignment:
  157.                                               MainAxisAlignment.center,
  158.                                           children: [
  159.                                             AnimatedContainer(
  160.                                               duration: const Duration(
  161.                                                   milliseconds: 200),
  162.                                               width: controller
  163.                                                           .getSelectedFeedback ==
  164.                                                       "positive"
  165.                                                   ? 30
  166.                                                   : 22,
  167.                                               // height: isExpanded ? 30 : 22,
  168.                                               child: InkWell(
  169.                                                 onTap: () {
  170.                                                   controller.selectedFeedback
  171.                                                       .value = "positive";
  172.                                                 },
  173.                                                 borderRadius:
  174.                                                     BorderRadius.circular(20),
  175.                                                 child: Image.asset(
  176.                                                   "assets/graphics/light/icons/feedback_like.png",
  177.                                                   // width: 22,
  178.                                                 ),
  179.                                               ),
  180.                                             ),
  181.                                             const SizedBox(width: 20),
  182.                                             AnimatedContainer(
  183.                                               duration: const Duration(
  184.                                                   milliseconds: 200),
  185.                                               width: controller
  186.                                                           .getSelectedFeedback ==
  187.                                                       "negative"
  188.                                                   ? 30
  189.                                                   : 20,
  190.                                               child: InkWell(
  191.                                                 onTap: () {
  192.                                                   controller.selectedFeedback
  193.                                                       .value = "negative";
  194.                                                 },
  195.                                                 radius: 20,
  196.                                                 child: Image.asset(
  197.                                                   "assets/graphics/light/icons/feedback_dislike.png",
  198.                                                   // width: 22,
  199.                                                 ),
  200.                                               ),
  201.                                             ),
  202.                                           ],
  203.                                         ),
  204.                                       ),
  205.                                       const SizedBox(height: 5),
  206.                                       TextFormField(
  207.                                         // controller: controller.feedbackController,
  208.                                         onChanged: (value) {
  209.                                           controller.feedbackText.value = value;
  210.                                         },
  211.                                         maxLines: 4,
  212.                                         decoration: InputDecoration(
  213.                                           hintText: "Leave a feedback",
  214.                                           hintStyle: Get.textTheme.titleSmall!
  215.                                               .copyWith(
  216.                                             color: Colors.black54,
  217.                                             fontSize: 12,
  218.                                           ),
  219.                                           border: OutlineInputBorder(
  220.                                             borderRadius:
  221.                                                 BorderRadius.circular(10),
  222.                                           ),
  223.                                         ),
  224.                                       ),
  225.                                       const SizedBox(height: 5),
  226.                                       ElevatedButton(
  227.                                         onPressed: () {
  228.                                           controller
  229.                                               .submitUserFeedback(context);
  230.                                         },
  231.                                         style: ElevatedButton.styleFrom(
  232.                                           elevation: 1,
  233.                                           backgroundColor:
  234.                                               Theme.of(context).primaryColor,
  235.                                           shape: RoundedRectangleBorder(
  236.                                             borderRadius:
  237.                                                 BorderRadius.circular(10),
  238.                                           ),
  239.                                         ),
  240.                                         child: const Text("Send Feedback",
  241.                                             style: TextStyle(
  242.                                               color: Colors.white,
  243.                                               fontSize: 12,
  244.                                             )),
  245.                                       ),
  246.                                     ],
  247.                                   ),
  248.                                   secondChild: Column(
  249.                                     // crossAxisAlignment: CrossAxisAlignment.center,
  250.                                     children: [
  251.                                       Container(
  252.                                         height: 150,
  253.                                         child: AnimatedContainer(
  254.                                             duration: const Duration(
  255.                                                 milliseconds: 500),
  256.                                             width:
  257.                                                 controller.isFeedbackSubmitted
  258.                                                     ? 100
  259.                                                     : 20,
  260.                                             height:
  261.                                                 controller.isFeedbackSubmitted
  262.                                                     ? 100
  263.                                                     : 20,
  264.                                             // Expanded width
  265.                                             // height: 30,
  266.                                             child: controller
  267.                                                         .getSelectedFeedback ==
  268.                                                     "positive"
  269.                                                 ? Image.asset(
  270.                                                     "assets/graphics/light/icons/feedback_like.png",
  271.                                                     // width: 30,
  272.                                                   )
  273.                                                 : Image.asset(
  274.                                                     "assets/graphics/light/icons/feedback_dislike.png",
  275.                                                     // width: 30,
  276.                                                   )),
  277.                                       ),
  278.                                       const SizedBox(height: 5),
  279.                                       Text(
  280.                                         controller.getFeedbackResponseText,
  281.                                         textAlign: TextAlign.center,
  282.                                         style:
  283.                                             Get.textTheme.titleSmall!.copyWith(
  284.                                           color: Theme.of(context).primaryColor,
  285.                                           fontSize: 12,
  286.                                         ),
  287.                                       ),
  288.                                     ],
  289.                                   )),
  290.                             );
  291.                           }),
  292.                           // const Spacer(),
  293.                           // if (!controller.routeArguments.shouldShowAd)
  294.                         ],
  295.                       ),
  296.                     ),
  297.                   ),
  298.                 ],
  299.               ),
  300.             ),
  301.           ],
  302.         ),
  303.       ),

Editor

You can edit this paste and save as new: