Skip to content

iOS: Switching "24-hour time" setting requires restart of app #13703

Closed

Description

@goderbauer

Changing the 24-hour setting on iOS requires a restart of a Flutter app to be respected. Native apps seem to respond to the change without requiring a restart (see Google Calendar for example).

/cc @yjbanov

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    a: internationalizationSupporting other languages or locales. (aka i18n)
    a: fidelityMatching the OEM platforms better
    on May 22, 2018
  2. added this to the milestone on May 22, 2018
  3. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  4. removed this from the milestone on Aug 17, 2020
  5. TahaTesser commented on Sep 7, 2020

    @TahaTesser
    Contributor
    code sample
    import 'package:flutter/material.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          title: 'Material App',
          theme: ThemeData.dark(),
          home: Home(),
        );
      }
    }
    
    class Home extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        final value = MediaQueryData.fromWindow(WidgetsBinding.instance.window)
            .alwaysUse24HourFormat;
    
        return Scaffold(
          appBar: AppBar(
            title: Text('Material App Bar'),
          ),
          body: Center(
            child: Container(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Text(
                    'MediaQueryData.fromWindow(WidgetsBinding.instance.window).alwaysUse24HourFormat',
                    textAlign: TextAlign.center,
                  ),
                  Text(value.toString()),
                ],
              ),
            ),
          ),
          floatingActionButton: FloatingActionButton(
            child: Icon(Icons.add),
            onPressed: () {},
          ),
        );
      }
    }
    
    flutter doctor -v
    [✓] Flutter (Channel master, 1.22.0-10.0.pre.87, on Mac OS X 10.15.6 19G2021,
        locale en-GB)
        • Flutter version 1.22.0-10.0.pre.87 at
          /Users/tahatesser/Code/flutter_master
        • Framework revision 4732a214a7 (3 days ago), 2020-09-04 21:05:02 -0400
        • Engine revision ac8b9c4c52
        • Dart version 2.10.0 (build 2.10.0-86.0.dev)
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/tahatesser/Code/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 11.7)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.7, Build version 11E801a
        • CocoaPods version 1.9.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 49.0.2
        • Dart plugin version 193.7547
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.48.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.14.1
    
    [✓] Connected device (3 available)
        • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios            • iOS
          13.7
        • Web Server (web)       • web-server                • web-javascript •
          Flutter Tools
        • Chrome (web)           • chrome                    • web-javascript •
          Google Chrome 85.0.4183.83
    
    • No issues found!
    
    
  6. GaryQian commented on Oct 19, 2020

    @GaryQian
    Contributor

    I will close this as it is very close to #12531 Which addresses the more general issue of updating on timezone/time format changes.

  7. github-actions commented on Aug 11, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: internationalizationSupporting other languages or locales. (aka i18n)engineflutter/engine related. See also e: labels.f: date/time pickerDate or time picker widgetsfound in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions