Skip to content

Instantly share code, notes, and snippets.

@mirkancal
Created December 9, 2023 04:53
Show Gist options
  • Save mirkancal/32c1bbcf1c160f6653c3c60bc65da35e to your computer and use it in GitHub Desktop.
Save mirkancal/32c1bbcf1c160f6653c3c60bc65da35e to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
brightness: Brightness.dark,
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: VPNApp(),
);
}
}
class VPNApp extends StatefulWidget {
@override
_VPNAppState createState() => _VPNAppState();
}
class _VPNAppState extends State<VPNApp> {
int _selectedIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Proton VPN'),
actions: [
IconButton(
icon: Icon(Icons.percent),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.close),
onPressed: () {},
),
],
),
body: Column(
children: [
Expanded(
child: IndexedStack(
index: _selectedIndex,
children: [
CountriesTab(),
ProfilesTab(),
],
),
),
BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.public),
label: 'Countries',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profiles',
),
],
currentIndex: _selectedIndex,
onTap: (index) {
setState(() {
_selectedIndex = index;
});
},
),
],
),
);
}
}
class CountriesTab extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
children: [
VPNStatusCard(),
ListTile(
leading: Icon(Icons.flash_on),
title: Text('Fastest'),
),
ListTile(
leading: Icon(Icons.shuffle),
title: Text('Random'),
),
ListTile(
leading: Icon(Icons.circle, color: Colors.blue),
title: Text('Fast GE'),
),
ListTile(
leading: Icon(Icons.circle, color: Colors.orange),
title: Text('Romania'),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: ElevatedButton(
onPressed: () {},
child: Text('Create Profile'),
style: ElevatedButton.styleFrom(
primary: Colors.purple,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
),
),
TextButton(
onPressed: () {},
child: Text('Manage Profiles'),
),
],
);
}
}
class ProfilesTab extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Placeholder for Profiles tab content
return Center(
child: Text('Profiles content goes here'),
);
}
}
class VPNStatusCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
color: Colors.black54,
margin: EdgeInsets.all(16.0),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Georgia GE#07',
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 8.0),
Text('IP: 94.137.92.1'),
SizedBox(height: 8.0),
Text('Stealth'),
SizedBox(height: 8.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('17% Load'),
Text('2.0 KB/s ↓ 1.0 KB/s ↑'),
],
),
SizedBox(height: 16.0),
ElevatedButton(
onPressed: () {},
child: Text('Disconnect'),
style: ElevatedButton.styleFrom(
primary: Colors.red,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment