Skip to content

Instantly share code, notes, and snippets.

@MaherSafadii
MaherSafadii / new_ios_ui.dart
Created March 14, 2025 20:50
iOS 19 leaks inspired UI in Flutter
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ios_19_example/new_ios_ui.dart';
void main() {
runApp(const MainApp());
}
@MaherSafadii
MaherSafadii / notes.txt
Last active February 14, 2025 15:43
Cupertino fidelity notes
1. The new CupertinoSliverNavigationbar.search searchfield bar has incorrect horizontal padding and placement.
2. The Cupertino wheel picker doesn't have the fade out effect for the items when they go out of view like with native.
3. The Cupertino wheel picker doesn't make the native tick sound effect when the selected item is changed, i tried playing aroung once to try and fix it, turns out the tick sound is a system sound that you can play using the AudioToolBox (iOS framework), you play the sound by running udioServicesPlaySystemSoundWithCompletion(1157, nil), 1157 is the id of the system sound.
4. There isn't a proper up-to-date toolbar API, instead we only have just trailing and leading for Cupertino nav bars, on native there is a extensive API that allows you to specify that widgets location, including on the bottom of the screen not just the top navigation bar, since the bottom is also considered a toolbar.
5. Adding widgets to CupertinoNavigationBar's leading and trailing is a painful chore, on na
@MaherSafadii
MaherSafadii / flutter_cupertino_example.dart
Last active February 14, 2025 14:23
Flutter Cupertino Example
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:native_ios_dialog/native_ios_dialog.dart';
import 'package:pull_down_button/pull_down_button.dart';
ValueNotifier<Brightness> brightness = ValueNotifier(Brightness.light);
ValueNotifier<Color> accentColor = ValueNotifier(CupertinoColors.activeBlue);
void main() {
runApp(MainApp());
@MaherSafadii
MaherSafadii / cupertino_modal_sheet.dart
Created January 13, 2025 10:39
Flutter's official iOS 13 modal sheet
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
// Tween for animating a Cupertino sheet onto the screen.
//
@MaherSafadii
MaherSafadii / gist:1747777e35fe83726b99d78b6ae1187c
Created January 13, 2025 10:38
official_cupertino_modal_sheet
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
// Tween for animating a Cupertino sheet onto the screen.
//
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
// Offset from offscreen below to stopping below the top of the screen.
final Animatable<Offset> _kBottomUpTween = Tween<Offset>(
begin: const Offset(0.0, 1.0),
@MaherSafadii
MaherSafadii / gist:0393dd9593175e76816569b13028f1f8
Created October 31, 2024 10:46
SwiftUI Demo Config - Flutter replica
import 'package:cupertino_calendar_picker/cupertino_calendar_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const CupertinoApp(
localizationsDelegates: [
DefaultWidgetsLocalizations.delegate,
DefaultCupertinoLocalizations.delegate,
DefaultMaterialLocalizations.delegate,
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});