iphone – flutter ios – web page change to gray when in launch mode


I skilled that on my display some parts turned grey after I modified them to launch mode in xcode, however when utilizing debug mode within the emulator it was nonetheless protected
like this

however after I use launch mode it turns into grey like under
like this

I’ve a problem with the next code:

import 'dart:developer';

import 'package deal:aad_oauth/aad_oauth.dart';
import 'package deal:aad_oauth/mannequin/config.dart';
import 'package deal:aad_oauth/mannequin/token.dart';
import 'package deal:badges/badges.dart';
import 'package deal:carousel_slider/carousel_slider.dart';
import 'package deal:flutter/basis.dart';
import 'package deal:flutter/materials.dart';
import 'package deal:flutter/src/basis/key.dart';
import 'package deal:flutter/src/widgets/framework.dart';
import 'package deal:flutter_html/flutter_html.dart';
import 'package deal:flutter_secure_storage/flutter_secure_storage.dart';
import 'package deal:get/get.dart';
import 'package deal:launcher_apps/api/model_exchange_rate_api.dart';
import 'package deal:launcher_apps/api/model_gold_silver_price_api.dart';
import 'package deal:launcher_apps/api/_model_list_app_api.dart';
import 'package deal:launcher_apps/api/api_service.dart';
import 'package deal:launcher_apps/api/model_slide_announce_api.dart';
import 'package deal:launcher_apps/api/model_url_app_category_app.dart';
import 'package deal:launcher_apps/api/model_url_banner_api.dart';
import 'package deal:launcher_apps/api/model_url_safety_api.dart';
import 'package deal:launcher_apps/login.dart';
import 'package deal:launcher_apps/most important.dart';
import 'package deal:launcher_apps/notifications.dart';
import 'package deal:launcher_apps/util/fixed.dart';
import 'package deal:launcher_apps/widget/app_category.dart';
import 'package deal:marquee/marquee.dart';
import 'package deal:intl/intl.dart';
import 'package deal:showcaseview/showcaseview.dart';
import 'package deal:modal_bottom_sheet/modal_bottom_sheet.dart';

import 'api/app_list.dart';
import 'package deal:shared_preferences/shared_preferences.dart';

class Residence extends StatefulWidget {
  remaining String title;
  var accessToken;
  String? propHasSeenShowcase;
  Residence({
    Key? key,
    required this.title,
    required this.accessToken,
    required this.propHasSeenShowcase
  }) : tremendous(key: key);

  @override
  State<Residence> createState() => _HomeState();
}

class _HomeState extends State<Residence> {

  Future checkFirstSeen() async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    bool _seen = (prefs.getBool('seen') ?? false);

