-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merges main into casper/hostel_change
- Loading branch information
Showing
35 changed files
with
1,307 additions
and
517 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:appetizer/data/constants/env_config.dart'; | ||
import 'package:mixpanel_flutter/mixpanel_flutter.dart'; | ||
|
||
class MixpanelManager { | ||
static Mixpanel? instance; | ||
|
||
static Future<Mixpanel> init() async { | ||
instance ??= await Mixpanel.init(EnvironmentConfig.MIXPANEL_PROJECT_KEY, | ||
trackAutomaticEvents: true); | ||
return instance!; | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; | ||
import 'package:appetizer/presentation/components/app_textfield.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
|
||
class AppFormField extends StatelessWidget { | ||
const AppFormField({ | ||
super.key, | ||
required this.hintText, | ||
this.controller, | ||
this.onChanged, | ||
this.obscureText, | ||
this.suffix, | ||
this.border, | ||
required this.title, | ||
this.maxLength, | ||
this.maxLines, | ||
this.titleStyle, | ||
}) : assert( | ||
obscureText == null || suffix != null, | ||
'Suffix should be provided if obscureText is provided', | ||
), | ||
assert( | ||
controller != null || onChanged != null, | ||
'Either controller or onChanged should be provided', | ||
); | ||
|
||
final String hintText; | ||
final TextEditingController? controller; | ||
final Function(String)? onChanged; | ||
final bool? obscureText; | ||
final Widget? suffix; | ||
final InputBorder? border; | ||
final String title; | ||
final int? maxLength; | ||
final int? maxLines; | ||
final TextStyle? titleStyle; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
title, | ||
style: titleStyle ?? | ||
GoogleFonts.notoSans( | ||
fontSize: 18.toAutoScaledFont, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
SizedBox( | ||
height: title == "Description" ? 0 : 20.toAutoScaledHeight, | ||
), | ||
AppTextField( | ||
controller: controller, | ||
onChanged: onChanged, | ||
obscureText: obscureText, | ||
hintText: hintText, | ||
suffix: suffix, | ||
border: border, | ||
maxLength: maxLength, | ||
maxLines: maxLines, | ||
), | ||
], | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
|
||
class AppTextField extends StatelessWidget { | ||
const AppTextField({ | ||
super.key, | ||
required this.hintText, | ||
this.controller, | ||
this.onChanged, | ||
this.obscureText, | ||
this.suffix, | ||
this.border, | ||
this.maxLength, | ||
this.maxLines, | ||
}) : assert( | ||
obscureText == null || suffix != null, | ||
'Suffix should be provided if obscureText is provided', | ||
), | ||
assert( | ||
controller != null || onChanged != null, | ||
'Either controller or onChanged should be provided', | ||
); | ||
|
||
final String hintText; | ||
final TextEditingController? controller; | ||
final Function(String)? onChanged; | ||
final bool? obscureText; | ||
final Widget? suffix; | ||
final InputBorder? border; | ||
final int? maxLength; | ||
final int? maxLines; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TextField( | ||
controller: controller, | ||
onChanged: onChanged, | ||
obscureText: obscureText ?? false, | ||
decoration: InputDecoration( | ||
hintText: hintText, | ||
hintStyle: GoogleFonts.lato( | ||
fontSize: 12.toAutoScaledFont, | ||
color: const Color(0xFF111111), | ||
fontWeight: FontWeight.w600, | ||
), | ||
border: border ?? | ||
OutlineInputBorder( | ||
borderSide: BorderSide( | ||
color: const Color(0xFF111111).withOpacity(0.25)), | ||
borderRadius: BorderRadius.circular(5), | ||
), | ||
contentPadding: EdgeInsets.symmetric( | ||
horizontal: 20.toAutoScaledWidth, | ||
vertical: 15.toAutoScaledHeight), | ||
suffixIcon: suffix), | ||
maxLength: maxLength, | ||
maxLines: maxLines ?? 1, | ||
); | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.