This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on handleNameRestrictions(theText) | |
set theNewText to theText | |
set firstCharacter to text 1 of theText | |
if isNumber(firstCharacter) then | |
set theNewText to "number" & theText | |
end if | |
return convertReservedKeywords(theNewText) | |
end handleNameRestrictions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on toCamelCase(theText) | |
set theNewText to "" | |
set dotIsFound to false | |
repeat with aCharacter in theText | |
if (aCharacter as string) is equal to "." then | |
set dotIsFound to true | |
else | |
if dotIsFound then | |
set theNewText to (theNewText & toCapitalized(aCharacter)) as string | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activate application "SF Symbols" | |
tell application "System Events" | |
tell process "SF Symbols" | |
-- Click the “list” radio button. | |
click radio button 2 of radio group 1 of group 3 of toolbar 1 of window 0 | |
tell outline 1 of scroll area 1 of splitter group 1 of window 0 | |
select (row 1 where value of static text 1 of UI element 1 starts with "All") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) | |
public extension Image { | |
/// Creates an image object containing a system symbol image. | |
/// | |
/// - Parameter sfSymbol: The name of the `SFSymbol` | |
/// - Usage | |
/// ``` | |
/// Image(sfSymbol: .checkmarkCircleFill) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@available(iOS 13.0, *) | |
public extension UIImage { | |
/// Creates an image object containing a system symbol image. | |
/// | |
/// - Parameter sfSymbol: The name of the `SFSymbol` | |
/// - Usage | |
/// ``` | |
/// UIImage(sfSymbol: .checkmarkCircleFill) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return | |
Padding( | |
padding: const EdgeInsets.all(16), | |
child: Text('Hello, World!', style: Theme.of(context).textTheme.headline4) | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension WidgetModifier on Widget { | |
Widget padding([EdgeInsetsGeometry value = const EdgeInsets.all(16)]) { | |
return Padding( | |
padding: value, | |
child: this, | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Text('Hello, World!', style: Theme.of(context).textTheme.headline4) | |
.padding(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension WidgetModifier on Widget { | |
// ... | |
Widget background(Color color) { | |
return DecoratedBox( | |
decoration: BoxDecoration( | |
color: color, | |
), | |
child: this, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class Section { | |
final GlobalKey key; | |
final String title; | |
final String body; | |
const Section(this.key, this.title, this.body); | |
} |