repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
mirrored_repositories/Flutter-Twilio-SMS-Sample
|
mirrored_repositories/Flutter-Twilio-SMS-Sample/lib/my_twilio_sms_screen.dart
|
import 'package:flutter/material.dart';
import 'package:twilio_flutter/twilio_flutter.dart';
class MyTwilioSMSScreen extends StatefulWidget {
@override
_MyTwilioSMSScreenState createState() => _MyTwilioSMSScreenState();
}
class _MyTwilioSMSScreenState extends State<MyTwilioSMSScreen> {
TwilioFlutter myTwilioFlutter;
@override
void initState() {
myTwilioFlutter = TwilioFlutter(
accountSid: '***************************************',
authToken: '*************************************',
twilioNumber: '******************');
super.initState();
}
void sendTwilioSMS() async {
myTwilioFlutter.sendSMS(toNumber: '*************', messageBody: 'Flutter Twilio SMS Test');
}
void getTwilioSMS() async {
var getSMSData = await myTwilioFlutter.getSmsList();
print(getSMSData);
await myTwilioFlutter.getSMS('***************************');
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Flutter Twilio SMS Screen')),
body: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(primary: Colors.redAccent, padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15)),
child:Text('Send SMS through Twilio', style: TextStyle( color: Colors.white, fontSize: 25)),
onPressed: sendTwilioSMS,
),
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Twilio-SMS-Sample
|
mirrored_repositories/Flutter-Twilio-SMS-Sample/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:fluttertwiliosmssample/my_twilio_sms_screen.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyTwilioSMSScreen(),
);
}
}
| 0
|
mirrored_repositories/Flutter-Twilio-SMS-Sample
|
mirrored_repositories/Flutter-Twilio-SMS-Sample/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fluttertwiliosmssample/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Weather-Android-IOS-App
|
mirrored_repositories/Weather-Android-IOS-App/lib/main.dart
|
// ignore_for_file: deprecated_member_use
import 'dart:js';
import 'package:flutter/material.dart';
// ignore: unused_import
import 'package:device_preview/device_preview.dart';
import 'pages/weather_page.dart';
void main() {
DevicePreview(enabled: true,
tools: const [
...DevicePreview.defaultTools
],
builder: (context) => const WeatherPage()
)
runApp(const MyWidget()); // Wrap your app
}
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: WeatherPage(),
);
}
}
| 0
|
mirrored_repositories/Weather-Android-IOS-App/lib
|
mirrored_repositories/Weather-Android-IOS-App/lib/pages/weather_page.dart
|
import 'dart:html';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:weather_app/services/weather_services.dart';
class WeatherPage extends StatefulWidget {
const WeatherPage({super.key});
@override
State<WeatherPage> createState() => _WeatherPageState();
}
class _WeatherPageState extends State<WeatherPage> {
//Api Key
final _weatherService = WeatherService(1e0732b799c18398bef18284d800ddcc
);
Weather? _weather;
//Fetch Weather
_fetchWeather() async
//Get the current City
String cityName = await _weatherService.getCurrentCity();
//Get weather for City
try {
final weather = await _weatherService.getWeather(cityName);
setState(() {
_weather = weather;
});
}
// Any errors
catch (e){
print(e);
}
}
//Weather Animations
// Init State
void initState() {
super.initState();
_fetchWeather();
}
@override
Widget build(BuildContext context) {
return Scaffold();
Body: Column(
MainAxisAlignment: MainAxisAligment.center,
children: [
Text(_weather?.cityName ?? "loading city..."),
Text('${_weather?.temperature.round()}°C')
],
);,
}
}
| 0
|
mirrored_repositories/Weather-Android-IOS-App/lib
|
mirrored_repositories/Weather-Android-IOS-App/lib/models/weather_models.dart
|
class Weather {
final String cityName;
final double temperature;
final String mainCondition;
Weather({
required this.cityName,
required this.temperature,
required this.mainCondition,
});
factory Weather.fromJson(Map<String, dynamic> json){
return Weather(
cityName: json['name'],
temperature: json['main']['temp'].toDouble(),
mainCondition: json['weather'][0]['main'],
);
}
}
| 0
|
mirrored_repositories/Weather-Android-IOS-App/lib
|
mirrored_repositories/Weather-Android-IOS-App/lib/services/weather_services.dart
|
import 'dart:convert';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
import 'package:http/http.dart' as http
import 'package:http/retry.dart';
import 'package:weather_app/models/weather_models.dart' show Weather;
class WeatherService {
// ignore: constant_identifier_names
static const BASE_URL = 'http://api.openweathermap.org/data/2.5/weather';
final String apiKey;
WeatherService(this.apiKey);
Future<Weather> getWeather(String cityName) async {
final response = await http.get(Uri.parse('$BASE_URL?q=$cityName&appid=$apiKey&units=metric'))
if (response.statusCode == 200){
return Weather.fromJson(jsonDecode(response.body));
} else {
throw Exception('Fail to load weather data');
}
}
Future<String> getCurrentCity() async{
LocationPermission permission; == await Geolocator.checkPermission();
if (permission == LocationPermission.denied){
permission == await Geolocator.requestPermission();
}
Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);
List<Placemark> placemarks =
await placemarkFromCoordinates(position.latitude, position.longitude);
String? city = placemarks[0].locality;
return city ?? "";
}
}
| 0
|
mirrored_repositories/Weather-Android-IOS-App
|
mirrored_repositories/Weather-Android-IOS-App/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:weather_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Devang/codeasylum
|
mirrored_repositories/CodeAsylums-App/flutter/Devang/codeasylum/lib/main.dart
|
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Devang/codeasylum
|
mirrored_repositories/CodeAsylums-App/flutter/Devang/codeasylum/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:codeasylum/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/hello_world_app
|
mirrored_repositories/CodeAsylums-App/flutter/hello_world_app/lib/main.dart
|
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/hello_world_app
|
mirrored_repositories/CodeAsylums-App/flutter/hello_world_app/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hello_world_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/flutter_app
|
mirrored_repositories/CodeAsylums-App/flutter/flutter_app/lib/main.dart
|
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: HomePage(),
),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
child: Center(
child: Text(
'Hello World!',
style: TextStyle(color: Colors.green, fontSize: 25),
),
),
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/flutter_app
|
mirrored_repositories/CodeAsylums-App/flutter/flutter_app/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib/main.dart
|
import 'package:flutter/material.dart';
import 'screens/Homescreen.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomeScreen(),
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib/screens/professional.dart
|
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:avatar_glow/avatar_glow.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class CustomAppBar extends PreferredSize {
final Widget child;
final double height;
CustomAppBar({@required this.child, this.height = kToolbarHeight});
@override
Size get preferredSize => Size.fromHeight(height);
@override
Widget build(BuildContext context) {
return Container(
height: preferredSize.height,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
boxShadow: [BoxShadow(color: Colors.black87)],
),
child: this.child);
}
}
class Professional extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Image.asset('assets/codeasylum.png'),
decoration: BoxDecoration(
color: Colors.white,
),
),
ListTile(
title: Text('About'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: Text('Exit'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
backgroundColor: Colors.black,
appBar: CustomAppBar(
height: 115,
child: Column(
children: <Widget>[
SizedBox(height: 30),
Row(
children: <Widget>[
Builder(
builder: (context) => FlatButton.icon(
onPressed: () => Scaffold.of(context).openDrawer(),
icon: Icon(Icons.menu,color: Colors.white,),
label: Text('')),
),
SizedBox(width: 65),
Image.asset(
'assets/code.jpg',
height: 70,
),
],
),
],
),
),
body: Column(
children: <Widget>[
Center(
child: Text(
'Bootstrap yourself into coding with courses especially tailored for working professional!',
style: GoogleFonts.abel(
fontWeight: FontWeight.bold,
color: Colors.white,
decoration: TextDecoration.underline,
fontSize: 12)),
),
SizedBox(
height: 0,
),
AvatarGlow(
glowColor: Colors.purple,
endRadius: 155.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),child: Image.asset(
'assets/teacher.jpg',
height: 200,
),
),
),
),
SizedBox(height: 0),
Row(children: <Widget>[
SizedBox(width: 105),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/google.png',
height: 50,
),
radius: 15.0,
),
),
),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/microsoft.png',
height: 50,
),
radius: 15.0,
),
),
),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/facebook.png',
height: 50,
),
radius: 15.0,
),
),
),
]),
SizedBox(height: 20),
Row(
children: [
SizedBox(
width: 150,
),
SizedBox(
width: 120,
child: TypewriterAnimatedTextKit(
pause: Duration(milliseconds: 400),
repeatForever: true,
onTap: () {
print("Tap Event");
},
text: ['Professional?'],
textStyle: TextStyle(
fontSize: 21.0,
fontFamily: "Agne",
color: Colors.white),
textAlign: TextAlign.start,
alignment:
AlignmentDirectional.topStart // or Alignment.topLeft
),
),
],
),
SizedBox(
height: 10,
),
Text('Ace Developer',
style: GoogleFonts.abel(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 15)),
SizedBox(height: 50),
FlatButton.icon(
onPressed: null,
icon: Icon(Icons.arrow_forward_ios),
label: Text(
"Let's plan a career transformation",
style: GoogleFonts.abel(color: Colors.white,fontWeight: FontWeight.bold)
),
disabledColor: Colors.purple,
)
],
),
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib/screens/Homescreen.dart
|
import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar/persistent-tab-view.dart';
import 'professional.dart';
import 'student.dart';
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
PersistentTabController _controller= PersistentTabController(initialIndex: 0);
List<Widget> _buildScreens() {
return [
Student(),
Professional()
];
}
List<PersistentBottomNavBarItem> _navBarsItems() {
return [
PersistentBottomNavBarItem(
icon: Icon(Icons.person),
title: ("Student"),
activeColor: Colors.black,
inactiveColor: Colors.purpleAccent,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.label_important),
title: ("Professional"),
activeColor: Colors.black,
inactiveColor: Colors.purpleAccent,
),
];
}
Widget build(BuildContext context) {
return
PersistentTabView(
controller: _controller,
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
backgroundColor: Colors.white,
handleAndroidBackButtonPress: true,
resizeToAvoidBottomInset: true, // This needs to be true if you want to move up the screen when keyboard appears.
stateManagement: true,
hideNavigationBarWhenKeyboardShows: true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument.
decoration: NavBarDecoration(
borderRadius: BorderRadius.circular(10.0),
colorBehindNavBar: Colors.white,
),
popAllScreensOnTapOfSelectedTab: true,
itemAnimationProperties: ItemAnimationProperties( // Navigation Bar's items animation properties.
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: ScreenTransitionAnimation( // Screen transition animation on change of selected tab.
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle: NavBarStyle.style1, // Choose the nav bar style with this property.
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/lib/screens/student.dart
|
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:avatar_glow/avatar_glow.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class CustomAppBar extends PreferredSize {
final Widget child;
final double height;
CustomAppBar({@required this.child, this.height = kToolbarHeight});
@override
Size get preferredSize => Size.fromHeight(height);
@override
Widget build(BuildContext context) {
return Container(
height: preferredSize.height,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
boxShadow: [BoxShadow(color: Colors.black87)],
),
child: this.child);
}
}
class Student extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Image.asset('assets/codeasylum.png'),
decoration: BoxDecoration(
color: Colors.white,
),
),
ListTile(
title: Text('About'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: Text('Exit'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
backgroundColor: Colors.black,
appBar: CustomAppBar(
height: 115,
child: Column(
children: <Widget>[
SizedBox(height: 30),
Row(
children: <Widget>[
Builder(
builder: (context) => FlatButton.icon(
onPressed: () => Scaffold.of(context).openDrawer(),
icon: Icon(Icons.menu,color: Colors.white,),
label: Text('')),
),
SizedBox(width: 65),
Image.asset(
'assets/code.jpg',
height: 70,
),
],
),
],
),
),
body: Column(
children: <Widget>[
Center(
child: Text(
'A Learning ride to import you into the World of Programming!',
style: GoogleFonts.abel(
fontWeight: FontWeight.bold,
color: Colors.white,
decoration: TextDecoration.underline)),
),
SizedBox(
height: 0,
),
AvatarGlow(
glowColor: Colors.blue,
endRadius: 170.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/hacker.png',
height: 200,
),
radius: 100.0,
),
),
),
SizedBox(height: 0),
Row(children: <Widget>[
SizedBox(width: 105),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/icon4.png',
height: 50,
),
radius: 15.0,
),
),
),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/icon1.png',
height: 50,
),
radius: 15.0,
),
),
),
AvatarGlow(
glowColor: Colors.white,
endRadius: 30.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/icon 2.png',
height: 50,
),
radius: 15.0,
),
),
),
]),
SizedBox(height: 20),
Row(
children: [
SizedBox(
width: 150,
),
SizedBox(
width: 120,
child: TypewriterAnimatedTextKit(
pause: Duration(milliseconds: 400),
repeatForever: true,
onTap: () {
print("Tap Event");
},
text: ['Student?'],
textStyle: TextStyle(
fontSize: 30.0,
fontFamily: "Agne",
color: Colors.white),
textAlign: TextAlign.start,
alignment:
AlignmentDirectional.topStart // or Alignment.topLeft
),
),
],
),
SizedBox(
height: 10,
),
Text('Maverick Coder',
style: GoogleFonts.abel(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 15)),
SizedBox(height: 50),
FlatButton.icon(
onPressed: null,
icon: Icon(Icons.arrow_forward_ios),
label: Text(
"Let's play and code",
style: GoogleFonts.abel(color: Colors.white,fontWeight: FontWeight.bold)
),
disabledColor: Colors.purple,
)
],
),
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan
|
mirrored_repositories/CodeAsylums-App/flutter/Himanshu_Ranjan/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:codeasylum/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum/lib/Courses.dart
|
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/rendering.dart';
class Courses extends StatefulWidget {
@override
_CoursesState createState() => _CoursesState();
}
class _CoursesState extends State<Courses> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: Drawer(
child: OtherPages(),
),
appBar: AppBar(
elevation: 10,
backgroundColor: Colors.black,
actions: <Widget>[
Image.asset("Images/logo.png"),
],
),
backgroundColor: Colors.black,
body: SingleChildScrollView(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
TrendingTechnologies(),
SizedBox(height: 100,),
CareerCourses(),
SizedBox(height: 100,)
],
)),
);
}
}
class TrendingTechnologies extends StatefulWidget {
@override
_TrendingTechnologiesState createState() => _TrendingTechnologiesState();
}
class _TrendingTechnologiesState extends State<TrendingTechnologies> {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.blueGrey[900],
padding: EdgeInsets.only(top: 30, left: 50, right: 50),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
RaisedButton(
color: Colors.deepOrange,
padding: EdgeInsets.only(top: 20, left: 20),
onPressed: (){},
child: Container(
color: Colors.white,
height: 250,
width: 225,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text("FULL STACK WEB DEVLOPMENT + DSA",
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold
),),
Text("14th July 2020",
style: TextStyle(
fontSize: 14,
),),
],
),
)),
SizedBox(height: 20,),
RaisedButton(
color: Colors.deepOrange,
padding: EdgeInsets.only(top: 20, left: 20),
onPressed: (){},
child: Container(
color: Colors.white,
height: 250,
width: 225,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text("Machine Learning + DSA".toUpperCase(),
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold
),),
Text("14th July 2020",
style: TextStyle(
fontSize: 14,
),),
],
),
)
),
SizedBox(height: 20,),
RaisedButton(
color: Colors.deepOrange,
padding: EdgeInsets.only(top: 20, left: 20),
onPressed: (){},
child: Container(
color: Colors.white,
height: 250,
width: 225,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text("Virgin Algorithms + DSA".toUpperCase(),
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold
),),
Text("14th July 2020",
style: TextStyle(
fontSize: 14,
),),
],
),
)
),
],
),
);
}
}
class CareerCourses extends StatefulWidget {
@override
_CareerCoursesState createState() => _CareerCoursesState();
}
class _CareerCoursesState extends State<CareerCourses> {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width - 20,
height: 75,
color: Colors.blueGrey[900],
padding: EdgeInsets.all(10),
child: Text(
"Career Courses",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 35,
color: Colors.white
),
),
)
],
),
GridView.count(
shrinkWrap: true,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
crossAxisCount: 2,
padding: EdgeInsets.all(8),
children: [
RaisedButton(
elevation: 0,
onPressed: (){},
padding: EdgeInsets.all(0),
color: Colors.white,
child: Column(
children: <Widget>[
Image.asset("Images/ML.png",
fit: BoxFit.cover,
),
],
),),
RaisedButton(
elevation: 0,
onPressed: (){},
padding: EdgeInsets.all(0),
color: Colors.white,
child: Column(
children: <Widget>[
Image.asset("Images/FullStack.png",
fit: BoxFit.cover,
),
],
),),
RaisedButton(
onPressed:(){} ,
padding: EdgeInsets.all(0),
color: Colors.white,
elevation: 0,
child: Column(
children: <Widget>[
Image.asset("Images/VirginAlgo.png",
fit: BoxFit.cover,),
],
)
),
],),]
));
}
}
class OtherPages extends StatefulWidget {
@override
_OtherPagesState createState() => _OtherPagesState();
}
class _OtherPagesState extends State<OtherPages> {
@override
Widget build(BuildContext context) {
return ListView(
children: <Widget>[
DrawerHeader(
child: Image.asset("Images/logo.png"),
decoration: BoxDecoration(
color: Colors.black
),
),
ListTile(
title: Text("Home"),
onTap: (){},
),
ListTile(
title: Text("Courses"),
onTap: (){},
),
ListTile(
title: Text("Culture"),
onTap: (){},
),
ListTile(
title: Text("Mentors"),
onTap: (){},
),
ListTile(
title: Text("Our Team"),
onTap: (){},
),
ListTile(
title: Text("Campus Ambassadors"),
onTap: (){},
),
],
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum/lib/main.dart
|
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
| 0
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum
|
mirrored_repositories/CodeAsylums-App/flutter/Akanksha-Pant/code_asylum/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:codeasylum/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Basic-Flutter/ui_facebook
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:ui_facebook/splash/splash_screen.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: SplashScreen()
);
}
}
| 0
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib/theme/theme.dart
|
import 'package:flutter/material.dart';
double leftdefaultMargin = 21.0;
double rightdefaultMargin = 16.0;
Color kBlueCollor = Color(0xff346ABA);
| 0
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib/home/home.dart
|
import 'package:flutter/material.dart';
import 'package:ui_facebook/theme/theme.dart';
class HomePage extends StatefulWidget {
@override
_HomePage createState() => _HomePage();
}
class _HomePage extends State<HomePage> {
int _currentIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: SafeArea(
child: Container(
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15,
left: leftdefaultMargin,
right: rightdefaultMargin),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Text(
'facebook',
style: TextStyle(
fontSize: 35,
fontWeight: FontWeight.bold,
color: kBlueCollor),
),
Spacer(),
Image.asset(
'assets/images/icon_src.png',
height: 35,
width: 35,
),
Padding(padding: EdgeInsets.only(right: 6)),
Image.asset(
'assets/images/icon_massenger1.png',
height: 38,
width: 36,
),
],
),
SizedBox(
height: 15,
),
Row(
children: [
Image.asset(
'assets/images/icon.png',
height: 45,
width: 45,
),
Padding(padding: EdgeInsets.only(right: 11)),
Text(
'Apa yang Anda pikirkan?',
style: TextStyle(fontSize: 17),
),
],
),
SizedBox(
height: 16,
),
],
),
),
Container(
height: 1,
width: double.infinity,
color: Color(0xffE9DDDD),
),
SizedBox(
height: 9,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Row(
children: [
Image.asset(
'assets/images/icon_status.png',
height: 20,
width: 20,
),
Padding(padding: EdgeInsets.only(right: 5)),
Text(
'Status',
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
Row(
children: [
Image.asset(
'assets/images/icon_photo.png',
height: 20,
width: 20,
),
Padding(padding: EdgeInsets.only(right: 5)),
Text(
'Foto',
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
Row(
children: [
Image.asset(
'assets/images/icon_map.png',
height: 20,
width: 20,
),
Padding(padding: EdgeInsets.only(right: 5)),
Text(
'Singgah',
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
],
),
SizedBox(
height: 15,
),
Container(
height: 6,
width: double.infinity,
color: Color(0xffE9DDDD),
),
SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.only(left: 15),
height: 150,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
makeItem(
image: 'assets/images/img1.jpg',
title: 'Tambah ke Cerita Anda'),
makeItem(
image: 'assets/images/img2.jpg',
title: 'Alexander Chris'),
makeItem(
image: 'assets/images/img3.jpeg',
title: 'Bintang Ananta'),
makeItem(
image: 'assets/images/img4.jpg',
title: 'Dela Puspita'),
makeItem(
image: 'assets/images/img5.jpg', title: 'Supriadi'),
makeItem(
image: 'assets/images/img6.jpg',
title: 'Cahyo Kumolo'),
makeItem(
image: 'assets/images/img7.jpg',
title: 'Siti Aisyah'),
makeItem(
image: 'assets/images/img8.jpg',
title: 'Nella Kharisma'),
],
),
),
SizedBox(
height: 25,
),
Container(
height: 10,
width: double.infinity,
color: Color(0xffE9DDDD),
),
SizedBox(
height: 15,
),
Padding(
padding: const EdgeInsets.only(left: 19),
child: Column(
children: [
Row(
children: [
Image.asset(
'assets/images/icon1.png',
height: 40,
width: 40,
),
Padding(padding: EdgeInsets.only(right: 9)),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Ali Khadafi',
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.bold),
),
Text(
'2 Juli 2020',
style: TextStyle(
fontSize: 9, color: Color(0xff6F6B6B)),
),
],
),
Spacer(),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset(
'assets/images/icon_layer.png',
height: 8,
width: 23,
),
),
],
),
SizedBox(
height: 17,
),
Padding(
padding: const EdgeInsets.only(right: 110),
child: Text(
'This really cool. The view always amazes me \n when i look at it. Its really very beautiful'),
),
SizedBox(
height: 16,
),
Image.asset(
'assets/images/icon_pulau.png',
height: 170,
width: 350,
),
SizedBox(
height: 14,
),
Row(
children: [
Image.asset(
'assets/images/icon_like.png',
height: 17,
width: 17,
),
Image.asset(
'assets/images/icon_heart.png',
height: 17,
width: 17,
),
Icon(
Icons.emoji_emotions,
size: 19,
),
Padding(
padding: const EdgeInsets.only(left: 5),
child: Text(
'257',
style: TextStyle(
fontSize: 14,
color: Color(0xff6E6B6B),
),
),
),
Spacer(),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Text(
'120 Komentar',
style: TextStyle(
fontSize: 14,
color: Color(0xff6E6B6B),
),
),
),
],
),
],
),
),
SizedBox(
height: 15,
),
Container(
height: 2,
width: double.infinity,
color: Color(0xffE9DDDD),
),
SizedBox(
height: 15,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Row(
children: [
Image.asset(
'assets/images/icon_like1.png',
height: 20,
width: 20,
),
Padding(
padding: const EdgeInsets.only(left: 5),
child: Text(
'Suka',
style: TextStyle(
fontSize: 14, color: Color(0xff6E6B6B)),
),
),
],
),
Row(
children: [
Image.asset(
'assets/images/icon_chat.png',
height: 20,
width: 20,
),
Padding(
padding: const EdgeInsets.only(left: 5),
child: Text(
'Komentar',
style: TextStyle(
fontSize: 14, color: Color(0xff6E6B6B)),
),
),
],
),
Row(
children: [
Image.asset(
'assets/images/icon_messenger.png',
height: 25,
width: 25,
),
Padding(
padding: const EdgeInsets.only(left: 5),
child: Text(
'Kirim',
style: TextStyle(
fontSize: 14, color: Color(0xff6E6B6B)),
),
),
],
),
],
),
SizedBox(
height: 15,
),
Container(
height: 2,
width: double.infinity,
color: Color(0xffE9DDDD),
),
SizedBox(
height: 15,
),
Padding(
padding: const EdgeInsets.only(left: 19),
child: Column(
children: [
Row(
children: [
Image.asset(
'assets/images/icon1.png',
height: 40,
width: 40,
),
Padding(padding: EdgeInsets.only(right: 9)),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Ali Khadafi',
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.bold),
),
Text(
'2 Juli 2020',
style: TextStyle(
fontSize: 9, color: Color(0xff6F6B6B)),
),
],
),
Spacer(),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset(
'assets/images/icon_layer.png',
height: 8,
width: 23,
),
),
],
),
SizedBox(
height: 17,
),
Padding(
padding: const EdgeInsets.only(right: 110),
child: Text(
'This really cool. The view always amazes me \n when i look at it. Its really very beautiful'),
),
SizedBox(
height: 16,
),
Image.asset(
'assets/images/icon_pulau.png',
height: 170,
width: 350,
),
SizedBox(
height: 14,
),
Row(
children: [
Image.asset(
'assets/images/icon_like.png',
height: 17,
width: 17,
),
Image.asset(
'assets/images/icon_heart.png',
height: 17,
width: 17,
),
Icon(
Icons.emoji_emotions,
size: 19,
),
Padding(
padding: const EdgeInsets.only(left: 5),
child: Text(
'257',
style: TextStyle(
fontSize: 14,
color: Color(0xff6E6B6B),
),
),
),
Spacer(),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Text(
'120 Komentar',
style: TextStyle(
fontSize: 14,
color: Color(0xff6E6B6B),
),
),
),
],
),
],
),
),
],
),
),
),
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: _currentIndex,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home, color: Colors.grey),
title: Text(
'Home',
style: TextStyle(color: Colors.grey),
),
backgroundColor: Colors.white),
BottomNavigationBarItem(
icon: Icon(Icons.store, color: Colors.grey),
title: Text(
'Marketpalce',
style: TextStyle(color: Colors.grey),
),
backgroundColor: Colors.white),
BottomNavigationBarItem(
icon: Icon(Icons.person, color: Colors.grey),
title: Text(
'Profile',
style: TextStyle(color: Colors.grey),
),
backgroundColor: Colors.white),
BottomNavigationBarItem(
icon: Icon(
Icons.group,
color: Colors.grey,
),
title: Text(
'Grup',
style: TextStyle(color: Colors.grey),
),
backgroundColor: Colors.white),
BottomNavigationBarItem(
icon: Icon(Icons.notifications, color: Colors.grey),
title: Text(
'Permberitahuan',
style: TextStyle(color: Colors.grey),
),
backgroundColor: Colors.white),
],
onTap: (index) {
setState(() {
_currentIndex = index;
});
},
),
);
}
Widget makeItem({image, title}) {
return AspectRatio(
aspectRatio: 12 / 15,
child: Container(
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
image: DecorationImage(image: AssetImage(image), fit: BoxFit.cover),
),
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: LinearGradient(begin: Alignment.bottomRight, colors: [
Colors.transparent.withOpacity(.2),
Colors.transparent.withOpacity(.2),
]),
),
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
title,
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold),
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib
|
mirrored_repositories/Basic-Flutter/ui_facebook/lib/splash/splash_screen.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class SplashScreen extends StatefulWidget {
SplashScreen({Key? key}) : super(key: key);
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Container(
padding: EdgeInsets.only(top: 400),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('FACEBOOK',
style: GoogleFonts.lexendExa(textStyle: TextStyle(fontSize: 18))
),
SizedBox(height: 7,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset('assets/images/icon_fb.png',
height: 18, width: 16,
),
),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset('assets/images/icon_mess.png',
height: 18, width: 16,
),
),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset('assets/images/icon_ig.png',
height: 18, width: 16,
),
),
Padding(
padding: const EdgeInsets.only(right: 10),
child: Image.asset('assets/images/icon_wa.png',
height: 18, width: 16,
),
),
Image.asset('assets/images/icon_oracle.png',
height: 18, width: 16,
),
],
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Basic-Flutter/ui_facebook
|
mirrored_repositories/Basic-Flutter/ui_facebook/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ui_facebook/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Basic-Flutter
|
mirrored_repositories/Basic-Flutter/Dart Fundamental/array.dart
|
/* Membuat Array pada dart.
Array adalah object yang digunakan untuk menyimpan sebuah koleksi.
Koleksi bisa berupa apa saja mulai dari angka, objects, dan bisa juga berisi
array lagi.
langkah-langkah membuat variable:
- pertama tuliskan var di awal nya.
- Tuliskan nama variable nya
- kemudian tuliskan value dari variable tersebut.
- lalu buat method print untuk menampilkan value dari variable sersebut.
*/
main() {
// Tulis variable bernama array dan tuliskan value didalamnya.
var array = ['a', 'i', 'u', 'e', 'o'];
print(array);
// Method yang terdapat pada array
print(array.first); // Print element pertama pada array.
print(array.last); // Print element terakhir pada array.
print(array.isEmpty); // Print apakah array tersebut empty atau tidak
// (berupa boolean).
print(array.length); // Print panjang dari array, pada bahasa lain
// biasanya menggunakan .size() etc.
print("");
// Pada dart, kita juga bisa membuat array dari sebuah string.
var string = "hello world";
var arrayString = string.split("");
print('Array string : ${arrayString}');
// Atau kalian hanya ingin memisahkan per spasi? Tentu bisa.
var string2 = "hello world second";
var arrayString2 = string2.split(" ");
print('Array string per spasi : ${arrayString2}');
// Kalian juga bisa mengganti split dengan apa saja, seperti
// split(",") untuk memisahkan antara `,`.
}
| 0
|
mirrored_repositories/Basic-Flutter
|
mirrored_repositories/Basic-Flutter/Dart Fundamental/variable.dart
|
/* Membuat Variable di dart.
Variable adalah informasi atau nilai yang akan dikelola di dalam sebuah program.
Variable dibagi menjadi 2 yaitu mutable dan immutable.
Variable mutable adalah Variable yang bisa di ubah. dan immutable adalah variable yang tidak bisa diubah.
langkah-langkah membuat variable:
- pertama tuliskan var di awal nya.
- Tuliskan nama variable nya
- kemudian tuliskan value dari variable tersebut.
- lalu buat method print untuk menampilkan value dari variable sersebut.
*/
main(List<String> args) {
// contoh penulisan 1
var nama = "Nadhif";
print(nama);
// contoh penulisan 2
int number = 1;
print(number);
// Penulisan code juga bisa seperti contoh yang ke 2.
// disana tidak menuliskan var, akan tetapi langsung menyebutkan tipe data dari valuenya. Di bahasa dart bisa membaca seperti code di atas.
// sekarang kita akan membuat variable mutable dan immutable.
// variable mutable
var name = "Nadhif Shohibul Kaffi";
print(name);
// variable immutable
final nama2 = "Nadhif";
print(nama2);
const nama3 = "Nadhif";
print(nama3);
}
| 0
|
mirrored_repositories/Basic-Flutter
|
mirrored_repositories/Basic-Flutter/Dart Fundamental/string.dart
|
/* Stirng Merupakan tipe data untuk menuliskan beberapa character secara bersamaan.
Adapun untuk ciri-ciri tipe data string yaitu di tandai dengan tanda petik 2 dan petik 1 ("", '')
langkah-langkah membuat tipe data string
- Tuliskan jenis tipe data nya di awal
- Kemudian tuliskan nama variablenya
- Lalu berikan value nya.
*/
main(List<String> args) {
// contoh
String name = "Nadhif";
print(name);
/* untuk print dengan ada nya tanda petik 2, maka dia harus gunakan string yang satu. bila ada error 2 tanda petik
maka tambahkan back slice (\) */
String percakapan = '"it\'s Nadhif"';
print(percakapan);
}
| 0
|
mirrored_repositories/Basic-Flutter
|
mirrored_repositories/Basic-Flutter/Dart Fundamental/map.dart
|
/* Membuat Mapping pada dart.
Map pada dart digunakan untuk menyamakan antara key/value yang sesuai. Key dan
value bisa berupa tipe apa saja. Dan juga, map merupakan koleksi dinamik
dimana map bisa bertambah dan berkurang didalam runtime.
langkah-langkah membuat variable:
- pertama tuliskan var di awal nya.
- Tuliskan nama variable nya
- kemudian tuliskan value dari variable tersebut.
- lalu buat method print untuk menampilkan value dari variable sersebut.
*/
main() {
// Menulis variable mapping dengan method Map()
Map mapping = new Map();
mapping['satu'] = 'One';
mapping['dua'] = 'Two';
mapping['tiga'] = 'Three';
mapping['empat'] = 'Four';
print(mapping);
print("");
// Seperti yang saya katakan tadi bahwa map dapat bertambah
// dan berkurang dalam runtime, berikut contohnya.
// Menambahkan data pada map.
mapping['lima'] = 'Five';
print('Menambahkan lima : ${mapping}');
print("");
// Menghapus salah satu map.
mapping.remove('tiga');
print('Menghilangkan tiga : ${mapping}');
print("");
// Mengupdate data.
mapping.update('satu', (value) => 'One atau 1');
print('Update satu : ${mapping}');
}
| 0
|
mirrored_repositories/Basic-Flutter
|
mirrored_repositories/Basic-Flutter/Dart Fundamental/hello_world.dart
|
main(List<String> args) {
print('Hello world');
}
/* Disini kita akan memulai belajar untuk membuat aplikasi hello world.
langkah-langkah:
- membuat function main: Fungsi main adalah function utama ketika akan memulai pemograman. jika jika tidak ada function tersebut maka tidak bisa di run.
- Lakukan perintah untuk menampilkan program dengan menuliskan method / fucntion print()
- Tuliskan sesuatu didalam method print. di sini kita akan menuliskan "Hello world".
- Jangan lupa di akhir ny tambahkan semicolon (;)
*/
| 0
|
mirrored_repositories/jokenpo
|
mirrored_repositories/jokenpo/lib/jogo.dart
|
import 'dart:math';
import 'package:flutter/material.dart';
class jogo extends StatefulWidget {
@override
_jogoState createState() => _jogoState();
}
class _jogoState extends State<jogo> {
var _status = "Escolha uma opção abaixo para jogar:";
var _imagemComputador = "images/padrao.png";
void opcaoSelecionada(String escolhaUsuario) {
var opcoes = ["pedra", "papel", "tesoura"];
var numero = Random().nextInt(3);
var escolhaComputador = opcoes[numero];
if (escolhaComputador == "papel") {
setState(() {
_imagemComputador = "images/papel.png";
});
if (escolhaUsuario == "papel") {
setState(() {
_status = "Você empatou :o";
});
} else if (escolhaUsuario == "pedra") {
setState(() {
_status = "Você perdeu :(. Tente novamente.";
});
} else {
setState(() {
_status = "Você ganhou :D. Parabéns!";
});
}
}
if (escolhaComputador == "pedra") {
setState(() {
_imagemComputador = "images/pedra.png";
});
if (escolhaUsuario == "papel") {
setState(() {
_status = "Você ganhou :D. Parabéns!";
});
} else if (escolhaUsuario == "pedra") {
setState(() {
_status = "Você empatou :o";
});
} else {
setState(() {
_status = "Você perdeu :(. Tente novamente.";
});
}
}
if (escolhaComputador == "tesoura") {
setState(() {
_imagemComputador = "images/tesoura.png";
});
if (escolhaUsuario == "papel") {
setState(() {
_status = "Você perdeu :(. Tente novamente.";
});
} else if (escolhaUsuario == "pedra") {
setState(() {
_status = "Você ganhou :D. Parabéns!";
});
} else {
setState(() {
_status = "Você empatou :o";
});
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Jokenpo"),
backgroundColor: Colors.green[700],
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(top: 0, bottom: 0),
child: Text(
"Escolha do Computador:",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18),
),
),
Image.asset("$_imagemComputador"),
Text(
"$_status",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () => opcaoSelecionada("pedra"),
child: Image.asset(
"images/pedra.png",
height: 95,
),
),
GestureDetector(
onTap: () => opcaoSelecionada("papel"),
child: Image.asset(
"images/papel.png",
height: 95,
),
),
GestureDetector(
onTap: () => opcaoSelecionada("tesoura"),
child: Image.asset(
"images/tesoura.png",
height: 95,
),
),
],
),
],
),
bottomNavigationBar: BottomAppBar(),
);
}
}
| 0
|
mirrored_repositories/jokenpo
|
mirrored_repositories/jokenpo/lib/main.dart
|
import 'package:flutter/material.dart';
import 'jogo.dart';
void main() {
runApp(MaterialApp(
home: jogo(),
//debugShowCheckedModeBanner: false,
));
}
| 0
|
mirrored_repositories/worldtimeApp
|
mirrored_repositories/worldtimeApp/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:worldtimeapp/pages/chooseLocation.dart';
import 'package:worldtimeapp/pages/loading.dart';
import 'pages/home.dart';
void main() => runApp(MaterialApp(
initialRoute: '/',
routes: {
'/' : (context) => loading(),
'/home' : (context) => home(),
'/location' : (context) => chooseLocation(),
},
));
| 0
|
mirrored_repositories/worldtimeApp/lib
|
mirrored_repositories/worldtimeApp/lib/pages/loading.dart
|
import 'package:flutter/material.dart';
import 'package:worldtimeapp/services/worldTime.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class loading extends StatefulWidget {
@override
_loadingState createState() => _loadingState();
}
class _loadingState extends State<loading> {
//---------------------Asyncronous Code----------------------
// void getData() async{
// String country1 = await Future.delayed(Duration(seconds: 3), (){
// return "Pakistan!";
// });
// String country2 = await Future.delayed(Duration(seconds: 2), (){
// return "India";
// });
//
// print("Bangladesh");
// print('$country1 - $country2');
// }
//--------------------Packages-----------------------
// void getData() async{
// Response response = await get('https://jsonplaceholder.typicode.com/todos/1');
// Map data = jsonDecode(response.body);
// print(data);
// print(data ['title']);
// }
// String time = 'loading';
void setupWorldTime() async{
worldtime instance = worldtime(location: 'London', flag: 'germany.png', url: 'Europe/London');
await instance.getTime();
Navigator.pushReplacementNamed(context, '/home',arguments: {
'location': instance.location,
'flag': instance.flag,
'time': instance.time,
'isDaytime' : instance.isDaytime,
});
// print(instance.time);
// setState(() {
// time = instance.time;
// });
}
@override
void initState() {
super.initState();
setupWorldTime();
//print("Kashmir");
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blue,
body: Center(
//padding: EdgeInsets.all(50),
child: SpinKitCubeGrid(
color: Colors.white,
size: 50.0,
), //time
),
);
}
}
| 0
|
mirrored_repositories/worldtimeApp/lib
|
mirrored_repositories/worldtimeApp/lib/pages/chooseLocation.dart
|
import 'package:flutter/material.dart';
import 'package:worldtimeapp/services/worldTime.dart';
class chooseLocation extends StatefulWidget {
@override
_chooseLocationState createState() => _chooseLocationState();
}
class _chooseLocationState extends State<chooseLocation> {
@override
Widget build(BuildContext context) {
List<worldtime> locations = [
worldtime(url: 'Europe/London', location: 'London', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/uk.png'),
worldtime(url: 'Europe/Berlin', location: 'Athens', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/egypt.png'),
worldtime(url: 'Africa/Cairo', location: 'Cairo', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/germany.png'),
worldtime(url: 'Africa/Nairobi', location: 'Nairobi', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/kenya.png'),
worldtime(url: 'America/Chicago', location: 'Chicago', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/usa.png'),
worldtime(url: 'America/New_York', location: 'New York', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/usa.png'),
worldtime(url: 'Asia/Seoul', location: 'Seoul', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/south_korea.png'),
worldtime(url: 'Asia/Jakarta', location: 'Jakarta', flag: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-34/world_time_app/assets/indonesia.png'),
];
void updateTime(index) async {
worldtime instance = locations[index];
await instance.getTime();
//Navigate home screen
Navigator.pop(context,{
'location': instance.location,
'flag': instance.flag,
'time': instance.time,
'isDaytime' : instance.isDaytime,
});
}
return Scaffold(
backgroundColor: Colors.grey[150],
appBar: AppBar(
backgroundColor: Colors.blue,
title: Text('Choose a Location'),
centerTitle: true,
elevation: 0, //Shadow Remove
),
body: ListView.builder(
itemCount: locations.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 1.0, horizontal: 4.0),
child: Card(
child: ListTile(
onTap: () {
updateTime(index);
// print(locations[index].location);
},
title: Text(locations[index].location),
leading: CircleAvatar(
backgroundImage: NetworkImage('${locations[index].flag}') ),
),
),
);
},
),
// body: SafeArea(child: Text('Choose Location')),
);
}
}
| 0
|
mirrored_repositories/worldtimeApp/lib
|
mirrored_repositories/worldtimeApp/lib/pages/home.dart
|
import 'package:flutter/material.dart';
class home extends StatefulWidget {
@override
_homeState createState() => _homeState();
}
class _homeState extends State<home> {
Map data = {};
@override
Widget build(BuildContext context) {
data = data.isNotEmpty ? data : ModalRoute.of(context).settings.arguments;
print(data);
//------------set background image--------------------
String bgimage = data['isDaytime']
? 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-33/world_time_app/assets/day.png'
: 'https://raw.githubusercontent.com/iamshaunjp/flutter-beginners-tutorial/lesson-33/world_time_app/assets/night.png';
Color bgcolor = data['isDaytime'] ? Colors.blue : Colors.indigo[800];
return Scaffold(
backgroundColor: bgcolor,
body: SafeArea(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage('$bgimage'),
fit: BoxFit.cover,
),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 120, 0, 0),
child: Column(
children: [
FlatButton.icon(
onPressed: () async {
dynamic result = await Navigator.pushNamed(context, '/location');
setState(() {
data ={
'time' : result['time'],
'location' : result['location'],
'isDaytime' : result['isDaytime'],
'flag' : result['flag'],
};
});
},
icon: Icon(
Icons.edit_location,
color: Colors.grey[300],
),
label: Text(
'Choose Location',
style: TextStyle(color: Colors.grey[300]),
),
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
data['location'],
style: TextStyle(
letterSpacing: 2, fontSize: 20, color: Colors.white),
),
],
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
data['time'],
style: TextStyle(fontSize: 65, color: Colors.white),
)
],
)
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/worldtimeApp/lib
|
mirrored_repositories/worldtimeApp/lib/services/worldTime.dart
|
import 'package:http/http.dart';
import 'dart:convert';
import 'package:intl/intl.dart';
class worldtime{
String location; // location name in the UI
String time; // time of that location
String flag; //flag of that location
String url; //url of the location
bool isDaytime;
worldtime({this.location,this.flag, this.url});
Future<void> getTime() async {
try {
//-----------------------Make Request----------------
Response response = await get(
"http://worldtimeapi.org/api/timezone/$url");
Map data = jsonDecode(response.body);
//print(data);
//---------------get property from data------------
String date = data['datetime'];
String offset = data['utc_offset'].substring(1, 3);
//print(date);
//-------------convert datetime object--------------
DateTime dateTime = DateTime.parse(date);
dateTime = dateTime.add(Duration(hours: int.parse(offset)));
// set time into string
isDaytime = dateTime.hour > 6 && dateTime.hour < 20 ? true : false;
time = DateFormat.jm().format(dateTime);
}
catch(e){
print('Caught Error: $e');
time= 'There is an Error Finding Location';
}
}
}
| 0
|
mirrored_repositories/worldtimeApp
|
mirrored_repositories/worldtimeApp/integration_test/driver.dart
|
// This file is provided as a convenience for running integration tests via the
// flutter drive command.
//
// flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();
| 0
|
mirrored_repositories/worldtimeApp
|
mirrored_repositories/worldtimeApp/integration_test/app_test.dart
|
// This is a basic Flutter integration test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:worldtimeapp/main.dart' as app;
void main() => run(_testMain);
void _testMain() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
app.main();
// Trigger a frame.
await tester.pumpAndSettle();
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/WoMentr
|
mirrored_repositories/WoMentr/lib/SizeConfig.dart
|
import 'package:flutter/material.dart';
class MySize {
static late MediaQueryData _mediaQueryData;
static late double screenWidth;
static late double screenHeight;
static double? safeWidth;
static double? safeHeight;
static late double scaleFactorWidth;
static late double scaleFactorHeight;
//Custom sizes
static double? size0;
static late double size2;
static late double size3;
static double? size4;
static double? size5;
static double? size6;
static late double size7;
static double? size8;
static double? size10;
static double? size12;
static double? size14;
static double? size16;
static double? size18;
static double? size20;
static double? size22;
static double? size24;
static double? size26;
static double? size28;
static double? size30;
static double? size32;
static late double size34;
static double? size36;
static double? size38;
static double? size40;
static double? size42;
static double? size44;
static double? size48;
static double? size50;
static double? size52;
static double? size54;
static double? size56;
static double? size60;
static double? size64;
static double? size68;
static double? size72;
static double? size76;
static double? size80;
static double? size90;
static late double size96;
static double? size100;
static double? size120;
static double? size140;
static double? size160;
static double? size180;
void init(BuildContext context) {
_mediaQueryData = MediaQuery.of(context);
screenWidth = _mediaQueryData.size.width;
screenHeight = _mediaQueryData.size.height;
double _safeAreaWidth =
_mediaQueryData.padding.left + _mediaQueryData.padding.right;
double _safeAreaHeight =
_mediaQueryData.padding.top + _mediaQueryData.padding.bottom;
safeWidth = (screenWidth - _safeAreaWidth);
safeHeight = (screenHeight - _safeAreaHeight);
//Scale factor for responsive UI
scaleFactorHeight = (safeHeight! / 820);
if (scaleFactorHeight < 1) {
double diff = (1 - scaleFactorHeight) * (1 - scaleFactorHeight);
scaleFactorHeight += diff;
}
scaleFactorWidth = safeWidth! / 392;
if (scaleFactorWidth < 1) {
double diff = (1 - scaleFactorWidth) * (1 - scaleFactorWidth);
scaleFactorWidth += diff;
}
//Custom sizes
size0 = 0;
size2 = scaleFactorHeight * 2;
size3 = scaleFactorHeight * 3;
size4 = scaleFactorHeight * 4;
size5 = scaleFactorHeight * 5;
size6 = scaleFactorHeight * 6;
size7 = scaleFactorHeight * 7;
size8 = scaleFactorHeight * 8;
size10 = scaleFactorHeight * 10;
size12 = scaleFactorHeight * 12;
size14 = scaleFactorHeight * 14;
size16 = scaleFactorHeight * 16;
size18 = scaleFactorHeight * 18;
size20 = scaleFactorHeight * 20;
size22 = scaleFactorHeight * 22;
size24 = scaleFactorHeight * 24;
size26 = scaleFactorHeight * 26;
size28 = scaleFactorHeight * 28;
size30 = scaleFactorHeight * 30;
size32 = scaleFactorHeight * 32;
size34 = scaleFactorHeight * 34;
size36 = scaleFactorHeight * 36;
size38 = scaleFactorHeight * 38;
size40 = scaleFactorHeight * 40;
size42 = scaleFactorHeight * 42;
size44 = scaleFactorHeight * 44;
size48 = scaleFactorHeight * 48;
size50 = scaleFactorHeight * 50;
size52 = scaleFactorHeight * 52;
size54 = scaleFactorHeight * 54;
size56 = scaleFactorHeight * 56;
size60 = scaleFactorHeight * 60;
size64 = scaleFactorHeight * 64;
size68 = scaleFactorHeight * 68;
size72 = scaleFactorHeight * 72;
size76 = scaleFactorHeight * 76;
size80 = scaleFactorHeight * 80;
size90 = scaleFactorHeight * 90;
size96 = scaleFactorHeight * 96;
size100 = scaleFactorHeight * 100;
size120 = scaleFactorHeight * 120;
size140 = scaleFactorHeight * 140;
size160 = scaleFactorHeight * 160;
size180 = scaleFactorHeight * 180;
}
static double getScaledSizeWidth(double size) {
return (size * scaleFactorWidth);
}
static double getScaledSizeHeight(double size) {
return (size * scaleFactorHeight);
}
}
class Spacing {
static EdgeInsetsGeometry zero = EdgeInsets.zero;
static EdgeInsetsGeometry only(
{double top = 0, double right = 0, double bottom = 0, double left = 0}) {
return EdgeInsets.only(left: left, right: right, top: top, bottom: bottom);
}
static EdgeInsetsGeometry fromLTRB(
double left, double top, double right, double bottom) {
return Spacing.only(bottom: bottom, top: top, right: right, left: left);
}
static EdgeInsetsGeometry all(double spacing) {
return Spacing.only(
bottom: spacing, top: spacing, right: spacing, left: spacing);
}
static EdgeInsetsGeometry left(double spacing) {
return Spacing.only(left: spacing);
}
static EdgeInsetsGeometry nLeft(double spacing) {
return Spacing.only(top: spacing, bottom: spacing, right: spacing);
}
static EdgeInsetsGeometry top(double spacing) {
return Spacing.only(top: spacing);
}
static EdgeInsetsGeometry nTop(double spacing) {
return Spacing.only(left: spacing, bottom: spacing, right: spacing);
}
static EdgeInsetsGeometry right(double spacing) {
return Spacing.only(right: spacing);
}
static EdgeInsetsGeometry nRight(double spacing) {
return Spacing.only(top: spacing, bottom: spacing, left: spacing);
}
static EdgeInsetsGeometry bottom(double spacing) {
return Spacing.only(bottom: spacing);
}
static EdgeInsetsGeometry nBottom(double spacing) {
return Spacing.only(top: spacing, left: spacing, right: spacing);
}
static EdgeInsetsGeometry horizontal(double spacing) {
return Spacing.only(left: spacing, right: spacing);
}
static x(double spacing) {
return Spacing.only(left: spacing, right: spacing);
}
static xy(double xSpacing, double ySpacing) {
return Spacing.only(
left: xSpacing, right: xSpacing, top: ySpacing, bottom: ySpacing);
}
static y(double spacing) {
return Spacing.only(top: spacing, bottom: spacing);
}
static EdgeInsetsGeometry vertical(double spacing) {
return Spacing.only(top: spacing, bottom: spacing);
}
static EdgeInsetsGeometry symmetric(
{double vertical = 0, double horizontal = 0}) {
return Spacing.only(
top: vertical, right: horizontal, left: horizontal, bottom: vertical);
}
static Widget height(double height) {
return SizedBox(
height: height,
);
}
static Widget width(double width) {
return SizedBox(
width: width,
);
}
}
class Space{
Space();
static Widget height(double space){
return SizedBox(height: MySize.getScaledSizeHeight(space),);
}
static Widget width(double space){
return SizedBox(width: MySize.getScaledSizeHeight(space),);
}
}
enum ShapeTypeFor{
container,
button
}
class Shape{
static dynamic circular(double radius,{ShapeTypeFor shapeTypeFor=ShapeTypeFor.container}){
BorderRadius borderRadius = BorderRadius.all(Radius.circular(MySize.getScaledSizeHeight(radius)));
switch(shapeTypeFor) {
case ShapeTypeFor.container:
return borderRadius;
case ShapeTypeFor.button:
return RoundedRectangleBorder(
borderRadius: borderRadius);
}
}
static dynamic circularTop(double radius,{ShapeTypeFor shapeTypeFor=ShapeTypeFor.container}){
BorderRadius borderRadius = BorderRadius.only(topLeft: Radius.circular(MySize.getScaledSizeHeight(radius)),topRight: Radius.circular(MySize.getScaledSizeHeight(radius)));
switch(shapeTypeFor) {
case ShapeTypeFor.container:
return borderRadius;
case ShapeTypeFor.button:
return RoundedRectangleBorder(
borderRadius: borderRadius);
}
}
}
| 0
|
mirrored_repositories/WoMentr
|
mirrored_repositories/WoMentr/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:womentr/screens/LoginScreen.dart';
import 'package:firebase_core/firebase_core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: LoginScreen(),
);
}
}
| 0
|
mirrored_repositories/WoMentr
|
mirrored_repositories/WoMentr/lib/AppTheme.dart
|
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class AppTheme {
static CustomAppTheme getCustomAppTheme() {
return CustomAppTheme.lightCustomAppTheme;
}
static FontWeight _getFontWeight(int weight) {
switch (weight) {
case 100:
return FontWeight.w100;
case 200:
return FontWeight.w200;
case 300:
return FontWeight.w300;
case 400:
return FontWeight.w300;
case 500:
return FontWeight.w400;
case 600:
return FontWeight.w500;
case 700:
return FontWeight.w600;
case 800:
return FontWeight.w700;
case 900:
return FontWeight.w900;
}
return FontWeight.w400;
}
static TextStyle getTextStyle(TextStyle? textStyle,
{int fontWeight = 500,
bool muted = false,
bool xMuted = false,
double letterSpacing = 0.15,
Color? color,
TextDecoration decoration = TextDecoration.none,
double? height,
double wordSpacing = 0,
double? fontSize}) {
double? finalFontSize = fontSize != null ? fontSize : textStyle!.fontSize;
Color? finalColor;
if (color == null) {
finalColor = xMuted
? textStyle!.color!.withAlpha(160)
: (muted ? textStyle!.color!.withAlpha(200) : textStyle!.color);
} else {
finalColor = xMuted
? color.withAlpha(160)
: (muted ? color.withAlpha(200) : color);
}
return GoogleFonts.ibmPlexSans(
fontSize: finalFontSize,
fontWeight: _getFontWeight(fontWeight),
letterSpacing: letterSpacing,
color: finalColor,
decoration: decoration,
height: height,
wordSpacing: wordSpacing);
}
//App Bar Text
static final TextTheme lightAppBarTextTheme = TextTheme(
headline1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 102, color: Color(0xff495057))),
headline2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 64, color: Color(0xff495057))),
headline3: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 51, color: Color(0xff495057))),
headline4: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 36, color: Color(0xff495057))),
headline5: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 25, color: Color(0xff495057))),
headline6: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 18, color: Color(0xff495057))),
subtitle1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 17, color: Color(0xff495057))),
subtitle2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 15, color: Color(0xff495057))),
bodyText1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 16, color: Color(0xff495057))),
bodyText2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 14, color: Color(0xff495057))),
button: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 15, color: Color(0xff495057))),
caption: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 13, color: Color(0xff495057))),
overline: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 11, color: Color(0xff495057))),
);
//Text Themes
static final TextTheme lightTextTheme = TextTheme(
headline1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 102, color: Color(0xff4a4c4f))),
headline2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 64, color: Color(0xff4a4c4f))),
headline3: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 51, color: Color(0xff4a4c4f))),
headline4: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 36, color: Color(0xff4a4c4f))),
headline5: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 25, color: Color(0xff4a4c4f))),
headline6: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 18, color: Color(0xff4a4c4f))),
subtitle1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 17, color: Color(0xff4a4c4f))),
subtitle2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 15, color: Color(0xff4a4c4f))),
bodyText1: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 16, color: Color(0xff4a4c4f))),
bodyText2: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 14, color: Color(0xff4a4c4f))),
button: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 15, color: Color(0xff4a4c4f))),
caption: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 13, color: Color(0xff4a4c4f))),
overline: GoogleFonts.ibmPlexSans(
textStyle: TextStyle(fontSize: 11, color: Color(0xff4a4c4f))),
);
//Color Themes
static final ThemeData lightTheme = ThemeData(
brightness: Brightness.light,
primaryColor: Color(0xff3d63ff),
canvasColor: Colors.transparent,
backgroundColor: Color(0xfff6f6f6),
scaffoldBackgroundColor: Color(0xfff6f6f6),
appBarTheme: AppBarTheme(
textTheme: lightAppBarTextTheme,
actionsIconTheme: IconThemeData(
color: Color(0xff495057),
),
color: Color(0xffffffff),
iconTheme: IconThemeData(color: Color(0xff495057), size: 24),
),
navigationRailTheme: NavigationRailThemeData(
selectedIconTheme:
IconThemeData(color: Color(0xff3d63ff), opacity: 1, size: 24),
unselectedIconTheme:
IconThemeData(color: Color(0xff495057), opacity: 1, size: 24),
backgroundColor: Color(0xffffffff),
elevation: 3,
selectedLabelTextStyle: TextStyle(color: Color(0xff3d63ff)),
unselectedLabelTextStyle: TextStyle(color: Color(0xff495057))),
colorScheme: ColorScheme.light(
primary: Color(0xff3d63ff),
onPrimary: Colors.white,
primaryVariant: Color(0xff0055ff),
secondary: Color(0xff495057),
secondaryVariant: Color(0xff3cd278),
onSecondary: Colors.white,
surface: Color(0xffe2e7f1),
background: Color(0xfff3f4f7),
onBackground: Color(0xff495057)),
cardTheme: CardTheme(
color: Colors.white,
shadowColor: Colors.black.withOpacity(0.4),
elevation: 1,
margin: EdgeInsets.all(0),
),
inputDecorationTheme: InputDecorationTheme(
hintStyle: TextStyle(fontSize: 15, color: Color(0xaa495057)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(4)),
borderSide: BorderSide(width: 1, color: Color(0xff3d63ff)),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(4)),
borderSide: BorderSide(width: 1, color: Colors.black54),
),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(4)),
borderSide: BorderSide(width: 1, color: Colors.black54)),
),
splashColor: Colors.white.withAlpha(100),
iconTheme: IconThemeData(
color: Colors.white,
),
textTheme: lightTextTheme,
indicatorColor: Colors.white,
disabledColor: Color(0xffdcc7ff),
highlightColor: Colors.white,
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: Color(0xff3d63ff),
splashColor: Colors.white.withAlpha(100),
highlightElevation: 8,
elevation: 4,
focusColor: Color(0xff3d63ff),
hoverColor: Color(0xff3d63ff),
foregroundColor: Colors.white),
dividerColor: Color(0xffd1d1d1),
errorColor: Color(0xfff0323c),
cardColor: Colors.white,
accentColor: Color(0xff3d63ff),
popupMenuTheme: PopupMenuThemeData(
color: Color(0xffffffff),
textStyle:
lightTextTheme.bodyText2!.merge(TextStyle(color: Color(0xff495057))),
),
bottomAppBarTheme:
BottomAppBarTheme(color: Color(0xffffffff), elevation: 2),
tabBarTheme: TabBarTheme(
unselectedLabelColor: Color(0xff495057),
labelColor: Color(0xff3d63ff),
indicatorSize: TabBarIndicatorSize.label,
indicator: UnderlineTabIndicator(
borderSide: BorderSide(color: Color(0xff3d63ff), width: 2.0),
),
),
sliderTheme: SliderThemeData(
activeTrackColor: Color(0xff3d63ff),
inactiveTrackColor: Color(0xff3d63ff).withAlpha(140),
trackShape: RoundedRectSliderTrackShape(),
trackHeight: 4.0,
thumbColor: Color(0xff3d63ff),
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 10.0),
overlayShape: RoundSliderOverlayShape(overlayRadius: 24.0),
tickMarkShape: RoundSliderTickMarkShape(),
inactiveTickMarkColor: Colors.red[100],
valueIndicatorShape: PaddleSliderValueIndicatorShape(),
valueIndicatorTextStyle: TextStyle(
color: Colors.white,
),
),
);
}
class CustomAppTheme {
final Color bgLayer1,
bgLayer2,
bgLayer3,
bgLayer4,
disabledColor,
onDisabled,
colorInfo,
colorWarning,
colorSuccess,
colorError,
shadowColor,
onInfo,
onWarning,
onSuccess,
onError;
final Color groceryBg1, groceryBg2;
final Color groceryPrimary, groceryOnPrimary;
final Color medicarePrimary, medicareOnPrimary;
final Color cookifyPrimary, cookifyOnPrimary;
final Color lightBlack,
red,
green,
yellow,
orange,
blue,
purple,
pink,
brown,
violet,
indigo;
CustomAppTheme({
this.bgLayer1 = const Color(0xffffffff),
this.bgLayer2 = const Color(0xfff8faff),
this.bgLayer3 = const Color(0xfff8f8f8),
this.bgLayer4 = const Color(0xffdcdee3),
this.disabledColor = const Color(0xffdcc7ff),
this.onDisabled = const Color(0xffffffff),
this.colorWarning = const Color(0xffffc837),
this.colorInfo = const Color(0xffff784b),
this.colorSuccess = const Color(0xff3cd278),
this.shadowColor = const Color(0xff1f1f1f),
this.onInfo = const Color(0xffffffff),
this.onWarning = const Color(0xffffffff),
this.onSuccess = const Color(0xffffffff),
this.colorError = const Color(0xfff0323c),
this.onError = const Color(0xffffffff),
//Grocery color scheme
this.groceryPrimary = const Color(0xff10bb6b),
this.groceryOnPrimary = const Color(0xffffffff),
this.groceryBg1 = const Color(0xfffbfbfb),
this.groceryBg2 = const Color(0xfff5f5f5),
//Cookify
this.cookifyPrimary = const Color(0xffdf7463),
this.cookifyOnPrimary = const Color(0xffffffff),
//Color
this.lightBlack = const Color(0xffa7a7a7),
this.red = const Color(0xffFF0000),
this.green = const Color(0xff008000),
this.yellow = const Color(0xfffff44f),
this.orange = const Color(0xffFFA500),
this.blue = const Color(0xff0000ff),
this.purple = const Color(0xff800080),
this.pink = const Color(0xffFFC0CB),
this.brown = const Color(0xffA52A2A),
this.indigo = const Color(0xff4B0082),
this.violet = const Color(0xff9400D3),
//Medicare Color Scheme
this.medicarePrimary = const Color(0xff6d65df),
this.medicareOnPrimary = const Color(0xffffffff),
});
static final CustomAppTheme lightCustomAppTheme = CustomAppTheme(
bgLayer1: Color(0xffffffff),
bgLayer2: Color(0xfff9f9f9),
bgLayer3: Color(0xffe8ecf4),
bgLayer4: Color(0xffdcdee3),
disabledColor: Color(0xff636363),
onDisabled: Color(0xffffffff),
colorInfo: Color(0xffff784b),
colorWarning: Color(0xffffc837),
colorSuccess: Color(0xff3cd278),
shadowColor: Color(0xffd9d9d9),
onInfo: Color(0xffffffff),
onSuccess: Color(0xffffffff),
onWarning: Color(0xffffffff),
colorError: Color(0xfff0323c),
onError: Color(0xffffffff),
);
}
class NavigationBarTheme {
Color? backgroundColor,
selectedItemIconColor,
selectedItemTextColor,
selectedItemColor,
selectedOverlayColor,
unselectedItemIconColor,
unselectedItemTextColor,
unselectedItemColor;
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/dbFunctions/SignUpFunctions.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
Future<void> createUser(mobileNumber, nickName, password) async {
CollectionReference refU = FirebaseFirestore.instance.collection('Users');
refU.doc(mobileNumber).set({
"mobilenumber": "$mobileNumber",
"nickname": "$nickName",
"password": "$password",
});
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/dbFunctions/questFunctions.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
Future<void> insertQuestion(userID, name, headline, description) async {
CollectionReference refU = FirebaseFirestore.instance.collection('questions');
refU.add({
"userid": "$userID",
"name": "$name",
"date": Timestamp.now().toDate(),
"headline": "$headline",
"comments": FieldValue.arrayUnion([]),
"description": "$description",
"upvote": 0,
"downvote": 0,
});
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/dbFunctions/AuthFunction.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
Future<bool> checkUserExist(String docID) async {
late bool res;
await FirebaseFirestore.instance
.collection('Users')
.doc(docID)
.get()
.then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
res = true;
} else {
res = false;
}
});
return res;
}
Future<bool> checkLoginCredential(String docID, String password) async {
bool res = false;
await FirebaseFirestore.instance
.collection('Users')
.doc(docID)
.get()
.then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
dynamic data = documentSnapshot.data();
if (data['password'] == password) res = true;
} else {
res = false;
}
});
return res;
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/QuestionCategory.dart
|
import 'package:womentr/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:womentr/screens/Question.dart';
// import 'package:womentr/screens/ViewQuestions.dart';
import '../../AppTheme.dart';
class QuestionCategoryScreen extends StatefulWidget {
@override
_QuestionCategoryScreenState createState() => _QuestionCategoryScreenState();
}
class _QuestionCategoryScreenState extends State<QuestionCategoryScreen> {
late ThemeData themeData;
late CustomAppTheme customAppTheme;
late List<int?> _selected;
@override
void initState() {
super.initState();
_selected = [];
}
Widget build(BuildContext context) {
themeData = Theme.of(context);
customAppTheme = CustomAppTheme.lightCustomAppTheme;
MySize().init(context);
return MaterialApp(
debugShowCheckedModeBanner: false,
home: SafeArea(
child: Scaffold(
body: Column(
children: <Widget>[
Container(
padding: Spacing.fromLTRB(16, 16, 16, 0),
child: Row(
children: <Widget>[
Container(
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(
MdiIcons.chevronLeft,
color: themeData.colorScheme.primaryVariant,
),
),
),
],
),
),
Container(
margin: Spacing.top(48),
child: Text(
"Lets get started. Choose the theme of your question",
style: AppTheme.getTextStyle(themeData.textTheme.bodyText1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
),
Container(
padding: EdgeInsets.only(top: MySize.size12!),
child: Text(
"You can select multiple QuestionThemes",
style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
color: themeData.colorScheme.primaryVariant,
muted: true,
fontWeight: 500),
),
),
Container(
margin: Spacing.fromLTRB(24, 24, 24, 0),
child: GridView.count(
physics: ClampingScrollPhysics(),
shrinkWrap: true,
childAspectRatio: 3.5,
crossAxisCount: 2,
crossAxisSpacing: MySize.size24!,
mainAxisSpacing: MySize.size24!,
children: <Widget>[
QuestionTheme(QuestionTheme: "She Helps", index: 0),
QuestionTheme(QuestionTheme: "Business", index: 1),
QuestionTheme(QuestionTheme: "MotherHood", index: 2),
QuestionTheme(QuestionTheme: "Confessions", index: 3),
QuestionTheme(QuestionTheme: "Finance", index: 4),
QuestionTheme(QuestionTheme: "Education", index: 5),
QuestionTheme(QuestionTheme: "Fitness", index: 6),
QuestionTheme(QuestionTheme: "Fashion", index: 7),
QuestionTheme(QuestionTheme: "Food", index: 8),
QuestionTheme(QuestionTheme: "Random", index: 9),
QuestionTheme(QuestionTheme: "Technology", index: 10),
QuestionTheme(QuestionTheme: "Music and Arts", index: 11),
],
)),
Container(
margin: Spacing.fromLTRB(48, 48, 48, 0),
width: MySize.safeWidth,
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(Spacing.xy(16, 0))),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
QuestionForm(categoryInput: "She Helps")));
},
child: Text(
_selected.isEmpty
? "Select at least one QuestionTheme"
: "NEXT",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
letterSpacing: 0.3,
color: _selected.isEmpty
? customAppTheme.onDisabled
: themeData.colorScheme.onPrimary),
)),
)
],
)),
));
}
Widget QuestionTheme({required String QuestionTheme, int? index}) {
return InkWell(
onTap: () {
if (_selected.contains(index)) {
setState(() {
_selected.remove(index);
});
} else {
setState(() {
_selected.add(index);
});
}
},
child: Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(MySize.size4!)),
border: Border.all(
color: _selected.contains(index)
? themeData.colorScheme.primary
: themeData.colorScheme.primaryVariant,
width: 0.8)),
child: Stack(
children: <Widget>[
Center(
child: Text(
QuestionTheme,
style: AppTheme.getTextStyle(themeData.textTheme.bodyText1,
color: _selected.contains(index)
? themeData.colorScheme.primary
: themeData.colorScheme.primaryVariant,
fontWeight: _selected.contains(index) ? 600 : 500),
)),
_selected.contains(index)
? Positioned(
right: -1,
top: -1,
child: Container(
padding: Spacing.all(2),
decoration: BoxDecoration(
color: themeData.colorScheme.primary,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(MySize.size8!))),
child: Icon(
MdiIcons.check,
color: themeData.colorScheme.onPrimary,
size: MySize.size16,
),
),
)
: Container()
],
),
),
);
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/Profile.dart
|
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import '../../AppTheme.dart';
import '../SizeConfig.dart';
class ProfileScreen extends StatefulWidget {
@override
_ProfileScreenState createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<ProfileScreen> {
bool _passwordVisible = false;
late ThemeData themeData;
Widget build(BuildContext context) {
MySize().init(context);
themeData = Theme.of(context);
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Stack(
children: <Widget>[
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background,
)),
ListView(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: Icon(
MdiIcons.chevronLeft,
color: themeData.colorScheme.primaryVariant,
),
),
),
Container(
margin: EdgeInsets.only(top: MySize.size24!),
alignment: Alignment.center,
child: Column(
children: <Widget>[
Stack(
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: MySize.size16!),
width: MySize.getScaledSizeHeight(140),
height: MySize.getScaledSizeHeight(140),
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"./assets/images/redpanda.png"),
fit: BoxFit.fill),
),
),
Positioned(
bottom: MySize.size12,
right: MySize.size8,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: themeData.scaffoldBackgroundColor,
width: 2,
style: BorderStyle.solid),
color: themeData.colorScheme.onPrimary,
),
child: Padding(
padding: EdgeInsets.all(MySize.size6!),
child: Icon(
MdiIcons.pencil,
size: MySize.size20,
color: themeData.colorScheme.primaryVariant,
),
),
),
)
],
),
Text("Shifu",
style: AppTheme.getTextStyle(
themeData.textTheme.headline4,
fontWeight: 600,
color: Colors.black,
letterSpacing: 0)),
],
),
),
Container(
padding: EdgeInsets.only(
top: MySize.size16!,
left: MySize.size24!,
right: MySize.size24!),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Name",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
letterSpacing: 0.1,
color: Colors.black,
fontWeight: 500),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
filled: true,
fillColor: themeData.colorScheme.onPrimary,
prefixIcon: Icon(
MdiIcons.accountOutline,
color: themeData.colorScheme.primaryVariant,
),
contentPadding: EdgeInsets.all(0),
),
controller:
TextEditingController(text: "Your Nick name"),
textCapitalization: TextCapitalization.sentences,
),
),
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Phone",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
filled: true,
fillColor: themeData.colorScheme.onPrimary,
prefixIcon: Icon(
MdiIcons.phoneOutline,
color: themeData.colorScheme.primaryVariant,
),
contentPadding: EdgeInsets.all(0),
),
keyboardType: TextInputType.emailAddress,
textCapitalization: TextCapitalization.sentences,
controller: TextEditingController(
text: "Your Mobile Number",
),
),
),
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Change Password",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
borderSide: BorderSide.none),
filled: true,
fillColor: themeData.colorScheme.onPrimary,
prefixIcon: Icon(
MdiIcons.lockOutline,
color: themeData.colorScheme.primaryVariant,
),
suffixIcon: IconButton(
icon: Icon(
_passwordVisible
? MdiIcons.eyeOutline
: MdiIcons.eyeOffOutline,
color: themeData.colorScheme.primaryVariant,
),
onPressed: () {
setState(() {
_passwordVisible = !_passwordVisible;
});
},
),
contentPadding: EdgeInsets.all(0),
),
textCapitalization: TextCapitalization.sentences,
obscureText: _passwordVisible,
),
),
Container(
margin: EdgeInsets.only(top: MySize.size24!),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(MySize.size8!)),
boxShadow: [
BoxShadow(
color:
themeData.colorScheme.primary.withAlpha(20),
blurRadius: 3,
offset: Offset(0, 1),
),
],
),
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(
Spacing.xy(16, 0))),
onPressed: () {},
child: Text("UPDATE",
style: AppTheme.getTextStyle(
themeData.textTheme.button,
fontWeight: 600,
color: themeData.colorScheme.onPrimary,
letterSpacing: 0.3))),
),
],
),
),
],
),
],
)));
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.8);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/Question.dart
|
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:womentr/AppTheme.dart';
import 'package:womentr/SizeConfig.dart';
import 'package:image_picker/image_picker.dart';
import 'package:tflite/tflite.dart';
import 'dart:io';
class QuestionForm extends StatefulWidget {
final String categoryInput;
const QuestionForm({Key? key, this.categoryInput: "She Helps"})
: super(key: key);
@override
_QuestionFormState createState() => _QuestionFormState();
}
class _QuestionFormState extends State<QuestionForm> {
final myController = TextEditingController();
late ThemeData themeData;
File? _image;
bool _loading = false;
List<dynamic>? _output;
final _picker = ImagePicker();
pickImage() async {
var image = await _picker.getImage(source: ImageSource.camera);
if (image == null) {
return null;
}
setState(() {
_image = File(image.path);
});
classifyImage(_image);
}
pickGalleryImage() async {
var image = await _picker.getImage(source: ImageSource.gallery);
if (image == null) {
return null;
}
setState(() {
_image = File(image.path);
});
classifyImage(_image);
}
@override
void initState() {
super.initState();
_loading = true;
loadModel().then((value) {
// setState(() {});
});
}
@override
void dispose() {
Tflite.close();
super.dispose();
}
classifyImage(File? image) async {
var output = await Tflite.runModelOnImage(
path: image!.path,
numResults: 2,
threshold: 0.5,
imageMean: 127.5,
imageStd: 127.5,
);
setState(() {
_loading = false;
_output = output;
});
}
loadModel() async {
await Tflite.loadModel(
model: 'assets/images/model_unquant.tflite',
labels: 'assets/images/labels.txt',
);
}
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
return Scaffold(
body: Stack(
children: <Widget>[
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background,
)),
Positioned(
left: MySize.size30,
right: MySize.size30,
top: MediaQuery.of(context).size.height * 0.25,
child: Column(
children: <Widget>[
Card(
child: Container(
padding: EdgeInsets.only(
top: MySize.size16!, bottom: MySize.size16!),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: MySize.size8!),
child: Text(
"Question Here!",
style: AppTheme.getTextStyle(
themeData.textTheme.headline6,
fontWeight: 600),
),
),
Container(
padding: EdgeInsets.only(
left: MySize.size16!,
right: MySize.size16!,
top: MySize.size8!),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Headline",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.chatQuestion),
),
textCapitalization:
TextCapitalization.sentences,
),
),
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Description",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.noteText),
),
keyboardType: TextInputType.number,
),
),
_image == null
? Container(
margin:
EdgeInsets.only(top: MySize.size24!),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(MySize.size24!)),
boxShadow: [
BoxShadow(
color: themeData.colorScheme.primary
.withAlpha(28),
blurRadius: 3,
offset: Offset(0, 1),
),
],
),
child: ElevatedButton(
onPressed: pickGalleryImage,
style: ButtonStyle(
padding: MaterialStateProperty.all(
Spacing.xy(16, 0))),
// onPressed: pickImage,
child: Text("Upload images",
style: AppTheme.getTextStyle(
themeData.textTheme.button,
fontWeight: 600,
color: themeData
.colorScheme.onPrimary))))
: Container(
child: Image.file(_image!),
height: 250.0, // Fixed height for image
),
SizedBox(height: 20.0),
_output != null
? Text('${_output![0]['label']}')
: Container(),
Container(
margin: EdgeInsets.only(top: MySize.size24!),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(MySize.size24!)),
boxShadow: [
BoxShadow(
color: themeData.colorScheme.primary
.withAlpha(28),
blurRadius: 3,
offset: Offset(0, 1),
),
],
),
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(
Spacing.xy(16, 0))),
onPressed: () async {
// await createUser("9856471230","honey","adcsfr");
},
child: Text("Submit",
style: AppTheme.getTextStyle(
themeData.textTheme.button,
fontWeight: 600,
color: themeData
.colorScheme.onPrimary)))),
],
),
)
],
),
),
),
],
),
),
Positioned(
top: MySize.size24!,
left: MySize.size12!,
child: BackButton(
onPressed: () {
Navigator.pop(context);
},
),
)
],
));
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.6);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
// body: Padding(
// padding: const EdgeInsets.all(16.0),
// child: Form(
// child: Column(
// children: [
// TextFormField(
// validator: (value) {
// if (value == null || value.isEmpty) {
// return 'Please enter some text';
// }
// return null;
// },
// ),
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 16.0),
// child: ElevatedButton(
// onPressed: () async {
// await insertQuestion("9876543210","Shifu","ABC","DEF");
// },
// child: const Text('Submit'),
// ),
// ),
// TextField(
// controller: myController,
// ),
// ],
// ),
// ),
// ),
// );
// }
// }
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/LoginScreen.dart
|
import 'package:womentr/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:womentr/screens/HomeScreen.dart';
import '../../AppTheme.dart';
import '../SizeConfig.dart';
import 'RegistrationSreen.dart';
import 'package:womentr/dbFunctions/AuthFunction.dart';
class LoginScreen extends StatefulWidget {
@override
_LoginScreenState createState() => _LoginScreenState();
}
class _LoginScreenState extends State<LoginScreen> {
bool? _passwordVisible = false, _check = false;
late ThemeData themeData;
late TextEditingController controllermobile ;
late TextEditingController controllerpassword ;
@override
void initState() {
controllermobile = TextEditingController();
controllerpassword = TextEditingController();
super.initState();
}
@override
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
return Scaffold(
body: Stack(
children: <Widget>[
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background,
)),
Positioned(
left: 30,
right: 30,
top: MediaQuery.of(context).size.height * 0.15,
child: ListView(
shrinkWrap: true,
children: <Widget>[
Card(
child: Container(
padding: EdgeInsets.only(top: 16, bottom: 16),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(100, 0, 100, 100),
margin: EdgeInsets.only(bottom: MySize.size16!),
width: MySize.getScaledSizeHeight(140),
height: MySize.getScaledSizeHeight(140),
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"./assets/images/WoMentr-Logo.png"),
fit: BoxFit.fill),
),
),
Container(
margin: EdgeInsets.only(bottom: 24, top: 0),
child: Text(
"LOGIN",
style: AppTheme.getTextStyle(
themeData.textTheme.headline6,
fontWeight: 600),
),
),
Container(
padding: EdgeInsets.only(left: 16, right: 16),
child: Column(
children: <Widget>[
TextFormField(
controller: controllermobile,
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Mobile number",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.phone),
),
),
Container(
margin: EdgeInsets.only(top: 16),
child: TextFormField(
controller: controllerpassword,
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Password",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
letterSpacing: 0.1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.lockOutline),
suffixIcon: IconButton(
icon: Icon(_passwordVisible!
? MdiIcons.eyeOutline
: MdiIcons.eyeOffOutline),
onPressed: () {
setState(() {
_passwordVisible = !_passwordVisible!;
});
},
),
),
obscureText: _passwordVisible!,
),
),
Container(
margin: EdgeInsets.only(top: 16),
alignment: Alignment.centerRight,
child: Text("Forgot Password?",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 500)),
),
Container(
alignment: Alignment.centerLeft,
child: Container(
padding: EdgeInsets.only(top: MySize.size20!),
child: Row(
children: <Widget>[
Checkbox(
activeColor:
themeData.colorScheme.primary,
onChanged: (bool? value) {
setState(() {
_check = value;
});
},
value: _check,
visualDensity: VisualDensity.compact,
),
Text("I agree to the terms and conditions.",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 500)),
],
),
),
),
Container(
margin: EdgeInsets.only(top: 16),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(24)),
boxShadow: [
BoxShadow(
color: themeData.colorScheme.primary
.withAlpha(18),
blurRadius: 3,
offset: Offset(0, 1),
),
],
),
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(
Spacing.xy(16, 0))),
onPressed: () async {
if(await checkUserExist(controllermobile.text.toString())){
if(await checkLoginCredential(controllermobile.text.toString(), controllerpassword.text.toString()));
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
HomeScreen()));
}
},
child: Text("LOGIN",
style: AppTheme.getTextStyle(
themeData.textTheme.button,
fontWeight: 600,
color:
themeData.colorScheme.onPrimary,
letterSpacing: 0.5))),
),
],
),
)
],
),
),
),
GestureDetector(
onTap: () {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => SignUpScreen()));
},
child: Container(
margin: EdgeInsets.only(top: 16),
child: Center(
child: RichText(
text: TextSpan(children: <TextSpan>[
TextSpan(
text: "Don't have an Account? ",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 500)),
TextSpan(
text: " SignUp",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 600,
color: themeData.colorScheme.primary)),
]),
),
),
),
)
],
),
),
Positioned(
top: 24,
left: 12,
child: BackButton(
onPressed: () {
Navigator.pop(context);
},
color: themeData.colorScheme.primaryVariant,
),
)
],
));
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.6);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/HomeScreen.dart
|
import 'package:womentr/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:womentr/screens/Profile.dart';
import 'package:womentr/screens/QuestionCategory.dart';
import 'package:womentr/screens/ViewQuestions.dart';
import '../../AppTheme.dart';
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
late ThemeData themeData;
late CustomAppTheme customAppTheme;
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
customAppTheme = CustomAppTheme.lightCustomAppTheme;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Container(
child: Stack(children: <Widget>[
Container(
child: ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.primaryVariant,
)),
),
Scaffold(
floatingActionButton: FloatingActionButton.extended(
backgroundColor: themeData.colorScheme.primary,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QuestionCategoryScreen()));
},
label: Row(
children: [
Icon(
MdiIcons.plus,
color: themeData.colorScheme.onPrimary,
size: MySize.size18,
),
Container(
margin: Spacing.left(4),
child: Text(
"Start Asking",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
color: themeData.colorScheme.onPrimary,
fontWeight: 500),
),
),
],
)),
body: Container(
color: customAppTheme.bgLayer1,
child: ListView(
padding: Spacing.top(48),
children: [
Container(
margin: Spacing.fromLTRB(0, 0, 24, 0),
alignment: Alignment.centerRight,
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: Spacing.fromLTRB(24, 0, 0, 0),
child: Text(
"Hello",
style: AppTheme.getTextStyle(
themeData.textTheme.subtitle1,
xMuted: true,
color: themeData
.colorScheme.primaryVariant),
),
),
Container(
margin: Spacing.left(24),
child: Text(
"Shifu!",
style: AppTheme.getTextStyle(
themeData.textTheme.headline4,
letterSpacing: -0.5,
color: themeData
.colorScheme.primaryVariant,
fontWeight: 700),
),
),
],
),
),
Container(
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(MySize.size8!)),
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ProfileScreen()));
},
child: Container(
margin:
EdgeInsets.only(bottom: MySize.size16!),
width: MySize.getScaledSizeHeight(140),
height: MySize.getScaledSizeHeight(120),
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
"./assets/images/redpanda.png"),
fit: BoxFit.fill),
),
),
),
),
),
],
),
),
Container(
margin: Spacing.fromLTRB(24, 24, 24, 0),
padding: Spacing.horizontal(12),
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
borderRadius: BorderRadius.all(
Radius.circular(MySize.size8!)),
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: 2,
blurRadius: MySize.size10!,
offset: Offset(0, MySize.size8!),
),
]),
child: Row(
children: [
Icon(
MdiIcons.magnify,
color:
themeData.colorScheme.primary.withAlpha(200),
size: MySize.size16,
),
Expanded(
child: Container(
margin: Spacing.left(12),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.caption,
color:
themeData.colorScheme.primaryVariant,
fontWeight: 500),
decoration: InputDecoration(
fillColor: customAppTheme.bgLayer1,
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
color: themeData
.colorScheme.primaryVariant,
muted: true,
fontWeight: 500),
hintText: "Find Answers...",
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
),
textCapitalization:
TextCapitalization.sentences,
),
),
),
],
),
),
Container(
padding: EdgeInsets.only(top: MySize.size22!),
margin: Spacing.fromLTRB(24, 24, 24, 0),
child: Text(
"What shall we discuss today ?!",
style: AppTheme.getTextStyle(
themeData.textTheme.subtitle1,
letterSpacing: -0.15,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600,
muted: true),
),
),
Container(
margin: Spacing.top(24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
child: singleHelpWidget(
iconData: MdiIcons.humanGreeting,
title: "She Helps"),
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return CategoryQuestion(
categoryInput: "She helps");
}));
}),
singleHelpWidget(
iconData: MdiIcons.laptop, title: "Business"),
singleHelpWidget(
iconData: MdiIcons.babyCarriage,
title: "MotherHood")
],
),
),
Container(
margin: Spacing.top(24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
singleHelpWidget(
iconData: MdiIcons.lockOpen,
title: "Confessions"),
singleHelpWidget(
iconData: MdiIcons.cashMarker,
title: "Finance"),
singleHelpWidget(
iconData: MdiIcons.bookEducation,
title: "Education"),
],
),
),
Container(
margin: Spacing.top(24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
singleHelpWidget(
iconData: MdiIcons.meditation,
title: "Fitness"),
singleHelpWidget(
iconData: MdiIcons.shoeHeel, title: "Fashion"),
singleHelpWidget(
iconData: MdiIcons.food, title: "Food"),
],
),
),
Container(
margin: Spacing.top(24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
singleHelpWidget(
iconData: MdiIcons.bagSuitcase,
title: "Travel"),
singleHelpWidget(
iconData: MdiIcons.faceProfileWoman,
title: "Teen"),
singleHelpWidget(
iconData: MdiIcons.music,
title: "Music and Arts")
],
),
),
Container(
margin: Spacing.top(24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
singleHelpWidget(
iconData: MdiIcons.hammerScrewdriver,
title: "Technology"),
singleHelpWidget(
iconData: MdiIcons.dog, title: "Pets"),
singleHelpWidget(
iconData: MdiIcons.heart, title: "Random")
],
),
),
Container(
padding: EdgeInsets.all(MySize.size4!),
)
],
),
)),
]),
));
}
Widget singleHelpWidget(
{IconData? iconData, required String title, Color? color}) {
return Container(
width: (MySize.safeWidth! - MySize.getScaledSizeWidth(96)) / 3,
padding: Spacing.fromLTRB(0, 20, 0, 20),
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
borderRadius: BorderRadius.all(Radius.circular(MySize.size8!)),
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
blurRadius: MySize.size6!,
offset: Offset(0, MySize.size4!))
]),
child: Column(
children: [
Icon(
iconData,
color: color == null ? themeData.colorScheme.primary : color,
size: MySize.size30,
),
Container(
margin: Spacing.top(8),
child: Text(
title,
style: AppTheme.getTextStyle(themeData.textTheme.caption,
letterSpacing: 0,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
),
],
),
);
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.8);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/SpecificQuestion.dart
|
import 'package:womentr/SizeConfig.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import '../../AppTheme.dart';
class SpecificQuestionScreen extends StatefulWidget {
final String headline, author, date;
const SpecificQuestionScreen(
{Key? key,
required this.headline,
required this.author,
required this.date})
: super(key: key);
@override
_SpecificQuestionScreenState createState() => _SpecificQuestionScreenState();
}
class _SpecificQuestionScreenState extends State<SpecificQuestionScreen> {
late ThemeData themeData;
late CustomAppTheme customAppTheme;
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
customAppTheme = CustomAppTheme.lightCustomAppTheme;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Stack(children: [
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background,
)),
Container(
padding: Spacing.all(24),
child: Column(
children: <Widget>[
Container(
margin: Spacing.top(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: MySize.size2,
blurRadius: MySize.size8!,
offset: Offset(0, MySize.size4!))
]),
padding: Spacing.all(12),
child: Icon(
MdiIcons.chevronLeft,
color: themeData.colorScheme.primaryVariant,
size: MySize.size20,
),
),
),
Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: MySize.size2,
blurRadius: MySize.size8!,
offset: Offset(0, MySize.size4!))
]),
),
],
),
),
SizedBox(
height: MySize.size8,
),
Expanded(
child: ListView(
padding: Spacing.fromLTRB(0, 16, 0, 16),
children: [
Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
borderRadius:
BorderRadius.all(Radius.circular(MySize.size24!)),
boxShadow: [
BoxShadow(
color:
customAppTheme.shadowColor.withAlpha(120),
blurRadius: MySize.size24!,
spreadRadius: MySize.size4!)
]),
child: Column(
children: [
ClipRRect(
clipBehavior: Clip.antiAliasWithSaveLayer,
borderRadius: BorderRadius.all(
Radius.circular(MySize.size24!)),
child: Image(
image: AssetImage('./assets/images/redpanda.png'),
),
),
Container(
padding: Spacing.all(16),
child: Column(
children: [
Container(
child: Text(
widget.headline,
style: AppTheme.getTextStyle(
themeData.textTheme.headline6,
color: themeData
.colorScheme.primaryVariant,
fontWeight: 600),
),
),
InkWell(
child: Container(
margin: Spacing.top(16),
child: Row(
children: [
ClipRRect(
clipBehavior:
Clip.antiAliasWithSaveLayer,
borderRadius: BorderRadius.all(
Radius.circular(MySize.size14!)),
child: Image(
image: AssetImage(
'./assets/images/redpanda.png'),
height: MySize.size28,
width: MySize.size28,
),
),
SizedBox(
width: MySize.size16,
),
Text(
widget.author,
style: AppTheme.getTextStyle(
themeData.textTheme.caption,
color: themeData
.colorScheme.primaryVariant,
fontWeight: 600,
xMuted: true),
),
Expanded(child: Container()),
Text(
widget.date,
style: AppTheme.getTextStyle(
themeData.textTheme.caption,
color: themeData
.colorScheme.primaryVariant,
fontWeight: 500,
xMuted: true),
),
],
),
),
)
],
),
),
],
),
),
Row(
children: [
Container(
child: Column(
children: <Widget>[
Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: MySize.size2,
blurRadius: MySize.size8!,
offset: Offset(0, MySize.size4!))
]),
padding: Spacing.all(12),
child: Icon(
MdiIcons.chevronDoubleUp,
color: themeData.colorScheme.primaryVariant,
size: MySize.size20,
),
),
SizedBox(
height: MySize.size40,
),
Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: MySize.size2,
blurRadius: MySize.size8!,
offset: Offset(0, MySize.size4!))
]),
padding: Spacing.all(12),
child: Icon(
MdiIcons.chevronDoubleDown,
color: themeData.colorScheme.primaryVariant,
size: MySize.size20,
),
),
],
),
padding: EdgeInsets.all(10),
),
Flexible(
child: Container(
padding: EdgeInsets.all(MySize.size20!),
margin: Spacing.top(24),
child: Text("I joined my college tech club a month ago. I am capable of doing all" +
"the technical projects and experiments as I have been learning them for 5 years now." +
"But inspite of all the talent I have I am denied a platform to showcase it." +
"People look down at me and it makes me feel down. Sometime I start losing confidence in myself!" +
"Can someone help me how I can over come this...")),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: MySize.size2,
blurRadius: MySize.size8!,
offset: Offset(0, MySize.size4!))
]),
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Try speaking to your college tutor or staffs. They might definitely help you !. Most importantly don't loose self confidence.",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
fontWeight: 600),
),
SizedBox(
height: 8,
),
Text(
"Honey",
style: AppTheme.getTextStyle(
themeData.textTheme.subtitle2,
color:
themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
],
),
),
)
],
),
],
)),
Container(
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: 1,
blurRadius: MySize.size4!,
offset: Offset(0, MySize.size2))
],
borderRadius: BorderRadius.all(Radius.circular(16))),
padding: Spacing.fromLTRB(16, 4, 16, 4),
child: Row(
children: [
Expanded(
child: TextFormField(
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintText: "Write a comment"),
),
),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: themeData.colorScheme.primary.withAlpha(60)),
padding: Spacing.all(8),
child: Icon(
MdiIcons.sendOutline,
color: themeData.colorScheme.primary,
size: MySize.size20,
),
)
],
),
)
],
),
),
])));
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.6);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/RegistrationSreen.dart
|
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:womentr/dbFunctions/SignUpFunctions.dart';
import 'package:womentr/screens/LoginScreen.dart';
import '../../AppTheme.dart';
import '../SizeConfig.dart';
class SignUpScreen extends StatefulWidget {
@override
_SignUpScreenState createState() => _SignUpScreenState();
}
class _SignUpScreenState extends State<SignUpScreen> {
bool _passwordVisible = false;
late ThemeData themeData;
@override
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Stack(
children: <Widget>[
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background,
)),
Positioned(
left: MySize.size30,
right: MySize.size30,
top: MediaQuery.of(context).size.height * 0.25,
child: Column(
children: <Widget>[
Card(
child: Container(
padding: EdgeInsets.only(
top: MySize.size16!, bottom: MySize.size16!),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: MySize.size8!),
child: Text(
"REGISTER",
style: AppTheme.getTextStyle(
themeData.textTheme.headline6,
fontWeight: 600),
),
),
Container(
padding: EdgeInsets.only(
left: MySize.size16!,
right: MySize.size16!,
top: MySize.size8!),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Name",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.accountOutline),
),
textCapitalization:
TextCapitalization.sentences,
),
),
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Number",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.phoneOutline),
),
keyboardType: TextInputType.number,
),
),
Container(
margin: EdgeInsets.only(top: MySize.size16!),
child: TextFormField(
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
decoration: InputDecoration(
hintText: "Password",
hintStyle: AppTheme.getTextStyle(
themeData.textTheme.bodyText1,
color: themeData.colorScheme.primary,
fontWeight: 500),
prefixIcon: Icon(MdiIcons.lockOutline),
suffixIcon: IconButton(
icon: Icon(_passwordVisible
? MdiIcons.eyeOutline
: MdiIcons.eyeOffOutline),
onPressed: () {
setState(() {
_passwordVisible =
!_passwordVisible;
});
},
),
),
obscureText: _passwordVisible,
),
),
Container(
margin:
EdgeInsets.only(top: MySize.size24!),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(MySize.size24!)),
boxShadow: [
BoxShadow(
color: themeData.colorScheme.primary
.withAlpha(28),
blurRadius: 3,
offset: Offset(0, 1),
),
],
),
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(
Spacing.xy(16, 0))),
onPressed: () async {
await createUser(
"9856471230", "honey", "adcsfr");
},
child: Text("REGISTER",
style: AppTheme.getTextStyle(
themeData.textTheme.button,
fontWeight: 600,
color: themeData
.colorScheme.onPrimary)))),
],
),
)
],
),
),
),
GestureDetector(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => LoginScreen()));
},
child: Container(
padding: EdgeInsets.only(
top: MySize.size16!, bottom: MySize.size8!),
child: RichText(
text: TextSpan(children: <TextSpan>[
TextSpan(
text: "I've already an Account? ",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 500)),
TextSpan(
text: " Login",
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
fontWeight: 600,
color: themeData.colorScheme.primary)),
]),
),
),
)
],
),
),
Positioned(
top: MySize.size24!,
left: MySize.size12!,
child: BackButton(
onPressed: () {
Navigator.pop(context);
},
),
)
],
)));
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.6);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr/lib
|
mirrored_repositories/WoMentr/lib/screens/ViewQuestions.dart
|
import 'package:womentr/SizeConfig.dart';
import 'package:flutter/material.dart';
import 'package:womentr/screens/SpecificQuestion.dart';
import '../../AppTheme.dart';
class CategoryQuestion extends StatefulWidget {
final String categoryInput;
const CategoryQuestion({Key? key, required this.categoryInput})
: super(key: key);
@override
_CategoryQuestionState createState() => _CategoryQuestionState();
}
class _CategoryQuestionState extends State<CategoryQuestion> {
late ThemeData themeData;
late CustomAppTheme customAppTheme;
Widget build(BuildContext context) {
themeData = Theme.of(context);
MySize().init(context);
customAppTheme = CustomAppTheme.lightCustomAppTheme;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: SafeArea(
child: Scaffold(
body: Stack(children: [
ClipPath(
clipper: _MyCustomClipper(context),
child: Container(
alignment: Alignment.center,
color: themeData.colorScheme.background.withOpacity(0.5),
)),
ListView(
padding: EdgeInsets.all(24),
children: <Widget>[
Container(
child: Text(
"Hey Shifu,",
style: AppTheme.getTextStyle(themeData.textTheme.subtitle2,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600,
xMuted: true),
),
),
Container(
child: Text(
widget.categoryInput,
style: AppTheme.getTextStyle(themeData.textTheme.headline4,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
),
_singleNews(
author: "Panda",
date: "Aug 15, 2021",
headline: "I feel discriminated in my Tech Club.",
),
_singleNews(
author: "Pooja",
date: "Aug 15, 2021",
headline: "Stalker on Instagram is blackMailing me!",
),
_singleNews(
author: "Jennifer",
date: "Nov 6, 2021",
headline: "My parents aren't allowing me to choose my career",
),
_singleNews(
author: "Puppy",
date: "Mar 12, 2021",
headline: "I am denied the right to education.",
),
_singleNews(
author: "Honey",
date: "Apr 31, 2021",
headline: "My teacher is harassing me!",
),
_singleNews(
author: "Monica",
date: "Aug 15, 2021",
headline: "I strongly doubt my instagram is hacked.",
),
],
),
])),
));
}
_singleNews({
required String headline,
required String author,
required String date,
}) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SpecificQuestionScreen(
headline: headline, author: author, date: date)));
},
child: Container(
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: customAppTheme.bgLayer1,
borderRadius: BorderRadius.all(Radius.circular(MySize.size8!)),
boxShadow: [
BoxShadow(
color: customAppTheme.shadowColor,
spreadRadius: 2,
blurRadius: MySize.size10!,
offset: Offset(0, MySize.size8!),
),
]),
margin: Spacing.top(24),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
headline,
style: AppTheme.getTextStyle(themeData.textTheme.bodyText1,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
SizedBox(
height: 8,
),
Text(
author,
style: AppTheme.getTextStyle(themeData.textTheme.subtitle2,
color: themeData.colorScheme.primaryVariant,
fontWeight: 600),
),
Row(
children: [
Expanded(
child: Text(
date,
style: AppTheme.getTextStyle(
themeData.textTheme.bodyText2,
color: themeData.colorScheme.primaryVariant,
fontSize: 11,
xMuted: true),
)),
Container(
decoration: BoxDecoration(
color: themeData.colorScheme.primaryVariant
.withAlpha(100),
shape: BoxShape.rectangle),
width: 4,
height: 4,
),
],
)
],
),
)
],
),
),
);
}
}
class _MyCustomClipper extends CustomClipper<Path> {
final BuildContext _context;
_MyCustomClipper(this._context);
@override
Path getClip(Size size) {
final path = Path();
Size size = MediaQuery.of(_context).size;
path.lineTo(size.width, 0);
path.lineTo(size.width, size.height * 0.3);
path.lineTo(0, size.height * 0.6);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) {
return false;
}
}
| 0
|
mirrored_repositories/WoMentr
|
mirrored_repositories/WoMentr/test/widget_test.dart
|
// This is a basic Flutter widget test..
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:womentr/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/chatting_app
|
mirrored_repositories/chatting_app/lib/constants.dart
|
import 'package:flutter/material.dart';
const kPrimaryColor = Color(0xFF794B93);
const kSecondaryColor = Color.fromARGB(255, 51, 46, 46);
const kTitle = TextStyle(
color: kPrimaryColor,
fontFamily: 'Nunito',
fontSize: 17.0,
height: 1.5,
fontWeight: FontWeight.bold);
const kSubtitle = TextStyle(
color: kSecondaryColor,
fontFamily: 'Nunito',
fontSize: 15.0,
height: 1.2,
);
| 0
|
mirrored_repositories/chatting_app
|
mirrored_repositories/chatting_app/lib/main.dart
|
import 'package:chatting_app/screen/login/login_screen.dart';
import 'package:chatting_app/screen/splash/splash_screen.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'chatting',
theme: ThemeData(
textTheme: GoogleFonts.nunitoTextTheme(Theme.of(context).textTheme),
primarySwatch: Colors.blue,
),
routes: {
'/splash': (context) => const SplashScreen(),
'/login': (context) => const LoginScreen()
},
initialRoute: '/splash',
);
}
}
| 0
|
mirrored_repositories/chatting_app/lib/screen
|
mirrored_repositories/chatting_app/lib/screen/login/login_screen.dart
|
import 'package:flutter/material.dart';
class LoginScreen extends StatefulWidget {
const LoginScreen({Key? key}) : super(key: key);
@override
State<LoginScreen> createState() => _LoginScreenState();
}
class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('Login'),
),
);
}
}
| 0
|
mirrored_repositories/chatting_app/lib/screen
|
mirrored_repositories/chatting_app/lib/screen/splash/splash_screen.dart
|
import 'package:chatting_app/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({Key? key}) : super(key: key);
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
final int _numPage = 3;
late int _currentPage = 0;
final _pageController = PageController(initialPage: 0);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ElevatedButton(
onPressed: () {
Navigator.pushReplacementNamed(context, '/login');
},
child: Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
children: const <Widget>[
Text(
'Skip',
style: TextStyle(color: Colors.grey),
),
Icon(
Icons.navigate_next_outlined,
color: Colors.grey,
)
],
),
style: ElevatedButton.styleFrom(
primary: Colors.white, elevation: 0),
),
const SizedBox(height: 15),
AnimatedContainer(
duration: const Duration(seconds: 5),
height: 400,
child: PageView(
physics: const ClampingScrollPhysics(),
controller: _pageController,
onPageChanged: (int page) {
setState(() {
_currentPage = page;
});
},
children: [
Padding(
padding: const EdgeInsets.all(30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Spacer(),
Center(
child: SvgPicture.asset(
'assets/images/fast.svg',
height: 250,
width: 300,
),
),
const Spacer(),
const SizedBox(
height: 15,
),
const Text(
'Fast',
style: kTitle,
),
const SizedBox(
height: 15,
),
const Text(
'With this app can fast to send message to your friend',
style: kSubtitle,
)
],
),
),
Padding(
padding: const EdgeInsets.all(30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(
'Secure',
style: kTitle,
),
const SizedBox(height: 15),
const Text(
'Secure your message with encrypted data',
style: kSubtitle,
),
const Spacer(),
Center(
child: SvgPicture.asset(
'assets/images/secure.svg',
height: 250,
width: 300,
),
)
],
),
),
Padding(
padding: const EdgeInsets.all(30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Spacer(),
Center(
child: SvgPicture.asset(
'assets/images/easy.svg',
height: 250,
width: 300,
),
),
const Spacer(),
const SizedBox(
height: 15,
),
const Text(
'Easy',
style: kTitle,
),
const SizedBox(
height: 15,
),
const Text(
'Easy to use with minimalize UI',
style: kSubtitle,
)
],
),
),
],
),
),
const Spacer(),
SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
...List.generate(
_numPage, (index) => buildDot(index, context))
],
),
),
const Spacer(),
Center(
child: ElevatedButton(
onPressed: () {
if (_currentPage == _numPage - 1) {
Navigator.pushReplacementNamed(context, '/login');
}
_pageController.nextPage(
duration: const Duration(microseconds: 500),
curve: Curves.easeIn);
},
style: ElevatedButton.styleFrom(primary: kPrimaryColor),
child: Text((_currentPage == 0) ? 'Get Started' : 'Next')),
)
],
),
),
),
);
}
AnimatedContainer buildDot(int index, BuildContext context) {
return AnimatedContainer(
duration: kThemeAnimationDuration,
height: 10.0,
width: _currentPage == index ? 10 : 10,
margin: const EdgeInsets.only(right: 15.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: _currentPage == index ? kPrimaryColor : kSecondaryColor,
),
);
}
}
| 0
|
mirrored_repositories/chatting_app
|
mirrored_repositories/chatting_app/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:chatting_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/quechainlink
|
mirrored_repositories/quechainlink/lib/global_vars.dart
|
import 'package:flutter/material.dart';
var scaffoldKey = GlobalKey<ScaffoldState>();
| 0
|
mirrored_repositories/quechainlink
|
mirrored_repositories/quechainlink/lib/main.dart
|
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:quechainlink/start/start.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
//change this here
runApp(Start());
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/colors/bluegreen_gradient.dart
|
import 'package:flutter/material.dart';
LinearGradient blueGreenGrad() {
return LinearGradient(colors: [
Color.fromARGB(255, 46, 14, 243),
Color.fromARGB(255, 14, 230, 243),
Color.fromARGB(255, 50, 255, 139),
], begin: Alignment.bottomLeft, end: Alignment.topRight);
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/colors/colours_list.dart
|
import 'package:flutter/material.dart';
//main colours
const bg = Color.fromARGB(255, 44, 41, 72);
const containerback = Color.fromARGB(255, 142, 73, 255);
const brightpink = Color.fromARGB(255, 255, 8, 186);
const brightpink1 = Color.fromARGB(255, 253, 0, 97);
const textpurple = Color.fromARGB(255, 72, 47, 246);
const orangetext = Color.fromARGB(255, 246, 161, 47);
const gold = Color.fromARGB(255, 253, 229, 124);
const greenpastel = Color.fromARGB(255, 113, 185, 146);
const tabicon = Color.fromARGB(255, 252, 0, 165);
const tabBar = Color.fromARGB(255, 93, 55, 255);
//helpful for text and errors!!
const filltext = Color.fromARGB(255, 82, 83, 137);
const textgreyblue = Color.fromARGB(255, 53, 53, 61);
const textturq = Color.fromARGB(255, 60, 190, 200);
const errorcolor = Color.fromARGB(255, 253, 0, 84);
const lightpink = Color.fromARGB(255, 221, 208, 243);
const logout = Color.fromARGB(255, 11, 16, 137);
const textturq2 = Color.fromARGB(255, 109, 255, 238);
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/colors/grey_gradient.dart
|
import 'package:flutter/material.dart';
LinearGradient greyGrad() {
return LinearGradient(colors: [
Color.fromARGB(255, 56, 56, 73),
Color.fromARGB(255, 109, 109, 156)
], begin: Alignment.bottomRight, end: Alignment.topLeft);
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/colors/bluepurple_gradient.dart
|
import 'package:flutter/material.dart';
LinearGradient bluePurpleGrad() {
return LinearGradient(colors: [
Color.fromARGB(255, 65, 29, 255),
Color.fromARGB(255, 93, 20, 253),
Color.fromARGB(255, 121, 20, 238),
], begin: Alignment.bottomLeft, end: Alignment.topRight);
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/wait_times_page.dart
|
import 'package:flutter/material.dart';
import 'package:quechainlink/containers/comingsoon_container.dart';
class WaitTimesPage extends StatefulWidget {
WaitTimesPage({Key? key}) : super(key: key);
@override
State<WaitTimesPage> createState() => _WaitTimesPageState();
}
class _WaitTimesPageState extends State<WaitTimesPage> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
//put boxes here!
SizedBox(
height: 100,
),
ComingSoon(
boomtitle: "Thank you for booking!!",
)
],
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/loginpage.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_signin_button/flutter_signin_button.dart';
import 'package:get/get.dart';
import 'package:quechainlink/auth/getx_authlogincontroller.dart';
import 'package:quechainlink/colors/bluegreen_gradient.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:quechainlink/start/start.dart';
class LoginPage extends StatefulWidget {
LoginPage({Key? key}) : super(key: key);
@override
State<LoginPage> createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
final controller = Get.put(AuthLoginController());
bool _loggedIn = true;
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: bg,
//this next part has a terinary operator. If the person is loggedin it will show user information, otherwise they are asked to log in with their google account. The ? indicates a terinary condition.
body: Container(
child: _loggedIn
? Start()
:
//this is what occurs if the user is not logged in. It prompts them to login with their google account
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
child: Container(
padding: EdgeInsets.fromLTRB(15, 20, 15, 5),
decoration: BoxDecoration(
gradient: blueGreenGrad(),
borderRadius: BorderRadius.circular(25),
),
child: Column(
children: [
Text(
'No need to register, just sign in with Google!',
style: TextStyle(
color: gold,
fontSize: 20,
fontFamily: 'gogh',
fontWeight: FontWeight.w200,
),
),
SizedBox(
height: 20,
),
SignInButton(
Buttons.Google,
padding: EdgeInsets.all(5),
text: "Sign in with Google",
onPressed: () {
controller.googlelogin();
},
)
],
),
),
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/peoplepage.dart
|
import 'package:flutter/material.dart';
import 'package:quechainlink/containers/listingcontainer.dart';
//the page shows view of avaiable people to book
class PeoplePage extends StatefulWidget {
PeoplePage({Key? key}) : super(key: key);
@override
State<PeoplePage> createState() => _PeoplePageState();
}
class _PeoplePageState extends State<PeoplePage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: 10,
),
// add info boxes here
ItemContainer(
imgurl:
"https://firebasestorage.googleapis.com/v0/b/quechainlink.appspot.com/o/woman1.jpeg?alt=media&token=187682b8-5207-40f7-992d-fb2bca892a67",
deliverfee: "\$30 per hour",
name: "Janelle"),
SizedBox(
height: 10,
),
ItemContainer(
imgurl:
"https://firebasestorage.googleapis.com/v0/b/quechainlink.appspot.com/o/moonrisewoman.jpeg?alt=media&token=575ca11c-394b-4a69-939c-c46b8f8db42f",
deliverfee: "\$30 per hour",
name: "Julia")
],
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/info_on_app_page.dart
|
import 'package:flutter/material.dart';
import 'package:quechainlink/containers/comingsoon_container.dart';
class InfoAboutApp extends StatefulWidget {
InfoAboutApp({Key? key}) : super(key: key);
@override
State<InfoAboutApp> createState() => _InfoAboutAppState();
}
class _InfoAboutAppState extends State<InfoAboutApp> {
@override
Widget build(BuildContext context) {
return Column(
children: [
//add boxes here
SizedBox(
height: 100,
),
ComingSoon(
boomtitle: "About this dapp",
),
],
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/peoplepage_alt.dart
|
//the alternative people page view
import 'package:flutter/material.dart';
import 'package:quechainlink/containers/listingcontainer.dart';
class PeoplePageAlt extends StatefulWidget {
PeoplePageAlt({Key? key}) : super(key: key);
@override
_PeoplePageAltState createState() => _PeoplePageAltState();
}
class _PeoplePageAltState extends State<PeoplePageAlt> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
ItemContainer(
imgurl:
"https://cdn.shopify.com/s/files/1/1195/0530/products/gif5.gif?v=1591196593",
name: "Fibre optic mask",
deliverfee: "\$25"),
SizedBox(
height: 20,
),
ItemContainer(
imgurl:
"https://firebasestorage.googleapis.com/v0/b/swooncustomer.appspot.com/o/IMG_5041.jpeg?alt=media&token=2396ebf0-2b24-41e3-b6be-a26f2f539a48",
deliverfee: "\$25",
name: "Bitcoin fancy coin"),
SizedBox(
height: 20,
),
ItemContainer(
imgurl:
'https://firebasestorage.googleapis.com/v0/b/swooncustomer.appspot.com/o/MYmask4.gif?alt=media&token=caf7c17b-f183-4927-bb37-6ae50550ef3b',
name: "Menstrual Cup",
deliverfee: "\$10"),
SizedBox(
height: 20,
),
],
),
));
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/detailspage.dart
|
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_navigation/get_navigation.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:quechainlink/containers/comingsoon_container.dart';
import 'package:quechainlink/containers/info_container.dart';
class DetailsPage extends StatelessWidget {
// final String imgUrl;
final String imgUrl;
const DetailsPage({required this.imgUrl});
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: bg,
body: SingleChildScrollView(
child: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
SizedBox(
width: size.width,
child: Image(
image: NetworkImage(imgUrl), fit: BoxFit.cover),
),
SizedBox(
height: 10,
),
Info(
boomtitle: "book me",
subtitle: "get an NFT for a 5 hour booking",
passportoffice:
"Passport Office: 74 Victoria st Toronto",
),
SizedBox(
height: 20,
),
ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all<Color>(tabicon),
),
onPressed: () {
Get.toNamed("/booking");
},
child: Text("press here to book"),
),
],
),
),
//put things here?
],
),
SafeArea(
child: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.backspace,
color: Color.fromARGB(255, 247, 0, 97),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/pages/booking_page.dart
|
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:web3dart/web3dart.dart';
//this page incorperates the web3dart smart contracts. This project is currently hard coded, but that will change
class BookingPage extends StatefulWidget {
BookingPage({Key? key}) : super(key: key);
@override
State<BookingPage> createState() => _BookingPageState();
}
class _BookingPageState extends State<BookingPage> {
late Client httpClient;
late Web3Client ethClient;
//my metamask address here
final myAddress = "0x2997E634855532D8ba9886D6912Dc274372c3D42";
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: bg,
body: SingleChildScrollView(
child: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
//stuff here
],
),
),
],
),
SafeArea(
child: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.backspace,
color: Color.fromARGB(255, 247, 0, 97),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/models/user.dart
|
class LoginUserModel {
String? displayName;
String? email;
String? photoUrl;
String? uid;
LoginUserModel({this.displayName, this.email, this.photoUrl, this.uid});
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/bars/plainappbar.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:quechainlink/colors/bluepurple_gradient.dart';
import 'package:quechainlink/colors/colours_list.dart';
AppBar plainBar(BuildContext context) {
return AppBar(
//these icons will be added later
// leading: Padding(
// padding: EdgeInsets.all(5),
// child: IconButton(
// icon: Icon(Icons.menu),
// onPressed: () => scaffoldKey.currentState!.openDrawer(),
// )),
actions: [
// Padding(
// padding: const EdgeInsets.only(right: 15),
// child: IconButton(
// icon: Icon(
// Icons.shopping_bag_rounded,
// color: Colors.purpleAccent[60],
// size: 30,
// ),
// onPressed: () {
// bottomSheet(context);
// },
// ),
// ),
],
flexibleSpace: ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
child: Container(
decoration: BoxDecoration(
gradient: bluePurpleGrad(),
),
),
),
elevation: 16,
shadowColor: bg,
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
//set size of appbar. This is sort of big
bottom: PreferredSize(
preferredSize: Size.fromHeight(70),
child: Stack(
children: [
Text(
"Que",
style: GoogleFonts.coiny(
textStyle: TextStyle(
color: lightpink,
fontWeight: FontWeight.w400,
fontSize: 40,
shadows: [
Shadow(
offset: Offset(6.0, 8.0),
blurRadius: 8.0,
color: Color.fromARGB(255, 33, 29, 29).withOpacity(0.5),
),
],
),
),
),
],
),
),
);
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/bars/logoutbutton.dart
|
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:quechainlink/auth/getx_authlogincontroller.dart';
import 'package:quechainlink/colors/colours_list.dart';
TextButton logoutButton(BuildContext context) {
return TextButton(
//the logout button
child: Text(
'Logout',
style:
TextStyle(color: logout, fontSize: 20, fontWeight: FontWeight.w700),
),
onPressed: () {
//this will log user out!
final provider = Provider.of<AuthLoginController>(context, listen: false);
provider.googleSignin.signOut();
},
);
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/bars/bottomsheet.dart
|
import 'package:flutter/material.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:quechainlink/containers/logincontainer.dart';
Future<dynamic> bottomSheet(BuildContext context) async {
return showModalBottomSheet(
backgroundColor: bg,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
),
context: context,
builder: (BuildContext context) {
//the pink/purple container that hosts the login
return LoginContainer();
//must return something here so yeah, just replace once you know what to do!
});
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/bars/curvednav_icons.dart
|
import 'package:flutter/material.dart';
import 'package:icofont_flutter/icofont_flutter.dart';
List<Widget> bottomNavIcons() {
return <Widget>[
Icon(
IcoFontIcons.infoCircle,
size: 30,
color: Colors.black,
),
Icon(
IcoFontIcons.people,
size: 30,
color: Colors.black,
),
Icon(
IcoFontIcons.circledUp,
size: 30,
color: Colors.black,
)
];
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/auth/loginservice.dart
|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:quechainlink/models/user.dart';
//from https://github.com/romanejaquez/orilla_fresca_app/blob/master/lib/services/loginservice.dart roman codes this was best tut i could find
class LoginService extends ChangeNotifier {
LoginUserModel? _userModel;
LoginUserModel? get loggedInUserModel => _userModel;
Future<bool> signInWithGoogle() async {
// Trigger the authentication flow
GoogleSignIn googleSignIn = GoogleSignIn();
final GoogleSignInAccount? googleUser = await googleSignIn.signIn();
if (googleUser == null) {
return false;
}
// Obtain the auth details from the request
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
// Create a new credential
final GoogleAuthCredential credential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
) as GoogleAuthCredential;
// Once signed in, return the UserCredential
UserCredential userCreds =
await FirebaseAuth.instance.signInWithCredential(credential);
_userModel = LoginUserModel(
uid: userCreds.user!.uid,
displayName: userCreds.user!.displayName,
photoUrl: userCreds.user!.photoURL,
email: userCreds.user!.email);
notifyListeners();
return true;
}
Future<void> signOut() async {
await GoogleSignIn().signOut();
_userModel = null;
}
bool isUserLoggedIn() {
return _userModel != null;
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/auth/getx_authlogincontroller.dart
|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:get/get.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:quechainlink/models/user.dart';
//not currently in use
class AuthLoginController extends GetxController {
LoginUserModel? _userModel;
final googleSignin = GoogleSignIn();
final secureStorage = FlutterSecureStorage();
var googleAccount = Rx<GoogleSignInAccount?>(null);
// var fbSig = FacebookLogin();
// var fbAcc = Rx<FacebookLoginResult?>(null);
googlelogin() async {
googleAccount.value = await googleSignin.signIn();
secureStorage.write(key: 'email', value: googleSignin.currentUser?.email);
// print(googleSignin.currentUser!.email);
}
Future<String?> getToken() async {}
// facebookSignIn() async {
// fbAcc.value = await fbSig.logIn();
// }
}
//This class is not in use! google login controller
class GoogleSignInProvider extends ChangeNotifier {
final googleSignIn = GoogleSignIn();
GoogleSignInAccount? _user;
GoogleSignInAccount get user => _user!;
Future googleLogin2() async {
final googleUser = await googleSignIn.signIn();
if (googleUser == null) return;
_user = googleUser;
final googleAuth = await googleUser.authentication;
final cred = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
await FirebaseAuth.instance.signInWithCredential(cred);
notifyListeners();
}
Future googlelogout() async {
final logout = await googleSignIn.signOut();
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/auth/login_controller.dart
|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:quechainlink/pages/loginpage.dart';
import 'package:quechainlink/start/start.dart';
//not currentlyt in use
class LoginController extends StatelessWidget {
const LoginController({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: FirebaseAuth.instance.authStateChanges(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasData) {
//what this call does: presents the main page if user is logged in, if not then goes to login page
return Start();
} else if (snapshot.hasError) {
return Text("error");
} else {
return LoginPage();
}
},
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/containers/comingsoon_container.dart
|
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:url_launcher/url_launcher.dart';
//this will be the coming soon container
class ComingSoon extends StatefulWidget {
final String boomtitle;
ComingSoon({
Key? key,
required this.boomtitle,
}) : super(key: key);
@override
_ComingSoonState createState() => _ComingSoonState();
}
class _ComingSoonState extends State<ComingSoon> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Stack(
children: <Widget>[
Padding(
//This is the padding around the box
padding: const EdgeInsets.fromLTRB(15, 2, 15, 15),
child: Container(
padding: EdgeInsets.only(
//This is the padding around the text!
left: 15,
top: 10,
right: 16,
bottom: 5),
width: 400,
margin: EdgeInsets.only(top: 16),
decoration: _decor(),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_boomTitle(),
_textTitle(),
],
),
),
),
],
),
);
}
//the box color and design
BoxDecoration _decor() {
return BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: textgreyblue,
boxShadow: [
BoxShadow(
color: Color.fromARGB(255, 98, 21, 255),
offset: Offset(11, 10),
blurRadius: 75),
]);
}
Align _boomTitle() {
return Align(
alignment: Alignment.topCenter,
child: Text(
widget.boomtitle,
style: GoogleFonts.rampartOne(fontSize: 30, color: lightpink),
textAlign: TextAlign.center,
),
);
}
Align _textTitle() {
return Align(
alignment: Alignment.center,
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
children: [
TextSpan(
text:
"This is a dapp that allows you to book people to wait in lines for you. This is very much gig economy for dealing with long lines. Bookings are for 5 hour blocks. You will get an NFT of your booking. Hopefully this dapp will evolve into a real world thing! Here is my email: ",
style: GoogleFonts.marmelad(fontSize: 24, color: orangetext),
),
TextSpan(
text: "email me",
style: GoogleFonts.carterOne(fontSize: 18, color: tabicon),
recognizer: TapGestureRecognizer()
..onTap = (() => launch("mailto:jpak04442GMAIL.COM")),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/containers/info_container.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:quechainlink/colors/colours_list.dart';
class Info extends StatefulWidget {
final String boomtitle;
final String subtitle;
final String passportoffice;
Info({
Key? key,
required this.boomtitle,
required this.subtitle,
required this.passportoffice,
}) : super(key: key);
@override
_InfoState createState() => _InfoState();
}
class _InfoState extends State<Info> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Stack(
children: <Widget>[
Padding(
//This is the padding around the box
padding: const EdgeInsets.fromLTRB(15, 2, 15, 15),
child: Container(
padding: EdgeInsets.only(
//This is the padding around the text!
left: 15,
top: 10,
right: 16,
bottom: 5),
width: 400,
margin: EdgeInsets.only(top: 16),
decoration: _decor(),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_boomTitle(),
_textTitle(),
_passportOffice(),
],
),
),
),
],
),
);
}
//the box color and design
BoxDecoration _decor() {
return BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: textgreyblue,
boxShadow: [
BoxShadow(
color: Color.fromARGB(255, 98, 21, 255),
offset: Offset(11, 10),
blurRadius: 75),
],
);
}
Align _boomTitle() {
return Align(
alignment: Alignment.topCenter,
child: Text(
widget.boomtitle,
style: GoogleFonts.fredokaOne(
fontSize: 28,
color: tabicon,
),
textAlign: TextAlign.center,
),
);
}
Align _textTitle() {
return Align(
alignment: Alignment.center,
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
children: [
TextSpan(
text: widget.subtitle,
style: GoogleFonts.indieFlower(
color: gold,
fontSize: 20,
fontWeight: FontWeight.w300,
),
),
],
),
),
);
}
Align _passportOffice() {
return Align(
alignment: Alignment.topCenter,
child: Text(
widget.passportoffice,
style: GoogleFonts.kalam(
fontSize: 18, color: textturq, fontWeight: FontWeight.w400),
textAlign: TextAlign.center,
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/containers/logincontainer.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_signin_button/flutter_signin_button.dart';
import 'package:get/get.dart';
import 'package:quechainlink/auth/getx_authlogincontroller.dart';
import 'package:quechainlink/colors/colours_list.dart';
class LoginContainer extends StatelessWidget {
final controller = Get.put(AuthLoginController());
LoginContainer({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Obx(() {
// if (controller.user.serverAuthCode == null) {
if (controller.googleAccount() == null) {
return getLogin();
} else {
return welcome();
}
});
//decoration: BoxDecoration(gradient: gradSheet()),
}
//if the user is logged in present this column. Will be cart
Column welcome() {
return Column(
children: [
Text(
"Hello ${controller.googleAccount.value?.displayName} ",
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.w800,
color: brightpink,
),
),
],
);
}
//if user is not logged in show this column to get them logged in
Column getLogin() {
return Column(
children: [
Text(
'Login to shop with us',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.w800,
color: gold,
),
),
SizedBox(height: 10),
SignInButton(
Buttons.Google,
text: "Sign in with Google",
onPressed: () {
controller.googlelogin();
},
),
SizedBox(height: 10),
],
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/containers/listingcontainer.dart
|
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:quechainlink/colors/colours_list.dart';
class ItemContainer extends StatefulWidget {
// final String deliveryfee;
ItemContainer({
Key? key,
required this.imgurl,
//this is the item fee not delivery per se!
required this.deliverfee,
required this.name,
}) : super(key: key);
final String deliverfee;
final String imgurl;
final String name;
@override
_ItemContainerState createState() => _ItemContainerState();
}
class _ItemContainerState extends State<ItemContainer> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Get.toNamed("/details", arguments: widget.imgurl);
//nav over to the details page.
//Navigator.of(context).pushNamed('/details', arguments: widget.imgurl);
},
child: Container(
margin: EdgeInsets.fromLTRB(15, 5, 15, 5),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Material(
borderRadius: BorderRadius.circular(10),
color: containerback,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Stack(
children: <Widget>[
Image(
height: 200,
width: 400,
image: NetworkImage(widget.imgurl),
fit: BoxFit.cover),
Positioned(
left: 0,
top: 10,
child: ClipRRect(
clipBehavior: Clip.hardEdge,
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Color.fromARGB(255, 255, 0, 161),
borderRadius: BorderRadius.circular(8)),
child: Text(
widget.deliverfee,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
),
),
),
],
),
Container(
padding: EdgeInsets.all(5.0),
child: Column(
children: <Widget>[
Text(
widget.name,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w800,
fontFamily: 'Candy',
color: Colors.white),
),
SizedBox(
height: 5.0,
),
Text(
"Passport office: 74 victoria st, Toronto",
style: TextStyle(color: Colors.white),
),
SizedBox(
height: 4.0,
),
],
),
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/start/app_setting.dart
|
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
import 'package:flutter/material.dart';
import 'package:quechainlink/bars/curvednav_icons.dart';
import 'package:quechainlink/bars/plainappbar.dart';
import 'package:quechainlink/colors/colours_list.dart';
import 'package:quechainlink/global_vars.dart';
import 'package:quechainlink/pages/peoplepage.dart';
import 'package:quechainlink/pages/wait_times_page.dart';
import 'package:quechainlink/pages/info_on_app_page.dart';
class AppSetUp extends StatefulWidget {
AppSetUp({Key? key}) : super(key: key);
@override
_AppSetUpState createState() => _AppSetUpState();
}
// int _selectedDestination = 0;
class _AppSetUpState extends State<AppSetUp> {
//this directs to the shopping page
int selectedpage = 1;
//list of pages that one can navigate to using the navbar
final _pageOptions = [
InfoAboutApp(),
PeoplePage(),
WaitTimesPage(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
drawerEnableOpenDragGesture: false,
//drawer: LoggedInDrawer(),
backgroundColor: bg,
appBar: plainBar(context),
resizeToAvoidBottomInset: true,
body: _pageOptions[selectedpage],
bottomNavigationBar: buildCurvedNavigationBar(),
);
}
//the nav bar at the bottom
CurvedNavigationBar buildCurvedNavigationBar() {
return CurvedNavigationBar(
index: selectedpage,
buttonBackgroundColor: tabicon,
color: tabicon,
backgroundColor: bg.withOpacity(1.0),
animationCurve: Curves.linearToEaseOut,
items: bottomNavIcons(),
onTap: (index) {
setState(() {
selectedpage =
index; // changing selected page as per bar index selected by the user
});
},
);
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/start/route_generator.dart
|
import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:quechainlink/pages/booking_page.dart';
import 'package:quechainlink/pages/info_on_app_page.dart';
import 'package:quechainlink/pages/detailspage.dart';
import 'package:quechainlink/pages/peoplepage.dart';
import 'package:quechainlink/start/start.dart';
//routes for when you click
class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings) {
// Getting arguments passed in while calling Navigator.pushNamed
final args = settings.arguments;
switch (settings.name) {
case '/':
return GetPageRoute(
page: () => Start(),
);
case '/cool':
return GetPageRoute(
page: () => InfoAboutApp(),
);
case '/listofpeople':
return GetPageRoute(
page: () => PeoplePage(),
);
case '/booking':
return GetPageRoute(
page: () => BookingPage(),
);
case '/details':
// Validation of correct data type
if (args is String) {
return GetPageRoute(
page: () => DetailsPage(
imgUrl: args,
),
);
}
// If args is not of the correct type, return an error page.
// You can also throw an exception while in development.
return _errorRoute();
default:
// If there is no such named route in the switch statement, e.g. /third
return _errorRoute();
}
}
static Route<dynamic> _errorRoute() {
return MaterialPageRoute(builder: (_) {
return Scaffold(
body: Center(
child: Text('ERROR'),
),
);
});
}
}
| 0
|
mirrored_repositories/quechainlink/lib
|
mirrored_repositories/quechainlink/lib/start/start.dart
|
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:quechainlink/start/app_setting.dart';
import 'package:quechainlink/start/route_generator.dart';
//this is the general setup for the app. it provides the general frame that is used.
class Start extends StatefulWidget {
Start({Key? key}) : super(key: key);
@override
State<Start> createState() => _StartState();
}
class _StartState extends State<Start> {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
debugShowCheckedModeBanner: false,
home: GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
},
child: AppSetUp(),
),
initialRoute: '/',
onGenerateRoute: RouteGenerator.generateRoute,
);
}
//bottom pop up sheet for login or whatever. not currently in use.
// Future<dynamic> bottomSheet(BuildContext context) {
// return showModalBottomSheet(
// backgroundColor: bg,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(22),
// ),
// context: context,
// builder: (BuildContext context) {
// //the pink/purple container that hosts the login
// //return LoginContainer();
// return Text('need to replace asap julia');
// });
// }
//the curved nav bar at the bottom screen
}
| 0
|
mirrored_repositories/quechainlink
|
mirrored_repositories/quechainlink/test/widget_test.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:quechainlink/start/start.dart';
//for flutter ui front end
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(Start());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Flutter-Foodee-App
|
mirrored_repositories/Flutter-Foodee-App/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/login_screen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const AuthScreen(),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/widgets/my_cart_items.dart
|
import 'package:flutter/material.dart';
class MyCartItems extends StatefulWidget {
final String imgPath;
final String text;
final String text1;
final String text2;
const MyCartItems({
Key? key,
required this.imgPath,
required this.text,
required this.text1,
required this.text2,
required double screenWidth,
}) : super(key: key);
@override
_MyCartItemsState createState() => _MyCartItemsState();
}
class _MyCartItemsState extends State<MyCartItems> {
int quantity = 1;
void incrementQuantity() {
setState(() {
quantity++;
});
}
void decrementQuantity() {
if (quantity > 1) {
setState(() {
quantity--;
});
}
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 80,
width: 80,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 3), // changes position of shadow
),
],
),
child: Image.asset(widget.imgPath),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(widget.text),
Text(widget.text1),
Text(widget.text2),
],
),
Row(
children: [
IconButton(
onPressed: incrementQuantity,
icon: Icon(Icons.add),
),
Text('$quantity'),
IconButton(
onPressed: decrementQuantity,
icon: Icon(Icons.remove),
),
],
),
],
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/widgets/mini_banners.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/detail_screen.dart';
class MiniBanners extends StatelessWidget {
final String text;
final String imgPath;
final Color containerColor;
const MiniBanners(
{super.key,
required this.text,
required this.imgPath,
required this.containerColor});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => DetailScreen(imgPath: imgPath, text: text),
));
},
child: Stack(
children: [
Container(
child: Column(
children: [
Text(text),
Padding(
padding: const EdgeInsets.only(top: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(imgPath),
],
),
),
],
),
height: 128,
width: 105,
decoration: BoxDecoration(
color: containerColor, borderRadius: BorderRadius.circular(28)),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/widgets/banners.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/detail_screen.dart';
import 'package:google_fonts/google_fonts.dart';
class Banners extends StatelessWidget {
final String imgPath;
final String text1;
final String text2;
final Color containerColor;
const Banners(
{super.key,
required this.imgPath,
required this.text1,
required this.text2,
required this.containerColor});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => DetailScreen(
imgPath: imgPath,
text: text1,
),
));
},
child: Stack(
children: [
Padding(
padding: const EdgeInsets.only(top: 20),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
color: containerColor),
height: 108,
width: 300,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 40),
child: Text(
text1,
style: GoogleFonts.poppins(
color: Colors.white, fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 60),
child: Text(
text2,
style: GoogleFonts.poppins(
color: Colors.white,
),
),
),
Padding(
padding: const EdgeInsets.only(left: 170),
child: Image.asset(
imgPath,
height: 100,
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/widgets/flavors.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class Flavors extends StatelessWidget {
final String imgPath;
final String text1;
final String text2;
const Flavors(
{super.key,
required this.imgPath,
required this.text1,
required this.text2});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Color(0xfffFFFFF2), borderRadius: BorderRadius.circular(28)),
height: 170,
width: 100,
child: Column(
children: [
SizedBox(height: 10),
Image.asset(imgPath),
Text(
text1,
style: GoogleFonts.aBeeZee(),
),
Text(
text2,
style: GoogleFonts.aBeeZee(),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/Screens/main_screen.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/home_screen.dart';
import 'package:foodee_app/Screens/my_cart_screen.dart';
import 'package:foodee_app/Screens/profile_screen.dart';
class MainScreen extends StatefulWidget {
const MainScreen({super.key});
@override
State<MainScreen> createState() => _MainScreenState();
}
class _MainScreenState extends State<MainScreen> {
int myIndex = 0;
List<Widget> WidgetList = const [
HomeScreen(),
MyCartScreen(),
ProfileScreen(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: Color(0xfffF49392),
unselectedItemColor: Color(0xfffB6D7CF),
currentIndex: myIndex,
onTap: (index) {
setState(() {
myIndex = index;
});
},
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
icon: Icon(
Icons.home_outlined,
size: 40,
),
label: ''),
BottomNavigationBarItem(
icon: Icon(
Icons.shopping_bag,
size: 40,
),
label: ''),
BottomNavigationBarItem(
icon: Icon(
Icons.person,
size: 40,
),
label: ''),
]),
body: Center(
child: WidgetList[myIndex],
));
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/Screens/profile_screen.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/main_screen.dart';
import 'package:google_fonts/google_fonts.dart';
class ProfileScreen extends StatelessWidget {
const ProfileScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'Profile',
style: GoogleFonts.aBeeZee(),
),
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CircleAvatar(
radius: 50,
backgroundImage: AssetImage('assets/images/profile.jpg'),
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => MainScreen(),
));
},
child: Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xfffF5CAC3),
borderRadius: BorderRadius.circular(12)),
child: Icon(
Icons.close,
color: Color(0xfffF28482),
),
),
),
],
),
SizedBox(height: 20),
Text(
'Haider',
style: GoogleFonts.aBeeZee(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
Text(
'haider@gmail.com',
style: TextStyle(
fontSize: 18,
),
),
SizedBox(height: 40),
Text(
'Account Information',
style: GoogleFonts.aBeeZee(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/edit_profile');
},
child: ListTile(
title: Text('Edit Profile'),
trailing: Icon(Icons.edit),
),
),
SizedBox(height: 15),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/change_password');
},
child: ListTile(
title: Text('Change Password'),
trailing: Icon(Icons.lock),
),
),
SizedBox(height: 15),
ElevatedButton(
onPressed: () {
Navigator.pushNamedAndRemoveUntil(
context, '/login', (route) => false);
},
child: ListTile(
title: Text('Logout'),
trailing: Icon(Icons.exit_to_app),
),
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/Screens/home_screen.dart
|
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:foodee_app/widgets/banners.dart';
import 'package:foodee_app/widgets/mini_banners.dart';
import 'package:google_fonts/google_fonts.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xfffFFFFFF),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(15.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 60,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Color.fromARGB(255, 255, 245, 186),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
CircleAvatar(
child: Container(
height: 60,
width: 60,
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: Image.asset(
'assets/images/profile.jpg',
fit: BoxFit.cover,
),
),
),
),
SizedBox(width: 16),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Welcome Back Haider',
style: GoogleFonts.aBeeZee(),
),
Text(
'How much hungry are you?',
style: GoogleFonts.aBeeZee(),
),
],
),
],
),
),
),
SizedBox(height: 25),
Container(
height: 50,
child: TextField(
decoration: InputDecoration(
suffixIcon: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Color(0xfffF28482),
),
child: Icon(
Icons.line_style,
color: Colors.white,
),
),
hintStyle: TextStyle(height: 1.4),
prefixIcon: Icon(Icons.search),
hintText: 'Search',
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xfffF5F5F5)),
borderRadius: BorderRadius.circular(12),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xfffF5F5F5)),
borderRadius: BorderRadius.circular(12),
),
filled: true,
fillColor: Color(0xfffF5F5F5),
),
),
),
SizedBox(height: 30),
Row(
children: [
Text(
'Today\'s Menu',
style: GoogleFonts.aBeeZee(
fontSize: 30,
fontWeight: FontWeight.w400,
),
),
],
),
SizedBox(height: 0),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
Banners(
containerColor: Color(0xfff84A59D),
imgPath: 'assets/images/donut.png',
text1: 'Free Donuts',
text2: 'For orders over \$20',
),
SizedBox(width: 8),
Banners(
containerColor: Color(0xfffEFBC64),
imgPath: 'assets/images/big-burger.png',
text1: 'Free Burgers',
text2: 'For orders over \$30',
),
],
),
),
SizedBox(height: 30),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
MiniBanners(
containerColor: Color(0xfffFFEF92),
text: 'Burger',
imgPath: 'assets/images/burger.png',
),
SizedBox(width: 8),
MiniBanners(
containerColor: Color(0xfffF5CAC3),
text: 'Fries',
imgPath: 'assets/images/fries.png',
),
SizedBox(width: 8),
MiniBanners(
containerColor: Color(0xfffA9D7DA),
text: 'Drink',
imgPath: 'assets/images/Drink.png',
),
SizedBox(width: 8),
MiniBanners(
containerColor: Color(0xfffB6D7CF),
text: 'Drink',
imgPath: 'assets/images/Drink.png',
),
],
),
),
SizedBox(height: 20),
Row(
children: [
Text(
'Best Offers',
style: GoogleFonts.aBeeZee(
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
],
),
SizedBox(height: 10),
Container(
child: Row(
children: [
Image.asset('assets/images/hot-dog.png'),
SizedBox(width: 8),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'French Dog',
style: GoogleFonts.aBeeZee(
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
Text(
'Testy & Spicy',
style: GoogleFonts.aBeeZee(
fontSize: 15,
fontWeight: FontWeight.w200,
),
),
],
),
],
),
height: 100,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
color: Color.fromARGB(255, 255, 255, 211),
),
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/Screens/signup_screen.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class SignUpScreen extends StatelessWidget {
const SignUpScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 50),
Text(
'Create an Account',
style: GoogleFonts.aBeeZee(
fontSize: 30,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 20),
TextField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.person),
labelText: 'Full Name',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
SizedBox(height: 20),
TextField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.alternate_email_rounded),
labelText: 'Email',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
SizedBox(height: 20),
TextField(
obscureText: true,
decoration: InputDecoration(
prefixIcon: Icon(Icons.password),
labelText: 'Password',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
SizedBox(height: 60),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 300,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color(0xfffF28482),
borderRadius: BorderRadius.circular(28)),
child: Center(child: Text('Sign Up')),
),
],
),
SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Already have an account? "),
TextButton(
onPressed: () {
// Navigate to login screen
},
child: Text('Sign In'),
),
],
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Flutter-Foodee-App/lib
|
mirrored_repositories/Flutter-Foodee-App/lib/Screens/my_cart_screen.dart
|
import 'package:flutter/material.dart';
import 'package:foodee_app/Screens/main_screen.dart';
import 'package:foodee_app/widgets/my_cart_items.dart';
import 'package:google_fonts/google_fonts.dart';
class MyCartScreen extends StatelessWidget {
const MyCartScreen({Key? key});
@override
Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(screenWidth * 0.05),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'My Cart',
style: GoogleFonts.aBeeZee(fontSize: screenWidth * 0.06),
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => MainScreen(),
),
);
},
child: Container(
padding: EdgeInsets.all(screenWidth * 0.01),
decoration: BoxDecoration(
color: Color(0xfffF5CAC3),
borderRadius: BorderRadius.circular(screenWidth * 0.03),
),
child: Icon(
Icons.close,
color: Color(0xfffF28482),
),
),
),
],
),
SizedBox(height: screenWidth * 0.08),
Stack(
children: [
Padding(
padding: const EdgeInsets.only(top: 12),
child: Divider(
color: Color(0xfffF28482),
),
),
Container(
height: screenWidth * 0.12,
width: screenWidth * 0.12,
decoration: BoxDecoration(
color: Color(0xfffF28482),
borderRadius: BorderRadius.circular(screenWidth * 0.3),
),
child: Center(
child: Text(
'1',
style: TextStyle(color: Colors.white),
),
),
),
Padding(
padding: EdgeInsets.only(left: screenWidth * 0.46),
child: Container(
height: screenWidth * 0.12,
width: screenWidth * 0.12,
decoration: BoxDecoration(
color: Color(0xfffFDE6E6),
borderRadius: BorderRadius.circular(screenWidth * 0.3),
),
child: Center(
child: Text(
'2',
style: TextStyle(color: Colors.white),
),
),
),
),
Padding(
padding: EdgeInsets.only(left: screenWidth * 0.92),
child: Container(
height: screenWidth * 0.12,
width: screenWidth * 0.12,
decoration: BoxDecoration(
color: Color(0xfffFDE6E6),
borderRadius: BorderRadius.circular(screenWidth * 0.3),
),
child: Center(
child: Text(
'3',
style: TextStyle(color: Colors.white),
),
),
),
),
],
),
SizedBox(height: screenWidth * 0.08),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Order',
style: GoogleFonts.aBeeZee(fontSize: screenWidth * 0.06),
),
Text(
'Clear all',
style: GoogleFonts.aBeeZee(
fontSize: screenWidth * 0.06,
color: Color(0xfffF28482),
),
)
],
),
SizedBox(height: screenWidth * 0.04),
MyCartItems(
imgPath: 'assets/images/big-burger.png',
text: 'Mr.Cheezy',
text1: '\$65.99',
text2: '7',
screenWidth: screenWidth,
),
SizedBox(height: screenWidth * 0.02),
MyCartItems(
imgPath: 'assets/images/donut.png',
text: 'Mr.Donut',
text1: '\$65.99',
text2: '9',
screenWidth: screenWidth,
),
SizedBox(height: screenWidth * 0.02),
MyCartItems(
imgPath: 'assets/images/bacon.png',
text: 'Mr.Bacon',
text1: '\$65.99',
text2: '1',
screenWidth: screenWidth,
),
SizedBox(height: screenWidth * 0.02),
MyCartItems(
imgPath: 'assets/images/big-burger.png',
text: 'Mr.Cheezy',
text1: '\$65.99',
text2: '7',
screenWidth: screenWidth,
),
SizedBox(height: screenWidth * 0.02),
Row(
children: [
Text(
'Don\'t Forget',
style: GoogleFonts.aBeeZee(fontSize: screenWidth * 0.06),
),
],
),
SizedBox(height: screenWidth * 0.02),
ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(
'Order Placed Successfully',
style: TextStyle(
color: Color(0xfffF28482),
fontSize: screenWidth * 0.06,
),
),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.check_circle,
color: Color(0xfffF28482),
size: screenWidth * 0.12,
),
SizedBox(height: screenWidth * 0.02),
Text(
'Your order has been placed successfully!',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: screenWidth * 0.04,
),
),
],
),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('OK'),
),
],
);
},
);
},
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(
vertical: screenWidth * 0.025,
horizontal: screenWidth * 0.06,
),
backgroundColor: Color(0xfffF28482),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(screenWidth * 0.1),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Purchase',
style: GoogleFonts.aBeeZee(
fontSize: screenWidth * 0.06,
color: Color(0xfffFFFFF),
),
),
SizedBox(width: screenWidth * 0.03),
Text(
'\$67.09',
style: GoogleFonts.aBeeZee(
fontSize: screenWidth * 0.06,
color: Color(0xfffFFFFF),
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
),
);
}
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.