Skip to content

Instantly share code, notes, and snippets.

View CodingWithTashi's full-sized avatar
💭
Code For Life

Kunchok Tashi CodingWithTashi

💭
Code For Life
View GitHub Profile
void main() {
String? temporaryValue;
print(temporaryValue?.toLowerCase());
}
void main() {
String? temporaryValue;
print(temporaryValue?.length);
}
import 'dart:isolate';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
android {
viewBinding {
enabled = true
}
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/testId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {
SingleItemBinding singleItemBinding;
List<String> mList;
CustomAdapter(List<String> mList){
this.mList =mList;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
singleItemBinding =SingleItemBinding.inflate(LayoutInflater.from(parent.getContext()),parent,false);
public class TestFragment extends Fragment {
FragmentTestBinding fragmentTestBinding;
public TestFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
fragmentTestBinding = FragmentTestBinding.inflate(getLayoutInflater(),container,false);
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TestFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/textData"
android:layout_width="match_parent"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
public class MainActivity extends AppCompatActivity {
ActivityMainBinding activityMainBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(activityMainBinding.getRoot());
activityMainBinding.textView.setText("Working!!");
}
}