    if (_seen) {
      WidgetsBinding.occasion.addPostFrameCallback(
        (_) => ShowCaseWidget.of(context)
            .dismiss(),
      );
    } else {
      await prefs.setBool('seen', true);
      WidgetsBinding.occasion.addPostFrameCallback(
        (_) => ShowCaseWidget.of(context)
            .startShowCase([_first, _second, _third, _fourth, _fifth, _six]),
      );
    }
  }

  remaining GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  remaining GlobalKey _first = GlobalKey();
  remaining GlobalKey _second = GlobalKey();
  remaining GlobalKey _third = GlobalKey();
  remaining GlobalKey _fourth = GlobalKey();
  remaining GlobalKey _fifth = GlobalKey();
  remaining GlobalKey _six = GlobalKey();
  static remaining Config config = Config(
    tenant: 'xxx',
    clientId: 'xxxx',
    scope: 'xxxxx',
    clientSecret: "xxxx",
    redirectUri: kIsWeb
        ? '
        : '
    navigatorKey: navigatorKey,
  );

  remaining AadOAuth oauth = AadOAuth(config);

  ModelGoldSilverPriceApi listGoldSilverPrice =
      ModelGoldSilverPriceApi(gold: [], silver: []);

  ModelExchangeRate listExchangeRate =
      ModelExchangeRate(knowledge: [], tanggalBerlaku: '');

  ModelUrlAppCategoryApi listUrlAppCategory = ModelUrlAppCategoryApi(knowledge: []);

  ModelUrlBannerApi listUrlBanner = ModelUrlBannerApi(knowledge: []);

  ModelUrlSafetyApi listUrlSafety = ModelUrlSafetyApi(knowledge: []);

  bool isLoading = false;
  // AppListHardcode appList = AppListHardcode();

  @override
  initState() {
    tremendous.initState();
      
    checkFirstSeen();
    _getDataGSPrice();
    _getDataEx();
    _getBanner();
    _getDataCat();
    _getDataSafety();
  }

  void _getDataGSPrice() async {
    listGoldSilverPrice = (await ApiServiceListApp().getGoldSilverPrice());
    setState(() {
      isLoading = true;
    });
    attempt {
      Future.delayed(const Period(seconds: 1)).then((worth) => setState(() {
            isLoading = false;
          }));
    } catch (e) {
      print(e);
    }
  }

  void _getDataEx() async {
    listExchangeRate = (await ApiServiceListApp().getModelExchangeRate());
    setState(() {
      isLoading = true;
    });
    attempt {
      Future.delayed(const Period(seconds: 1)).then((worth) => setState(() {
            isLoading = false;
          }));
    } catch (e) {
      print(e);
    }
  }

  void _getBanner() async {
    listUrlBanner = (await ApiServiceListApp().getListDataBanner());
    setState(() {
      isLoading = true;
    });
    attempt {
      Future.delayed(const Period(seconds: 1)).then((worth) => setState(() {
            isLoading = false;
          }));
    } catch (e) {
      print(e);
    }
  }

  void _getDataSafety() async {
    listUrlSafety = (await ApiServiceListApp().getListDataSafety());
    setState(() {
      isLoading = true;
    });
    attempt {
      Future.delayed(const Period(seconds: 1)).then((worth) => setState(() {
            isLoading = false;
          }));
    } catch (e) {
      print(e);
    }
  }

  void _getDataCat() async {
    listUrlAppCategory = (await ApiServiceListApp().getListDataCategory());
    setState(() {
      isLoading = true;
    });
    attempt {
      Future.delayed(const Period(seconds: 1)).then((worth) => setState(() {
            isLoading = false;
          }));
    } catch (e) {
      print(e);
    }
  }

  // Carousel
  remaining CarouselController _controller = CarouselController();
  String formatNumber(int quantity) {
    return NumberFormat.decimalPattern().format(quantity);
  }

  String formatDateToFull(String dateStr) {
    DateTime date = DateTime.tryParse(dateStr) ?? DateTime.now();
    String formattedDate = DateFormat('dd MMMM yyyy').format(date);
    return formattedDate;
  }

  // void afterFirstLayout(BuildContext context) => checkFirstSeen();

  @override
  Widget construct(BuildContext context) {
    DateTime now = DateTime.now();
    DateTime yesterday = now.subtract(const Period(days: 1));
    Checklist<CarouselItemData> carouselItems = [
      CarouselItemData(
          header:
              "Manhours LTI Free - ${listUrlBanner.data.isNotEmpty ? listUrlBanner.data[0].periode : 'Loading'} ${listUrlBanner.knowledge.isNotEmpty ? DateFormat('MMMM').format(DateTime(0, listUrlBanner.knowledge[0].month)) : ''} ${listUrlBanner.knowledge.isNotEmpty ? listUrlBanner.knowledge[0].yr : ''}",
          footer: "",
          worth:
              "PTAR : ${listUrlBanner.knowledge.isNotEmpty ? NumberFormat.decimalPattern().format(listUrlBanner.knowledge[0].ptar) : 'Loading'}"),
      CarouselItemData(
          header:
              "Manhours LTI Free - ${listUrlBanner.knowledge.isNotEmpty ? listUrlBanner.knowledge[0].periode : 'Loading'} ${listUrlBanner.knowledge.isNotEmpty ? DateFormat('MMMM').format(DateTime(0, listUrlBanner.knowledge[0].month)) : ''} ${listUrlBanner.knowledge.isNotEmpty ? listUrlBanner.knowledge[0].yr : ''}",
          footer: "",
          worth:
              "Contractors : ${listUrlBanner.knowledge.isNotEmpty ? NumberFormat.decimalPattern().format(listUrlBanner.knowledge[0].contractors) : 'Loading'}"),
      CarouselItemData(
          header:
              "Manhours LTI Free - ${listUrlBanner.knowledge.isNotEmpty ? listUrlBanner.knowledge[0].periode : 'Loading'} ${listUrlBanner.knowledge.isNotEmpty ? DateFormat('MMMM').format(DateTime(0, listUrlBanner.knowledge[0].month)) : ''} ${listUrlBanner.knowledge.isNotEmpty ? listUrlBanner.knowledge[0].yr : ''}",
          footer: "",
          worth:
              "Martabe Web site : ${listUrlBanner.knowledge.isNotEmpty ? NumberFormat.decimalPattern().format(listUrlBanner.knowledge[0].martabeSite) : 'Loading'}"),
      CarouselItemData(
          header: "Martabe Protected Days",
          footer:
              "Final LTI : ${listUrlSafety.knowledge.isNotEmpty ? DateFormat('dd MMMM yyyy').format(DateTime.parse(listUrlSafety.knowledge[0].lastLti)) : 'Loading'}",
          worth:
              "${listUrlSafety.knowledge.isNotEmpty ? NumberFormat.decimalPattern().format(listUrlSafety.knowledge[0].countDays) : 'Loading'} Days"),
    ];
    return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
        title: Textual content(widget.title),
        backgroundColor: COLOR_PRIMARY_BLUE,
        main: IconButton(
          icon: Picture.asset('property/photos/logo-atas.jpg'),
          onPressed: () {},
        ),
        actions: <Widget>[
          // InkWell(
          //   onTap: () {
          //     // setState(() {
          //     //   jmlNotif++;
          //     // });
          //     // showMaterialModalBottomSheet(
          //     //   context: context,
          //     //   builder: (context) => ModalNotifications(),
          //     // );
          //     // Navigator.push(context,
          //     //     MaterialPageRoute(builder: (context) => NotificationsUser()));

          //     Navigator.of(context).push(_routeNotifications());
          //   },
          //   child: Badge(
          //     badgeContent: Text("$jmlNotif"),
          //     position: BadgePosition.topEnd(top: 5, end: -8),
          //     badgeColor: COLOR_PRIMARY_GOLD,
          //     child: Icon(Icons.notifications),
          //   ),
          // ),
          Showcase(
            key: _first,
            title: 'Refresh',
            titleTextStyle: TextStyle(
                fontSize: 15,
                fontWeight: FontWeight.w700,
                color: COLOR_PRIMARY_BLUE),
            tooltipBackgroundColor: COLOR_PRIMARY_GOLD,
            textColor: Colors.white,
            targetShapeBorder: const CircleBorder(),
            description: 'Tap here to refresh page.',
            showArrow: true,
            targetBorderRadius: BorderRadius.all(
              Radius.circular(250),
            ),
            child: IconButton(
              icon: isLoading
                  ? const SizedBox(
                      width: 20,
                      height: 20,
                      child: CircularProgressIndicator(
                        valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
                      ),
                    )
                  : const Icon(
                      Icons.refresh,
                      color: Colors.white,
                    ),
              onPressed: () {
                setState(() {
                  _getDataGSPrice();
                  _getDataEx();
                  _getBanner();
                  _getDataCat();
                  _getDataSafety();
                });
              },
            ),
          ),
          Showcase(
              key: _second,
              title: 'Sign Out',
              titleTextStyle: TextStyle(
                  fontSize: 15,
                  fontWeight: FontWeight.w700,
                  color: COLOR_PRIMARY_BLUE),
              tooltipBackgroundColor: COLOR_PRIMARY_GOLD,
              textColor: Colors.white,
              targetShapeBorder: const CircleBorder(),
              showArrow: true,
              targetBorderRadius: BorderRadius.all(
                Radius.circular(250),
              ),
              description: 'Tap here to sign out.',
              child: IconButton(
                  icon: const Icon(
                    Icons.logout,
                    color: Colors.white,
                  ),
                  onPressed: () => showDialog(
                      context: context,
                      builder: (BuildContext context) => AlertDialog(
                            title: const Text('Are you sure want to sign out?'),
                            actions: [
                              TextButton(
                                onPressed: () =>
                                    Navigator.pop(context, 'Cancel'),
                                child: const Text(
                                  'Cancel',
                                  style: TextStyle(
                                    color: Color.fromARGB(255, 19, 67, 107),
                                  ),
                                ),
                              ),
                              TextButton(
                                onPressed: () => logout(),
                                child: const Text(
                                  'Yes',
                                  style: TextStyle(
                                    color: Color.fromARGB(255, 19, 67, 107),
                                  ),
                                ),
                              ),
                            ],
                          ))))
        ],
      ),
      physique: Column(
        kids: [
          const SizedBox(height: 10),
          Expanded(
            flex: 6,
            child: Showcase(
                key: _third,
                title: 'Slider',
                titleTextStyle: TextStyle(
                    fontSize: 15,
                    fontWeight: FontWeight.w700,
                    color: COLOR_PRIMARY_BLUE),
                tooltipBackgroundColor: COLOR_PRIMARY_GOLD,
                textColor: Colors.white,
                targetShapeBorder: const CircleBorder(),
                showArrow: true,
                targetBorderRadius: BorderRadius.all(
                  Radius.circular(20),
                ),
                description: 'Slide to view another information.',
                child: CarouselSlider(
                  options: CarouselOptions(
                    height: MediaQuery.of(context).size.height,
                    initialPage: 0,
                    enlargeCenterPage: false,
                    autoPlay: true,
                    autoPlayInterval: const Duration(seconds: 8),
                    autoPlayAnimationDuration:
                        const Duration(milliseconds: 800),
                    autoPlayCurve: Curves.fastOutSlowIn,
                  ),
                  items: carouselItems.map((text) {
                    return Builder(
                      builder: (BuildContext context) {
                        return Expanded(
                          child: Padding(
                            padding: const EdgeInsets.all(10.0),
                            child: Container(
                              padding: const EdgeInsets.all(4.0),
                              width: MediaQuery.of(context).size.width,
                              decoration: const BoxDecoration(
                                color: Color.fromARGB(255, 207, 160, 82),
                                borderRadius:
                                    BorderRadius.all(Radius.circular(8)),
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.grey,
                                    blurRadius: 2,
                                  )
                                ],
                              ),
                              youngster: Heart(
                                youngster: Column(
                                  mainAxisAlignment: MainAxisAlignment.heart,
                                  crossAxisAlignment: CrossAxisAlignment.heart,
                                  kids: [
                                    Text(
                                      text.header,
                                      style: const TextStyle(
                                        color: Colors.white,
                                        fontSize: 14.5,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                    const SizedBox(height: 8),
                                    Text(
                                      text.value,
                                      style: const TextStyle(
                                        color: Color.fromARGB(255, 19, 67, 107),
                                        fontSize: 21,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                    if (text.footer != "")
                                      Text(
                                        text.footer,
                                        style: const TextStyle(
                                          color: Colors.white,
                                          fontSize: 16,
                                          fontWeight: FontWeight.bold,
                                        ),
                                      ),
                                  ],
                                ),
                              ),
                            ),
                          ),
                        );
                      },
                    );
                  }).toList(),
                )),
          ),

          Expanded(
            flex: 2,
            youngster: Padding(
                padding: const EdgeInsets.all(10.0),
                youngster: Showcase(
                    key: _fourth,
                    title: 'Gold & Silver Worth',
                    titleTextStyle: TextStyle(
                        fontSize: 15,
                        fontWeight: FontWeight.w700,
                        coloration: COLOR_PRIMARY_BLUE),
                    tooltipBackgroundColor: COLOR_PRIMARY_GOLD,
                    textColor: Colours.white,
                    targetShapeBorder: const CircleBorder(),
                    showArrow: true,
                    targetBorderRadius: BorderRadius.all(
                      Radius.round(10),
                    ),
                    description:
                        'That is working textual content about gold & silver worth and international alternate charges.',
                    youngster: Marquee(
                      textual content:
                          "Gold : ${listGoldSilverPrice.gold.isNotEmpty ? '${listGoldSilverPrice.gold[0].worth} (${listGoldSilverPrice.gold[0].standing})' : 'Loading'} & Silver : ${listGoldSilverPrice.silver.isNotEmpty ? '${listGoldSilverPrice.silver[0].worth} (${listGoldSilverPrice.silver[0].standing})' : 'Loading'} (refers to goldprice.org) | USD/IDR : Rp. ${listExchangeRate.knowledge.size > 0 ? '${listExchangeRate.knowledge[0].harga} (${listExchangeRate.knowledge[0].standing})' : 'Loading'} | AUD/IDR : Rp. ${listExchangeRate.knowledge.size > 0 ? '${listExchangeRate.knowledge[1].harga} (${listExchangeRate.knowledge[1].standing})' : 'Loading'} | CAD/IDR : Rp. ${listExchangeRate.knowledge.size > 0 ? '${listExchangeRate.knowledge[2].harga} (${listExchangeRate.knowledge[2].standing})' : 'Loading'} | AUD/IDR : Rp. ${listExchangeRate.knowledge.size > 0 ? '${listExchangeRate.knowledge[3].harga} (${listExchangeRate.knowledge[3].standing})' : 'Loading'} (refers to Tax Charge with validity ${listExchangeRate.tanggalBerlaku}) ",

                      fashion: const TextStyle(
                          fontWeight: FontWeight.daring,
                          coloration: Colour.fromARGB(255, 19, 67, 107)),
                      // scrollAxis: Axis.horizontal,
                      // crossAxisAlignment: CrossAxisAlignment.begin,
                      blankSpace: 50.0,
                      velocity: 20.0,
                      // pauseAfterRound: Period(seconds: 0),
                      startPadding: 10.0,
                      accelerationDuration: Period(seconds: 1),
                      // accelerationCurve: Curves.linear,
                      decelerationDuration: Period(milliseconds: 1000),
                      // decelerationCurve: Curves.easeOut,
                    ))),
          ),

          // Checklist App
          Expanded(
              flex: 30,
              youngster: Padding(
                  padding: EdgeInsets.all(10.0),
                  youngster: listUrlAppCategory.knowledge.isEmpty
                      ? Container(
                          alignment: Alignment.heart,
                          peak: 50,
                          width: 50,
                          youngster: const CircularProgressIndicator(),
                        )
                      : AppCategory(
                          listUrlAppCategory: listUrlAppCategory,
                          numberKey: [_fifth,_six],
                        ))),
        ],
      ),
    );
  }

  Route _routeNotifications() {
    return PageRouteBuilder(
      pageBuilder: (context, animation, secondaryAnimation) =>
          const NotificationsUser(),
      transitionsBuilder: (context, animation, secondaryAnimation, youngster) {
        const start = Offset(0.0, 1.0);
        const finish = Offset.zero;
        const curve = Curves.ease;

        var tween =
            Tween(start: start, finish: finish).chain(CurveTween(curve: curve));

        return SlideTransition(
          place: animation.drive(tween),
          youngster: youngster,
        );
      },
    );
  }

  // ==================== baris operate dialog dan login/logout ====================

  void showError(dynamic ex) {
    showMessage(ex.toString());
  }

  void showMessage(String textual content) {
    var alert = AlertDialog(content material: Textual content(textual content), actions: <Widget>[
      TextButton(
          child: const Text('Ok'),
          onPressed: () {
            Future.delayed(Duration.zero, () {
              Navigator.pop(context);
            });
          })
    ]);
    showDialog(context: context, builder: (BuildContext context) => alert);
  }

  void logout() async {
    await oauth.logout();
    // showMessage('Logged out');

    setState(() {
      // perubahan setelah logout lakukan disini
      Navigator.of(context).pushReplacement(
        MaterialPageRoute(builder: (context) => LoginApp()),
      );
    });

    showDialog(
      context: context,
      builder: (c) => const AlertDialog(
        content material: Textual content('You at the moment are logged out'),
      ),
    );
  }
}

class CarouselItemData {
  remaining String header;
  remaining String footer;
  remaining String worth;

  CarouselItemData(
      {required this.header, required this.footer, required this.worth});
}

I’ve tried copying debug mode after which altering to launch however it nonetheless does not work

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles